| Total Complexity | 87 |
| Total Lines | 630 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
Complex classes like XoopsModule often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use XoopsModule, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 25 | class XoopsModule extends XoopsObject |
||
| 26 | { |
||
| 27 | /** |
||
| 28 | * |
||
| 29 | * @var string |
||
| 30 | */ |
||
| 31 | public $modinfo; |
||
| 32 | /** |
||
| 33 | * |
||
| 34 | * @var string |
||
| 35 | */ |
||
| 36 | public $adminmenu; |
||
| 37 | /** |
||
| 38 | * |
||
| 39 | * @var array |
||
| 40 | */ |
||
| 41 | public $_msg; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Constructor |
||
| 45 | */ |
||
| 46 | public function __construct() |
||
| 47 | { |
||
| 48 | parent::__construct(); |
||
| 49 | $this->initVar('mid', XOBJ_DTYPE_INT, null, false); |
||
| 50 | $this->initVar('name', XOBJ_DTYPE_TXTBOX, null, true, 150); |
||
| 51 | $this->initVar('version', XOBJ_DTYPE_TXTBOX, null, false); |
||
| 52 | $this->initVar('last_update', XOBJ_DTYPE_INT, null, false); |
||
| 53 | $this->initVar('weight', XOBJ_DTYPE_INT, 0, false); |
||
| 54 | $this->initVar('isactive', XOBJ_DTYPE_INT, 1, false); |
||
| 55 | $this->initVar('dirname', XOBJ_DTYPE_OTHER, null, true); |
||
| 56 | $this->initVar('hasmain', XOBJ_DTYPE_INT, 0, false); |
||
| 57 | $this->initVar('hasadmin', XOBJ_DTYPE_INT, 0, false); |
||
| 58 | $this->initVar('hassearch', XOBJ_DTYPE_INT, 0, false); |
||
| 59 | $this->initVar('hasconfig', XOBJ_DTYPE_INT, 0, false); |
||
| 60 | $this->initVar('hascomments', XOBJ_DTYPE_INT, 0, false); |
||
| 61 | // RMV-NOTIFY |
||
| 62 | $this->initVar('hasnotification', XOBJ_DTYPE_INT, 0, false); |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Load module info |
||
| 67 | * |
||
| 68 | * @param string $dirname Directory Name |
||
| 69 | * @param boolean $verbose |
||
| 70 | */ |
||
| 71 | public function loadInfoAsVar($dirname, $verbose = true) |
||
| 72 | { |
||
| 73 | $dirname = basename($dirname); |
||
| 74 | if (!isset($this->modinfo)) { |
||
| 75 | $this->loadInfo($dirname, $verbose); |
||
| 76 | } |
||
| 77 | $this->setVar('name', $this->modinfo['name'], true); |
||
| 78 | $this->setVar('version', $this->modinfo['version'], true); |
||
| 79 | $this->setVar('dirname', $this->modinfo['dirname'], true); |
||
| 80 | $hasmain = (isset($this->modinfo['hasMain']) && $this->modinfo['hasMain'] == 1) ? 1 : 0; |
||
| 81 | $hasadmin = (isset($this->modinfo['hasAdmin']) && $this->modinfo['hasAdmin'] == 1) ? 1 : 0; |
||
| 82 | $hassearch = (isset($this->modinfo['hasSearch']) && $this->modinfo['hasSearch'] == 1) ? 1 : 0; |
||
| 83 | $hasconfig = ((isset($this->modinfo['config']) && is_array($this->modinfo['config'])) || !empty($this->modinfo['hasComments'])) ? 1 : 0; |
||
| 84 | $hascomments = (isset($this->modinfo['hasComments']) && $this->modinfo['hasComments'] == 1) ? 1 : 0; |
||
| 85 | // RMV-NOTIFY |
||
| 86 | $hasnotification = (isset($this->modinfo['hasNotification']) && $this->modinfo['hasNotification'] == 1) ? 1 : 0; |
||
| 87 | $this->setVar('hasmain', $hasmain); |
||
| 88 | $this->setVar('hasadmin', $hasadmin); |
||
| 89 | $this->setVar('hassearch', $hassearch); |
||
| 90 | $this->setVar('hasconfig', $hasconfig); |
||
| 91 | $this->setVar('hascomments', $hascomments); |
||
| 92 | // RMV-NOTIFY |
||
| 93 | $this->setVar('hasnotification', $hasnotification); |
||
| 94 | } |
||
| 95 | |||
| 96 | /** |
||
| 97 | * add a message |
||
| 98 | * |
||
| 99 | * @param string $str message to add |
||
| 100 | * @access public |
||
| 101 | */ |
||
| 102 | public function setMessage($str) |
||
| 105 | } |
||
| 106 | |||
| 107 | /** |
||
| 108 | * return the messages for this object as an array |
||
| 109 | * |
||
| 110 | * @return array an array of messages |
||
| 111 | * @access public |
||
| 112 | */ |
||
| 113 | public function getMessages() |
||
| 116 | } |
||
| 117 | |||
| 118 | /** |
||
| 119 | * Set module info |
||
| 120 | * |
||
| 121 | * @param string $name |
||
| 122 | * @param mixed $value |
||
| 123 | * @return bool |
||
| 124 | **/ |
||
| 125 | public function setInfo($name, $value) |
||
| 126 | { |
||
| 127 | if (empty($name)) { |
||
| 128 | $this->modinfo = $value; |
||
| 129 | } else { |
||
| 130 | $this->modinfo[$name] = $value; |
||
| 131 | } |
||
| 132 | |||
| 133 | return true; |
||
| 134 | } |
||
| 135 | |||
| 136 | /** |
||
| 137 | * Get module info |
||
| 138 | * |
||
| 139 | * @param string $name |
||
| 140 | * @return array|string Array of module information. |
||
| 141 | * If {@link $name} is set, returns a single module information item as string. |
||
| 142 | */ |
||
| 143 | public function &getInfo($name = null) |
||
| 158 | } |
||
| 159 | |||
| 160 | /** |
||
| 161 | * Get statut |
||
| 162 | * |
||
| 163 | * @return string |
||
| 164 | */ |
||
| 165 | public function getStatus() |
||
| 166 | { |
||
| 167 | if (isset($this->modinfo['version'])) { |
||
| 168 | return substr(strrchr($this->modinfo['version'], '-'), 1); |
||
| 169 | } else { |
||
| 170 | $return = ''; |
||
| 171 | } |
||
| 172 | } |
||
| 173 | |||
| 174 | /** |
||
| 175 | * Compares two "XOOPS-standardized" version number strings. |
||
| 176 | * |
||
| 177 | * @param string $version1 |
||
| 178 | * @param string $version2 |
||
| 179 | * @param string $operator |
||
| 180 | * @return boolean The function will return true if the relationship is the one specified by the operator, false otherwise. |
||
| 181 | */ |
||
| 182 | public function versionCompare($version1 = '',$version2 = '', $operator = '<') |
||
| 183 | { |
||
| 184 | $version1 = strtolower($version1); |
||
| 185 | $version2 = strtolower($version2); |
||
| 186 | if (true == strpos($version2, '-stable')){ |
||
| 187 | $version2 = substr($version2, 0, strpos($version2, '-stable')); |
||
| 188 | } |
||
| 189 | if (true == strpos($version1, '-stable')){ |
||
| 190 | $version1 = substr($version1, 0, strpos($version1, '-stable')); |
||
| 191 | } |
||
| 192 | return version_compare($version1, $version2, $operator); |
||
| 193 | } |
||
| 194 | |||
| 195 | /** |
||
| 196 | * Get a link to the modules main page |
||
| 197 | * |
||
| 198 | * @return string FALSE on fail |
||
| 199 | */ |
||
| 200 | public function mainLink() |
||
| 201 | { |
||
| 202 | if ($this->getVar('hasmain') == 1) { |
||
| 203 | $ret = '<a href="' . XOOPS_URL . '/modules/' . $this->getVar('dirname') . '/">' . $this->getVar('name') . '</a>'; |
||
| 204 | |||
| 205 | return $ret; |
||
| 206 | } |
||
| 207 | |||
| 208 | return false; |
||
| 209 | } |
||
| 210 | |||
| 211 | /** |
||
| 212 | * Get links to the subpages |
||
| 213 | * |
||
| 214 | * @return string |
||
| 215 | */ |
||
| 216 | public function subLink() |
||
| 217 | { |
||
| 218 | $ret = array(); |
||
| 219 | if ($this->getInfo('sub') && is_array($this->getInfo('sub'))) { |
||
| 220 | foreach ($this->getInfo('sub') as $submenu) { |
||
| 221 | $ret[] = array( |
||
| 222 | 'name' => $submenu['name'], |
||
| 223 | 'url' => $submenu['url']); |
||
| 224 | } |
||
| 225 | } |
||
| 226 | |||
| 227 | return $ret; |
||
| 228 | } |
||
| 229 | |||
| 230 | /** |
||
| 231 | * Load the admin menu for the module |
||
| 232 | */ |
||
| 233 | public function loadAdminMenu() |
||
| 234 | { |
||
| 235 | if ($this->getInfo('adminmenu') && $this->getInfo('adminmenu') != '' && file_exists(XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/' . $this->getInfo('adminmenu'))) { |
||
| 236 | $adminmenu = array(); |
||
| 237 | include XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/' . $this->getInfo('adminmenu'); |
||
| 238 | $this->adminmenu =& $adminmenu; |
||
| 239 | } |
||
| 240 | } |
||
| 241 | |||
| 242 | /** |
||
| 243 | * Get the admin menu for the module |
||
| 244 | * |
||
| 245 | * @return string |
||
| 246 | */ |
||
| 247 | public function &getAdminMenu() |
||
| 248 | { |
||
| 249 | if (!isset($this->adminmenu)) { |
||
| 250 | $this->loadAdminMenu(); |
||
| 251 | } |
||
| 252 | |||
| 253 | return $this->adminmenu; |
||
| 254 | } |
||
| 255 | |||
| 256 | /** |
||
| 257 | * Load the module info for this module |
||
| 258 | * |
||
| 259 | * @param string $dirname Module directory |
||
| 260 | * @param bool $verbose Give an error on fail? |
||
| 261 | * |
||
| 262 | * @return bool true if loaded |
||
| 263 | */ |
||
| 264 | public function loadInfo($dirname, $verbose = true) |
||
| 265 | { |
||
| 266 | static $modVersions; |
||
| 267 | $dirname = basename($dirname); |
||
| 268 | if (isset($modVersions[$dirname])) { |
||
| 269 | $this->modinfo = $modVersions[$dirname]; |
||
| 270 | |||
| 271 | return true; |
||
| 272 | } |
||
| 273 | global $xoopsConfig; |
||
| 274 | if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/language/' . $xoopsConfig['language'] . '/modinfo.php'))) { |
||
| 275 | include_once $file; |
||
| 276 | } elseif (file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/language/english/modinfo.php'))) { |
||
| 277 | include_once $file; |
||
| 278 | } |
||
| 279 | |||
| 280 | if (!file_exists($file = $GLOBALS['xoops']->path('modules/' . $dirname . '/xoops_version.php'))) { |
||
| 281 | if (false !== (bool)$verbose) { |
||
| 282 | echo "Module File for $dirname Not Found!"; |
||
| 283 | } |
||
| 284 | |||
| 285 | return false; |
||
| 286 | } |
||
| 287 | include $file; |
||
| 288 | $modVersions[$dirname] = $modversion; |
||
| 289 | $this->modinfo = $modVersions[$dirname]; |
||
| 290 | |||
| 291 | return true; |
||
| 292 | } |
||
| 293 | |||
| 294 | /** |
||
| 295 | * Search contents within a module |
||
| 296 | * |
||
| 297 | * @param string $term |
||
| 298 | * @param string $andor 'AND' or 'OR' |
||
| 299 | * @param integer $limit |
||
| 300 | * @param integer $offset |
||
| 301 | * @param integer $userid |
||
| 302 | * @return mixed Search result. |
||
| 303 | */ |
||
| 304 | public function search($term = '', $andor = 'AND', $limit = 0, $offset = 0, $userid = 0) |
||
| 305 | { |
||
| 306 | if ($this->getVar('hassearch') != 1) { |
||
| 307 | return false; |
||
| 308 | } |
||
| 309 | $search =& $this->getInfo('search'); |
||
| 310 | if ($this->getVar('hassearch') != 1 || !isset($search['file']) || !isset($search['func']) || $search['func'] == '' || $search['file'] == '') { |
||
| 311 | return false; |
||
| 312 | } |
||
| 313 | if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/' . $search['file']))) { |
||
| 314 | include_once $file; |
||
| 315 | } else { |
||
| 316 | return false; |
||
| 317 | } |
||
| 318 | if (function_exists($search['func'])) { |
||
| 319 | $func = $search['func']; |
||
| 320 | |||
| 321 | return $func($term, $andor, $limit, $offset, $userid); |
||
| 322 | } |
||
| 323 | |||
| 324 | return false; |
||
| 325 | } |
||
| 326 | |||
| 327 | /** |
||
| 328 | * Returns Class Base Variable mid |
||
| 329 | * @param string $format |
||
| 330 | * @return mixed |
||
| 331 | */ |
||
| 332 | public function id($format = 'N') |
||
| 335 | } |
||
| 336 | |||
| 337 | /** |
||
| 338 | * Returns Class Base Variable mid |
||
| 339 | * @param string $format |
||
| 340 | * @return mixed |
||
| 341 | */ |
||
| 342 | public function mid($format = '') |
||
| 343 | { |
||
| 344 | return $this->getVar('mid', $format); |
||
| 345 | } |
||
| 346 | |||
| 347 | /** |
||
| 348 | * Returns Class Base Variable name |
||
| 349 | * @param string $format |
||
| 350 | * @return mixed |
||
| 351 | */ |
||
| 352 | public function name($format = '') |
||
| 353 | { |
||
| 354 | return $this->getVar('name', $format); |
||
| 355 | } |
||
| 356 | |||
| 357 | /** |
||
| 358 | * Returns Class Base Variable version |
||
| 359 | * @param string $format |
||
| 360 | * @return mixed |
||
| 361 | */ |
||
| 362 | public function version($format = '') |
||
| 363 | { |
||
| 364 | return $this->getVar('version', $format); |
||
| 365 | } |
||
| 366 | |||
| 367 | /** |
||
| 368 | * Returns Class Base Variable last_update |
||
| 369 | * @param string $format |
||
| 370 | * @return mixed |
||
| 371 | */ |
||
| 372 | public function last_update($format = '') |
||
| 373 | { |
||
| 374 | return $this->getVar('last_update', $format); |
||
| 375 | } |
||
| 376 | |||
| 377 | /** |
||
| 378 | * Returns Class Base Variable weight |
||
| 379 | * @param string $format |
||
| 380 | * @return mixed |
||
| 381 | */ |
||
| 382 | public function weight($format = '') |
||
| 383 | { |
||
| 384 | return $this->getVar('weight', $format); |
||
| 385 | } |
||
| 386 | |||
| 387 | /** |
||
| 388 | * Returns Class Base Variable isactive |
||
| 389 | * @param string $format |
||
| 390 | * @return mixed |
||
| 391 | */ |
||
| 392 | public function isactive($format = '') |
||
| 393 | { |
||
| 394 | return $this->getVar('isactive', $format); |
||
| 395 | } |
||
| 396 | |||
| 397 | /** |
||
| 398 | * Returns Class Base Variable dirname |
||
| 399 | * @param string $format |
||
| 400 | * @return mixed |
||
| 401 | */ |
||
| 402 | public function dirname($format = '') |
||
| 403 | { |
||
| 404 | return $this->getVar('dirname', $format); |
||
| 405 | } |
||
| 406 | |||
| 407 | /** |
||
| 408 | * Returns Class Base Variable hasmain |
||
| 409 | * @param string $format |
||
| 410 | * @return mixed |
||
| 411 | */ |
||
| 412 | public function hasmain($format = '') |
||
| 413 | { |
||
| 414 | return $this->getVar('hasmain', $format); |
||
| 415 | } |
||
| 416 | |||
| 417 | /** |
||
| 418 | * Returns Class Base Variable hasadmin |
||
| 419 | * @param string $format |
||
| 420 | * @return mixed |
||
| 421 | */ |
||
| 422 | public function hasadmin($format = '') |
||
| 423 | { |
||
| 424 | return $this->getVar('hasadmin', $format); |
||
| 425 | } |
||
| 426 | |||
| 427 | /** |
||
| 428 | * Returns Class Base Variable hassearch |
||
| 429 | * @param string $format |
||
| 430 | * @return mixed |
||
| 431 | */ |
||
| 432 | public function hassearch($format = '') |
||
| 433 | { |
||
| 434 | return $this->getVar('hassearch', $format); |
||
| 435 | } |
||
| 436 | |||
| 437 | /** |
||
| 438 | * Returns Class Base Variable hasconfig |
||
| 439 | * @param string $format |
||
| 440 | * @return mixed |
||
| 441 | */ |
||
| 442 | public function hasconfig($format = '') |
||
| 443 | { |
||
| 444 | return $this->getVar('hasconfig', $format); |
||
| 445 | } |
||
| 446 | |||
| 447 | /** |
||
| 448 | * Returns Class Base Variable hascomments |
||
| 449 | * @param string $format |
||
| 450 | * @return mixed |
||
| 451 | */ |
||
| 452 | public function hascomments($format = '') |
||
| 453 | { |
||
| 454 | return $this->getVar('hascomments', $format); |
||
| 455 | } |
||
| 456 | |||
| 457 | /** |
||
| 458 | * Returns Class Base Variable hasnotification |
||
| 459 | * @param string $format |
||
| 460 | * @return mixed |
||
| 461 | */ |
||
| 462 | public function hasnotification($format = '') |
||
| 463 | { |
||
| 464 | return $this->getVar('hasnotification', $format); |
||
| 465 | } |
||
| 466 | |||
| 467 | /** |
||
| 468 | * @param $dirname |
||
| 469 | * |
||
| 470 | * @return mixed |
||
| 471 | */ |
||
| 472 | public static function getByDirname($dirname) |
||
| 473 | { |
||
| 474 | /* @var XoopsModuleHandler $modhandler */ |
||
| 475 | $modhandler = xoops_getHandler('module'); |
||
| 476 | $inst = $modhandler->getByDirname($dirname); |
||
| 477 | |||
| 478 | return $inst; |
||
| 479 | } |
||
| 480 | |||
| 481 | ##################### Deprecated Methods ###################### |
||
| 482 | |||
| 483 | /**#@+ |
||
| 484 | * @deprecated |
||
| 485 | */ |
||
| 486 | public function checkAccess() |
||
| 491 | } |
||
| 492 | |||
| 493 | /** |
||
| 494 | * @param string $type |
||
| 495 | * |
||
| 496 | * @return bool |
||
| 497 | */ |
||
| 498 | public function loadLanguage($type = 'main') |
||
| 499 | { |
||
| 500 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 501 | |||
| 502 | return false; |
||
| 503 | } |
||
| 504 | |||
| 505 | /** |
||
| 506 | * @return bool |
||
| 507 | */ |
||
| 508 | public function loadErrorMessages() |
||
| 509 | { |
||
| 510 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 511 | |||
| 512 | return false; |
||
| 513 | } |
||
| 514 | |||
| 515 | /** |
||
| 516 | * @return bool |
||
| 517 | */ |
||
| 518 | public function getCurrentPage() |
||
| 519 | { |
||
| 520 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 521 | |||
| 522 | return false; |
||
| 523 | } |
||
| 524 | |||
| 525 | /** |
||
| 526 | * @param array $admingroups |
||
| 527 | * @param array $accessgroups |
||
| 528 | * |
||
| 529 | * @return bool |
||
| 530 | */ |
||
| 531 | public function install($admingroups = array(), $accessgroups = array()) |
||
| 532 | { |
||
| 533 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 534 | |||
| 535 | return false; |
||
| 536 | } |
||
| 537 | |||
| 538 | /** |
||
| 539 | * @return bool |
||
| 540 | */ |
||
| 541 | public function update() |
||
| 542 | { |
||
| 543 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 544 | |||
| 545 | return false; |
||
| 546 | } |
||
| 547 | |||
| 548 | /** |
||
| 549 | * @return bool |
||
| 550 | */ |
||
| 551 | public function insert() |
||
| 552 | { |
||
| 553 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 554 | |||
| 555 | return false; |
||
| 556 | } |
||
| 557 | |||
| 558 | /** |
||
| 559 | * @return bool |
||
| 560 | */ |
||
| 561 | public function executeSQL() |
||
| 562 | { |
||
| 563 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 564 | |||
| 565 | return false; |
||
| 566 | } |
||
| 567 | |||
| 568 | /** |
||
| 569 | * @return bool |
||
| 570 | */ |
||
| 571 | public function insertTemplates() |
||
| 572 | { |
||
| 573 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 574 | |||
| 575 | return false; |
||
| 576 | } |
||
| 577 | |||
| 578 | /** |
||
| 579 | * @param $template |
||
| 580 | * @param bool $block |
||
| 581 | * |
||
| 582 | * @return bool |
||
| 583 | */ |
||
| 584 | public function gettemplate($template, $block = false) |
||
| 585 | { |
||
| 586 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 587 | |||
| 588 | return false; |
||
| 589 | } |
||
| 590 | |||
| 591 | /** |
||
| 592 | * @return bool |
||
| 593 | */ |
||
| 594 | public function insertBlocks() |
||
| 595 | { |
||
| 596 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 597 | |||
| 598 | return false; |
||
| 599 | } |
||
| 600 | |||
| 601 | /** |
||
| 602 | * @return bool |
||
| 603 | */ |
||
| 604 | public function insertConfigCategories() |
||
| 605 | { |
||
| 606 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 607 | |||
| 608 | return false; |
||
| 609 | } |
||
| 610 | |||
| 611 | /** |
||
| 612 | * @return bool |
||
| 613 | */ |
||
| 614 | public function insertConfig() |
||
| 615 | { |
||
| 616 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 617 | |||
| 618 | return false; |
||
| 619 | } |
||
| 620 | |||
| 621 | /** |
||
| 622 | * @return bool |
||
| 623 | */ |
||
| 624 | public function insertProfileFields() |
||
| 625 | { |
||
| 626 | trigger_error(__CLASS__ . '::' . __FUNCTION__ . ' is deprecated', E_USER_WARNING); |
||
| 627 | |||
| 628 | return false; |
||
| 629 | } |
||
| 630 | |||
| 631 | /** |
||
| 632 | * @param $type |
||
| 633 | * @param int $state |
||
| 634 | * |
||
| 635 | * @return bool |
||
| 636 | */ |
||
| 637 | public function executeScript($type, $state = 2) |
||
| 642 | } |
||
| 643 | |||
| 644 | /** |
||
| 645 | * @param $groups |
||
| 646 | * @param $type |
||
| 647 | * |
||
| 648 | * @return bool |
||
| 649 | */ |
||
| 650 | public function insertGroupPermissions($groups, $type) |
||
| 655 | } |
||
| 656 | /**#@-*/ |
||
| 657 | } |
||
| 658 | |||
| 659 | /** |
||
| 660 | * XOOPS module handler class. |
||
| 661 | * |
||
| 662 | * This class is responsible for providing data access mechanisms to the data source |
||
| 663 | * of XOOPS module class objects. |
||
| 664 | * |
||
| 665 | * @package kernel |
||
| 666 | * @author Kazumi Ono <[email protected]> |
||
| 667 | * @copyright (c) 2000-2016 XOOPS Project - www.xoops.org |
||
| 668 | * |
||
| 669 | * @todo Why is this not a XoopsPersistableObjectHandler? |
||
| 670 | */ |
||
| 671 | class XoopsModuleHandler extends XoopsObjectHandler |
||
| 672 | { |
||
| 673 | /** |
||
| 674 | * holds an array of cached module references, indexed by module id |
||
| 675 | * |
||
| 676 | * @var array |
||
| 677 | * @access private |
||
| 678 | */ |
||
| 679 | public $_cachedModule_mid = array(); |
||
| 680 | |||
| 681 | /** |
||
| 682 | * holds an array of cached module references, indexed by module dirname |
||
| 683 | * |
||
| 962 |