Exemplo n.º 1
0
 /**
  * addPlugin
  * This function adds a loadable jquery plugin and also
  * gets any helper depedency (either name or directory)
  *
  * @param string or array of $pluginNames
  * @return jquery
  * @author K Anderson
  */
 public static function addPlugin($pluginNames = array())
 {
     $jqPlugins = jquery::$jqPlugins;
     // Convert a string to array to standardize handling
     $pluginNames = is_string($pluginNames) ? array($pluginNames) : $pluginNames;
     foreach ($pluginNames as $pluginName) {
         // Check if a proper pluginName has been specified
         if (array_key_exists($pluginName, $jqPlugins)) {
             jquery::init();
             // Put the plugin name into the load list
             jquery::$jquery->plugins[] = $pluginName;
         }
     }
     return jquery::$jquery;
 }