XOOPS  2.6.0
helper.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  */
11 
20 {
26  public function init()
27  {
28  $this->setDirname('menus');
29  }
30 
34  public static function getInstance()
35  {
36  return parent::getInstance();
37  }
38 
42  public function getHandlerMenus()
43  {
44  return $this->getHandler('menus');
45  }
46 
50  public function getHandlerMenu()
51  {
52  return $this->getHandler('menu');
53  }
54 
61  public function getSkinInfo($skin, $skin_from_theme = false)
62  {
63  $error = false;
64  $path = '';
65  if ($skin_from_theme) {
66  $path = "themes/" . $this->xoops()->getConfig('theme_set') . "/menu";
67  if (!XoopsLoad::fileExists($this->xoops()->path("{$path}/skin_version.php"))) {
68  $error = true;
69  }
70  }
71 
72  if ($error || !$skin_from_theme) {
73  $path = "modules/menus/skins/{$skin}";
74  }
75 
76  $file = $this->xoops()->path("{$path}/skin_version.php");
77  $info = array();
78 
80  include $file;
82  }
83 
84  $info['path'] = $this->xoops()->path($path);
85  $info['url'] = $this->xoops()->url($path);
86 
87  if (!isset($info['template'])) {
88  $info['template'] = $this->xoops()->path("modules/menus/templates/block.tpl");
89  } else {
90  $info['template'] = $this->xoops()->path("{$path}/" . $info['template']);
91  }
92 
93  if (!isset($info['prefix'])) {
94  $info['prefix'] = $skin;
95  }
96 
97  if (isset($info['css'])) {
98  $info['css'] = (array)$info['css'];
99  foreach ($info['css'] as $key => $value) {
100  $info['css'][$key] = $this->xoops()->url("{$path}/{$value}");
101  }
102  }
103 
104  if (isset($info['js'])) {
105  $info['js'] = (array)$info['js'];
106  foreach ($info['js'] as $key => $value) {
107  $info['js'][$key] = $this->xoops()->url("{$path}/{$value}");
108  }
109  }
110 
111  if (!isset($info['config'])) {
112  $info['config'] = array();
113  }
114 
115  return $info;
116  }
117 }
getHandlerMenu()
Definition: helper.php:50
$path
Definition: execute.php:31
if(empty($settings['ROOT_PATH'])) elseif(empty($settings['DB_PARAMETERS'])) $error
if(!isset($xoops->paths[$path_type])) if($path_type== 'var') $file
Definition: browse.php:55
static getInstance()
Definition: helper.php:34
getSkinInfo($skin, $skin_from_theme=false)
Definition: helper.php:61
getHandlerMenus()
Definition: helper.php:42
static fileExists($file)
Definition: xoopsload.php:506
if(isset($_POST['name'])) $info
Definition: execute.php:57
init()
Definition: helper.php:26