/**
  * getJS
  * 
  * get the javascript file for the correct operation of the selection box.
  * 
  * @param type $method
  * @return array
  */
 public function getJS($method)
 {
     $array_js = parent::getJS($method);
     $select_js1 = JS::getPath("11-ui.multiselect.js");
     $select_js2 = JS::getPath("12-ui-multiselect-es.js");
     $array_js[] = $select_js1;
     $array_js[] = $select_js2;
     return $array_js;
 }
Exemple #2
0
 /**
  * 
  * function getJS - This is a overwritten function that belong to \SimplOn\Elements\JS 
  * 
  * @param string $method
  * @return array
  */
 public function getJS($method)
 {
     //Is necessary declarate a varible to save the array returned for the original method
     $rich_text = parent::getJS($method);
     // here you can change or you can add more librarys if you want to change
     // or modify the plugin
     $local_js = JS::getPath("0-nicEdit.js");
     //add our library(s) to the origial array
     $rich_text[] = $local_js;
     // and finally returned the new array
     return $rich_text;
 }
Exemple #3
0
 public function getJS($method, $returnFormat = 'array', $compress = false)
 {
     $class = $this->getClass('-');
     // gets class' js file
     $a_js = ($local_js = JS::getPath("{$class}.js")) ? array($local_js) : array();
     // gets method's js file
     if ($local_js = JS::getPath("{$class}.{$method}.js")) {
         $a_js[] = $local_js;
     }
     // adds
     foreach ($this->dataAttributes() as $data) {
         foreach ($this->{'O' . $data}()->getJS($method) as $local_js) {
             if ($local_js) {
                 $a_js[] = $local_js;
             }
         }
     }
     sort($a_js);
     // includes libs
     $a_js = array_unique(array_merge(JS::getLibs(), $a_js));
     if ($compress) {
         // @todo: compress in one file and return the file path
     }
     // converts to remote paths
     $a_js = array_unique(array_map(array('\\SimplOn\\Main', 'localToRemotePath'), $a_js));
     switch ($returnFormat) {
         case 'html':
             $html_js = '';
             foreach ($a_js as $js) {
                 $html_js .= '<script type="text/javascript" src="' . $js . '"></script>' . "\n";
             }
             return $html_js;
         default:
         case 'array':
             return $a_js;
     }
 }
Exemple #4
0
 public function getJS($method)
 {
     $class = $this->getClass('-');
     // gets class' js file
     $a_js = ($local_js = JS::getPath("{$class}.js")) ? array($local_js) : array();
     if ($this->hasMethod($method)) {
         // gets method's js file
         if ($local_js = JS::getPath("{$class}.{$method}.js")) {
             $a_js[] = $local_js;
         }
     }
     return $a_js;
 }
Exemple #5
0
 public function getJS($method)
 {
     $class = $this->getClass('-');
     // gets class' js file
     $a_js = ($local_js = JS::getPath("{$class}.js")) ? array($local_js) : array();
     //var_dump($a_js);
     if ($this->hasMethod($method)) {
         // gets method's js file
         if ($local_js = JS::getPath("{$class}.{$method}.js")) {
             $a_js[] = $local_js;
         }
     }
     //var_dump($a_js);
     //$a_js = array_unique(array_map(array('\\SimplOn\\Main', 'localToRemotePath'), $a_js));
     return $a_js;
 }