Changeset 9245
- Timestamp:
- 08/13/08 22:31:12 (4 months ago)
- Files:
-
- trunk/jaws/html/include/Jaws/Gadget.php (modified) (11 diffs)
- trunk/jaws/html/include/Jaws/Layout.php (modified) (1 diff)
- trunk/jaws/html/include/Jaws/Plugin.php (modified) (2 diffs)
- trunk/jaws/html/include/Jaws/Widgets/TextArea.php (modified) (1 diff)
- trunk/jaws/html/include/Jaws/Widgets/TinyMCE.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/jaws/html/include/Jaws/Gadget.php
r9244 r9245 318 318 // is an empty action? 319 319 if (empty($this->_Action) || $this->_Action == 'DefaultAction') { 320 $this->_Action = $GLOBALS['app']->Registry->Get('default_action', $this->_Name , JAWS_REGISTRY_GADGET);320 $this->_Action = $GLOBALS['app']->Registry->Get('default_action', $this->_Name); 321 321 if (empty($this->_Action)) { 322 322 $this->_Action = 'DefaultAction'; … … 407 407 if (file_exists($file)) { 408 408 $GLOBALS['app']->Registry->LoadFile($plugin, 'plugins'); 409 $use_in = $GLOBALS['app']->Registry->Get('use_in', $plugin , JAWS_REGISTRY_PLUGIN);409 $use_in = $GLOBALS['app']->Registry->Get('use_in', $plugin); 410 410 if (!Jaws_Error::isError($use_in) && ($use_in == '*' || in_array($gadget, explode(',', $use_in)))) { 411 411 if (!isset($GLOBALS['plugins'][$plugin]['obj'])) { … … 450 450 // Check if gadget is enabled 451 451 ///FIXME check for errors 452 if ($GLOBALS['app']->Registry->Get('enabled', $gadget , JAWS_REGISTRY_GADGET) != 'true') {452 if ($GLOBALS['app']->Registry->Get('enabled', $gadget) != 'true') { 453 453 Jaws_Error::Fatal('Gadget is not enabled', __FILE__, __LINE__); 454 454 } … … 482 482 483 483 if ( 484 $GLOBALS['app']->Registry->Get('enabled', $gadget , JAWS_REGISTRY_GADGET) == 'true' &&484 $GLOBALS['app']->Registry->Get('enabled', $gadget) == 'true' && 485 485 $GLOBALS['app']->Registry->Get('main_gadget') != $gadget 486 486 ) { 487 $GLOBALS['app']->Registry->Set('enabled', 'false', $gadget , JAWS_REGISTRY_GADGET);487 $GLOBALS['app']->Registry->Set('enabled', 'false', $gadget); 488 488 } 489 489 $GLOBALS['app']->Registry->Commit('core'); //Commit all changes to core … … 528 528 $model->UninstallACLs(); 529 529 530 $GLOBALS['app']->Registry->DeleteKey('enabled', $gadget , JAWS_REGISTRY_GADGET);531 $GLOBALS['app']->Registry->DeleteKey('version', $gadget , JAWS_REGISTRY_GADGET);532 $GLOBALS['app']->Registry->DeleteKey('requires', $gadget , JAWS_REGISTRY_GADGET);530 $GLOBALS['app']->Registry->DeleteKey('enabled', $gadget); 531 $GLOBALS['app']->Registry->DeleteKey('version', $gadget); 532 $GLOBALS['app']->Registry->DeleteKey('requires', $gadget); 533 533 $GLOBALS['app']->Registry->Commit($gadget); //Commit all changes 534 534 $GLOBALS['app']->Registry->Commit('core'); //Commit all changes to core … … 647 647 } 648 648 649 $currentVersion = $GLOBALS['app']->Registry->Get('version', $gadget , JAWS_REGISTRY_GADGET);649 $currentVersion = $GLOBALS['app']->Registry->Get('version', $gadget); 650 650 $newVersion = $info->GetVersion(); 651 651 … … 696 696 if (is_string($instance)) { 697 697 //Instance has the new version number 698 $GLOBALS['app']->Registry->Set('version', $instance, $gadget , JAWS_REGISTRY_GADGET);698 $GLOBALS['app']->Registry->Set('version', $instance, $gadget); 699 699 } else { 700 700 //Use the latest (current) version 701 $GLOBALS['app']->Registry->Set('version', $newVersion, $gadget , JAWS_REGISTRY_GADGET);701 $GLOBALS['app']->Registry->Set('version', $newVersion, $gadget); 702 702 } 703 703 … … 742 742 $core = $info->GetAttribute('core_gadget'); 743 743 744 $status = $GLOBALS['app']->Registry->Get('enabled', $gadget , JAWS_REGISTRY_GADGET);744 $status = $GLOBALS['app']->Registry->Get('enabled', $gadget); 745 745 if ($status !== null) { 746 $GLOBALS['app']->Registry->Set('enabled', 'true', $gadget , JAWS_REGISTRY_GADGET);746 $GLOBALS['app']->Registry->Set('enabled', 'true', $gadget); 747 747 } else { 748 748 //This can fail if user doesn't name the gadget model as: $gadgetAdminModel … … 763 763 // Applying the keys that every gadget gets 764 764 $requires = implode($req, ', '); 765 $GLOBALS['app']->Registry->NewKeyEx(array('enabled', 'true', $gadget , JAWS_REGISTRY_GADGET),766 array('version', $info->GetVersion(), $gadget , JAWS_REGISTRY_GADGET),767 array('requires', $requires, $gadget , JAWS_REGISTRY_GADGET));765 $GLOBALS['app']->Registry->NewKeyEx(array('enabled', 'true', $gadget), 766 array('version', $info->GetVersion(), $gadget), 767 array('requires', $requires, $gadget)); 768 768 // ACL keys 769 769 $model->InstallACLs(); … … 829 829 $items.= $GLOBALS['app']->Registry->Get('enabled_core_gadgets'); 830 830 if (is_dir(JAWS_PATH . 'gadgets/' . $gadget) && 831 $GLOBALS['app']->Registry->Get('enabled', $gadget , JAWS_REGISTRY_GADGET) == 'true' &&831 $GLOBALS['app']->Registry->Get('enabled', $gadget) == 'true' && 832 832 in_array($gadget, explode(',', $items))) 833 833 { … … 854 854 } 855 855 856 $current_version = $GLOBALS['app']->Registry->Get('version', $gadget , JAWS_REGISTRY_GADGET);856 $current_version = $GLOBALS['app']->Registry->Get('version', $gadget); 857 857 $gadget_version = $info->GetVersion();; 858 858 trunk/jaws/html/include/Jaws/Layout.php
r9235 r9245 488 488 function PutGadget($gadget, $action, $section, $requested = false) 489 489 { 490 $enabled = $GLOBALS['app']->Registry->Get('enabled', $gadget , JAWS_REGISTRY_GADGET);490 $enabled = $GLOBALS['app']->Registry->Get('enabled', $gadget); 491 491 if (Jaws_Error::isError($enabled)) { 492 492 $enabled = 'false'; trunk/jaws/html/include/Jaws/Plugin.php
r9244 r9245 184 184 } 185 185 186 if (!$GLOBALS['app']->Registry->NewKey('enabled', 'true', $plugin , JAWS_REGISTRY_PLUGIN) ||187 !$GLOBALS['app']->Registry->NewKey('use_in', '*', $plugin , JAWS_REGISTRY_PLUGIN))186 if (!$GLOBALS['app']->Registry->NewKey('enabled', 'true', $plugin) || 187 !$GLOBALS['app']->Registry->NewKey('use_in', '*', $plugin)) 188 188 { 189 189 return new Jaws_Error(_t('JMS_PLUGINS_ENABLED_FAILURE', $plugin), $plugin); … … 267 267 268 268 $GLOBALS['app']->Registry->Set('enabled_plugins', $new); 269 $GLOBALS['app']->Registry->DeleteKey('enabled', $plugin , JAWS_REGISTRY_PLUGIN);270 $GLOBALS['app']->Registry->DeleteKey('use_in', $plugin , JAWS_REGISTRY_PLUGIN);269 $GLOBALS['app']->Registry->DeleteKey('enabled', $plugin); 270 $GLOBALS['app']->Registry->DeleteKey('use_in', $plugin); 271 271 272 272 require_once $file; trunk/jaws/html/include/Jaws/Widgets/TextArea.php
r9235 r9245 200 200 $file = JAWS_PATH . 'plugins/' . $plugin . '/' . $plugin . '.php'; 201 201 $GLOBALS['app']->Registry->LoadFile($plugin, 'plugins'); 202 $use_in = $GLOBALS['app']->Registry->Get('use_in', $plugin , JAWS_REGISTRY_PLUGIN);202 $use_in = $GLOBALS['app']->Registry->Get('use_in', $plugin); 203 203 if (file_exists($file) && (in_array($this->_Gadget, explode(',', $use_in)) || $use_in == '*')) { 204 204 require_once $file; trunk/jaws/html/include/Jaws/Widgets/TinyMCE.php
r9235 r9245 158 158 $file = JAWS_PATH . 'plugins/' . $plugin . '/' . $plugin . '.php'; 159 159 $GLOBALS['app']->Registry->LoadFile($plugin, 'plugins'); 160 $use_in = $GLOBALS['app']->Registry->Get('use_in', $plugin , JAWS_REGISTRY_PLUGIN);160 $use_in = $GLOBALS['app']->Registry->Get('use_in', $plugin); 161 161 if (file_exists($file) && (in_array($this->_Gadget, explode(',', $use_in)) || $use_in == '*')) { 162 162 require_once $file;
