Exemple #1
0
 /**
  * 
  * pass apis, and they will be accesible in javascripot through this.callback;
  * 
  * @param unknown_type $apiObj
  */
 function callback($apiObj)
 {
     $this->xml->callback = $apiObj;
     CoreEvents::$cache = CoreEvents::callbacks(CoreEvents::$cache);
 }
Exemple #2
0
 function commit()
 {
     if (!self::$cache && !self::$actions) {
         return;
     }
     if (!self::$cache) {
         self::$cache = self::$actions;
         if (self::$lastCache) {
             self::$cache = array_merge(self::$cache, self::$lastCache);
         }
     } else {
         if (self::$actions) {
             self::$cache = array_merge(self::$cache, self::$actions);
         }
         if (self::$lastCache) {
             self::$cache = array_merge(self::$lastCache, self::$cache);
         }
     }
     $ajax = ajax();
     self::$cache = self::callbacks(self::$cache);
     //if(self::$simpleCommit==self::$cache && !$ajax->config->caching && !$ajax->config->fallback) {
     //	return true;
     //}
     $_preload = array();
     foreach (self::$cache as $k => $v) {
         if ($v['do'] == '_import' || $v['do'] == '_imports' || isset($v['is_plugin'])) {
             $_preload[$k] = $v;
             if (!isset($v['is_plugin'])) {
                 unset(self::$cache[$k]);
             }
         }
     }
     if ($_preload) {
         $_preload = self::processScache($_preload);
         $_preload = self::mkArray($_preload);
     } else {
         $_preload = null;
     }
     $_cache = self::processScache(self::$cache);
     $_cache = self::mkArray($_cache);
     if ($ajax->config->debug) {
         $ajax->debug = true;
     }
     $debug = $ajax->debug ? 1 : 0;
     $out = 'CJAX.process_all("' . $_cache . '","' . $_preload . '", ' . $debug . ', true);';
     return $out;
 }
Exemple #3
0
 public function flush()
 {
     CoreEvents::$lastCache = array();
     CoreEvents::$cache = array();
 }