コード例 #1
0
ファイル: offlajnradio.php プロジェクト: pguilford/vcomcc
 function universalfetchElement($name, $value, &$node)
 {
     $document =& JFactory::getDocument();
     $html = "";
     $el = "";
     $this->values = array();
     $this->mode = "";
     $this->items = array();
     $this->url = JURI::base() . '../modules/' . $this->_moduleName . '/params/' . $this->_name . '/images/';
     if (defined('WP_ADMIN')) {
         $this->url = smartslider_translate_js_url($this->url);
     }
     $this->loadFiles();
     $attrs = $node->attributes();
     $class = '';
     if (isset($attrs['mode'])) {
         $class = $attrs['mode'];
     }
     $html .= '<div class="offlajnradiocontainer' . $class . '" id="offlajnradiocontainer' . $this->id . '">';
     $html .= $this->makeItemDivs($node->children(), $value);
     $html .= '</div>';
     $html .= '<input type="hidden" id="' . $this->id . '" name="' . $name . '" value="' . $value . '"/>';
     DojoLoader::addScript('
   new OfflajnRadio({
     id: "' . $this->id . '",
     values: ' . json_encode($this->values) . ',
     map: ' . json_encode(array_flip($this->values)) . ',
     mode: ' . json_encode($this->mode) . '
   });
 ');
     return $html;
 }
コード例 #2
0
ファイル: offlajnonoff.php プロジェクト: pguilford/vcomcc
 function universalfetchElement($name, $value, &$node)
 {
     $document =& JFactory::getDocument();
     $this->loadFiles();
     $attributes = $node->attributes();
     $html = "";
     $imgs = "";
     $mode = "";
     if (isset($attributes['mode'])) {
         $mode = $attributes['mode'];
     }
     $url = JURI::base() . '../modules/' . $this->_moduleName . '/params/' . $this->_name . '/images/';
     if (defined('WP_ADMIN')) {
         $url = smartslider_translate_js_url($url);
     }
     if ($mode == "") {
         $html = '<div id="offlajnonoff' . $this->id . '" class="gk_hack onoff' . ($value ? '' : ' onoff-off') . '"></div>';
     } else {
         if ($mode == "button") {
             $html = '<div id="offlajnonoff' . $this->id . '" class="gk_hack onoffbutton' . ($value ? ' selected' : '') . '">
             <div class="gk_hack onoffbutton_img" style="background-image: url(' . $url . $attributes['imsrc'] . ');"></div>
   </div>';
         }
     }
     $html .= '<input type="hidden" name="' . $name . '" id="' . $this->id . '" value="' . $value . '" />';
     DojoLoader::addScript('
   new OfflajnOnOff({
     id: "' . $this->id . '",
     mode: "' . $mode . '",
     imgs: ' . json_encode($imgs) . '
   }); 
 ');
     return $html;
 }