[Jaws-commits] r13497 - in branches/0.8/html/gadgets: ControlPanel Layout

afz at jaws-project.com afz at jaws-project.com
Sat Aug 25 17:48:16 UTC 2012


Author: afz
Date: 2012-08-25 17:48:16 +0000 (Sat, 25 Aug 2012)
New Revision: 13497

Added:
   branches/0.8/html/gadgets/ControlPanel/AdminAjax.php
Modified:
   branches/0.8/html/gadgets/ControlPanel/AdminHTML.php
   branches/0.8/html/gadgets/Layout/AdminHTML.php
Log:
compatible control-panel and layout gadget with new changes in ajax stuff

Added: branches/0.8/html/gadgets/ControlPanel/AdminAjax.php
===================================================================
--- branches/0.8/html/gadgets/ControlPanel/AdminAjax.php	                        (rev 0)
+++ branches/0.8/html/gadgets/ControlPanel/AdminAjax.php	2012-08-25 17:48:16 UTC (rev 13497)
@@ -0,0 +1,23 @@
+<?php
+/**
+ * ControlPanel AJAX API
+ *
+ * @category   Ajax
+ * @package    ControlPanel
+ * @author     Ali Fazelzadeh <afz at php.net>
+ * @copyright  2012 Jaws Development Group
+ * @license    http://www.gnu.org/copyleft/lesser.html
+ */
+class ControlPanelAdminAjax extends Jaws_Ajax
+{
+    /**
+     * Constructor
+     *
+     * @access  public
+     */
+    function ControlPanelAdminAjax(&$model)
+    {
+        $this->_Model =& $model;
+    }
+
+}
\ No newline at end of file

Modified: branches/0.8/html/gadgets/ControlPanel/AdminHTML.php
===================================================================
--- branches/0.8/html/gadgets/ControlPanel/AdminHTML.php	2012-08-25 17:28:25 UTC (rev 13496)
+++ branches/0.8/html/gadgets/ControlPanel/AdminHTML.php	2012-08-25 17:48:16 UTC (rev 13497)
@@ -40,6 +40,8 @@
      */
     function MainMenu()
     {
+        $this->AjaxMe('script.js');
+
         // Load the template
         $tpl = new Jaws_Template('gadgets/ControlPanel/templates/');
         $tpl->Load('MainMenu.html');

Modified: branches/0.8/html/gadgets/Layout/AdminHTML.php
===================================================================
--- branches/0.8/html/gadgets/Layout/AdminHTML.php	2012-08-25 17:28:25 UTC (rev 13496)
+++ branches/0.8/html/gadgets/Layout/AdminHTML.php	2012-08-25 17:48:16 UTC (rev 13497)
@@ -71,10 +71,18 @@
         $GLOBALS['app']->InstanceLayout();
 
         $fakeLayout = new Jaws_Layout();
-        $fakeLayout->Load(true);
+        $fakeLayout->Load();
+        $fakeLayout->AddScriptLink('libraries/prototype/prototype.js');
+        $fakeLayout->AddScriptLink('libraries/prototype/scriptaculous.js');
+        $fakeLayout->AddScriptLink('include/Jaws/Ajax/Ajax.js');
+        $fakeLayout->AddScriptLink(BASE_SCRIPT . '?gadget=Layout&action=Ajax&client');
+        $fakeLayout->AddScriptLink('gadgets/Layout/resources/script.js');
+        $fakeLayout->AddScriptLink('libraries/greybox/AJS.js');
+        $fakeLayout->AddScriptLink('libraries/greybox/AJS_fx.js');
+        $fakeLayout->AddScriptLink('libraries/greybox/gb_scripts.js');
+
         $layoutContent = $fakeLayout->_Template->Blocks['layout']->Content;
         $useLayoutMode = $fakeLayout->_Template->VariableExists('layout-mode');
-        
         $layoutContent = preg_replace(
                             '$<body([^>]*)>$i',
                             '<body\1>' . $working_box . $msg_box . $this->getLayoutControls($useLayoutMode),
@@ -83,11 +91,6 @@
         $fakeLayout->_Template->Blocks['layout']->Content = $layoutContent;
 
         $fakeLayout->_Template->SetVariable('site-title', $GLOBALS['app']->Registry->Get('/config/site_name'));
-        $fakeLayout->AddScriptLink(BASE_SCRIPT . '?gadget=Layout&action=Ajax&client');
-        $fakeLayout->AddScriptLink('gadgets/Layout/resources/script.js');
-        $fakeLayout->AddScriptLink('libraries/greybox/AJS.js');
-        $fakeLayout->AddScriptLink('libraries/greybox/AJS_fx.js');
-        $fakeLayout->AddScriptLink('libraries/greybox/gb_scripts.js');
 
         $fakeLayout->AddHeadLink(PIWI_URL . 'piwidata/css/default.css', 'stylesheet', 'text/css', 'default');
         $fakeLayout->AddHeadLink('gadgets/Layout/resources/style.css', 'stylesheet', 'text/css');



More information about the Jaws-commits mailing list