예제 #1
0
 /**
  * Prepares specified functions for ajax requests
  *
  * @param Array $functions: array of function names to ajaxify
  */
 public function ajaxifyFunctions($functions = array())
 {
     if (!is_array($functions)) {
         $functions = array($functions);
     }
     foreach ($functions as $val) {
         $val = stripslashes(trim($val));
         if (function_exists($val)) {
             if (!in_array($val, $this->functions)) {
                 $this->functions[] = $val;
             }
         } else {
             echo JS::showError($val . 'function does not exist!');
         }
     }
     reset($this->functions);
     $this->execute();
     return $this;
 }