Exemple #1
0
        /**
         *
         */
        public function getSourceDataTag($current)
        {
            $path = dirname(__FILE__) . '/sources/';
            if (!is_dir($path)) {
                return $this->l("Could not found any themes in 'themes' folder");
            }
            $sources = $this->getFolderList($path);
            $html = '<label for="source">' . $this->l('Source:') . '</label>
			<div class="margin-form">';
            $html .= '<select name="' . $this->getFieldName('source') . '" id="source">';
            foreach ($sources as $source) {
                $selected = $source == $current ? 'selected="selected"' : '';
                $html .= '<option value="' . $source . '" ' . $selected . '>' . $source . '</option>';
            }
            $html .= '</select>';
            $html .= '</div>';
            $html .= '<div class="group_configs" id="groupconfigs">';
            foreach ($sources as $source) {
                $html .= '<div class="source-group source' . $source . '">';
                $html .= LeoBaseSourcemini::getSource($source)->renderForm($this);
                $html .= '</div>';
            }
            $html .= '</div>';
            $html .= '<script>';
            $html .= '
				$(document).ready( function(){
					$(".source-group").hide();
					$(".source"+$("#source").val() ).show();
					$("#source").change(function(){
					$(".source-group").hide();
					$(".source"+$(this).val() ).show();
				} );	
			} )';
            $html .= '</script>';
            return $html;
        }
Exemple #2
0
 private function _prepareHook()
 {
     $slideminir = array();
     foreach ($this->_configs as $key => $config) {
         $slideminir[$key] = $this->getParams()->get($key, $config);
     }
     $source = $this->getParams()->get("source", 'images');
     $path = _PS_CACHEFS_DIRECTORY_ . $this->name;
     if (!file_exists($path)) {
         mkdir($path, 0777);
     }
     $site_url = Tools::htmlentitiesutf8('http://' . $_SERVER['HTTP_HOST'] . __PS_BASE_URI__) . 'cache/cachefs/' . $this->name;
     $slideminis = LeoBaseSourcemini::getSource($source)->setModuleName('leobtslidermini', $path, $site_url)->getData($this->getParams());
     if (!$slideminis) {
         return false;
     }
     //echo '<pre>'.print_r($slideminis,1); die;
     $this->smarty->assign('leobtslidermini_slides', $slideminis);
     $this->smarty->assign('leobtslidermini', $slideminir);
     $this->smarty->assign('leobtslidermini_modid', $this->id);
     return true;
 }