/** * @param $setParams * @return string */ public function getData($setParams) { //Charge le fichier de traduction frontend_model_smarty::getInstance()->configLoad($this->modelSystem->base_path() . 'plugins/ogone/i18n/public_local_' . frontend_model_template::current_Language() . '.conf'); $data = $this->setData(); if ($data['formaction'] === 'test') { $urlOgone = Form::OGONE_TEST_URL; } elseif ($data['formaction'] === 'production') { $urlOgone = Form::OGONE_PRODUCTION_URL; } $url = magixcjquery_html_helpersHtml::getUrl() . '/' . frontend_model_template::current_Language() . '/'; // Define form options // See Ogone_Form for list of supported options $options = array('sha1InPassPhrase' => $data['passphrase'], 'formAction' => $urlOgone, 'formSubmitType' => 'image', 'formSubmitImageUrl' => $setParams['formSubmitImageUrl'], 'formSubmitButtonName' => $this->template->getConfigVars('form_submit_button'), 'formSubmitButtonValue' => $this->template->getConfigVars('form_submit_button'), 'formSubmitButtonClass' => frontend_model_template::current_Language() . '_' . 'ogoneSubmitButton'); $seturl = $this->setUrl(); // https://github.com/jvandemo/Ogone // Define form parameters (see Ogone documentation for list) // Default parameter values can be set in Ogone_Form if required $params = array('PSPID' => $data['pspid'], 'orderID' => 'your_order_id / transaction ID', 'amount' => 100, 'currency' => 'EUR', 'language' => 'en_EN', 'COMPLUS' => 'custom data', 'OPERATION' => 'SAL', 'CN' => 'name of your client', 'EMAIL' => 'email of your client', 'accepturl' => $url . $setParams['plugin'] . $seturl['seturlok'], 'declineurl' => $url . $setParams['plugin'] . $seturl['seturlnook'], 'exceptionurl' => $url . $setParams['plugin'] . $seturl['seturlexception'], 'cancelurl' => $url . $setParams['plugin'] . $seturl['seturlcancel']); // Instantiate form $form = new Form($options, $params); // You can also add parameters after instantiation // with the addParam() method $form->addParam('CN', $setParams['lastname'] . ' ' . $setParams['firstname'])->addParam('EMAIL', $setParams['email'])->addParam('language', $setParams['language'])->addParam('orderID', $setParams['transaction'])->addParam('amount', $setParams['amount'])->addParam('COMPLUS', $setParams['COMPLUS'])->addParam('PARAMVAR', $setParams['PARAMVAR']); // Automatically generate HTML form with all params and SHA1Sign return $form->render(); }
public static function backend_redirect_login($forms = false) { if ($forms != false) { if (!headers_sent()) { header('location: ' . magixcjquery_html_helpersHtml::getUrl() . '/admin/login.php'); } } else { if (!headers_sent()) { header('location: ' . magixcjquery_html_helpersHtml::getUrl() . '/admin/dashboard.php'); } } }
/** * function loading flux rss * * @param string $geturl */ function getLoadXml($geturl) { if (@fopen($geturl, "r")) { header('content-type: application/xml'); print file_get_contents($geturl); } else { header('content-type: application/xml'); print '<?xml version="1.0" encoding="UTF-8"?> <!--Generated by magixcjQuery Framework--> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <item> <title>Loading error</title> <pubDate>' . date('Y-m-d') . '</pubDate> <link>' . magixcjquery_html_helpersHtml::getUrl() . '</link> <description><![CDATA[<p>file no exist</p>]]></description> </item> </channel> </rss>'; } }
/** * @param $setParams * @return string * $hipay = new plugins_hipay_public(); $hipayProcess = $hipay->getData( array( 'plugin' => 'cartpay', 'key' => $session_key, 'order' => $id_cart, 'amount' => $amount_pay_with_tax, 'shipping' => $shipping, 'locale' => 'BE', 'customerEmail' => $data_cart['email_cart'] ) ); */ public function getData($setParams) { try { frontend_model_smarty::getInstance()->configLoad($this->modelSystem->base_path() . 'plugins/hipay/i18n/public_local_' . frontend_model_template::current_Language() . '.conf'); // Chargement des données Hipay en base de données $data = $this->setData(); $collection = $this->about->getData(); if ($data != null) { if ($data['formaction'] === 'test') { $urlOrder = 'https://test-ws.hipay.com/soap/payment-v2?wsdl'; $urlCategory = 'https://test-payment.hipay.com/order/list-categories/id/'; } elseif ($data['formaction'] === 'production') { $urlOrder = 'https://ws.hipay.com/soap/payment-v2?wsdl'; $urlCategory = 'https://payment.hipay.com/order/list-categories/id/'; } $getCategory = $this->getCategory(array('url' => $urlCategory . $data['websiteId'], 'debug' => false)); $urlwebsite = magixcjquery_html_helpersHtml::getUrl() . '/' . $data['iso'] . '/'; // seturl pour les notifications et process $seturl = $this->setUrl(); if ($getCategory) { // STEP 1 : soap flow options $options = array('compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP, 'cache_wsdl' => WSDL_CACHE_NONE, 'soap_version' => SOAP_1_1, 'encoding' => 'UTF-8', 'exceptions' => true); // STEP 2 : Soap client initialization $client = new SoapClient($urlOrder, $options); //https://test-ws.hipay.com/soap/payment-v2?wsdl // L'interface de paiement sera, par défaut, en français international $setlocal = $data['iso'] . '_' . strtoupper($setParams['locale']); $executionDate = date('c'); // STEP 3 : Soap call on confirm method of manual-capture webservice $result = $client->generate(array('parameters' => array('wsLogin' => $data['wsLogin'], 'wsPassword' => $data['wsPassword'], 'websiteId' => $data['websiteId'], 'categoryId' => $getCategory, 'description' => $this->template->getConfigVars('order_on') . ' ' . $collection['name'], 'freeData' => array(array('key' => 'order', 'value' => $setParams['order']), array('key' => 'shipping', 'value' => $setParams['shipping'])), 'currency' => 'EUR', 'amount' => $setParams['amount'], 'rating' => 'ALL', 'locale' => $setlocal, 'customerIpAddress' => $data['customerIpAddress'], 'manualCapture' => '0', 'executionDate' => $executionDate, 'customerEmail' => $setParams['customerEmail'], 'urlCallback' => $urlwebsite . $setParams['plugin'] . $seturl['seturlack'], 'urlAccept' => $urlwebsite . $setParams['plugin'] . $seturl['seturlok'], 'urlCancel' => $urlwebsite . $setParams['plugin'] . $seturl['seturlcancel'], 'urlDecline' => $urlwebsite . $setParams['plugin'] . $seturl['seturlexception']))); //print_r($result); $forms_hipay = '<a href="' . $result->{'generateResult'}->{'redirectUrl'} . '"><img src="https://www.hipaydirect.com/images/i18n/' . $data['iso'] . '/bt_payment_8.png" /></a>'; return $forms_hipay; } } } catch (SoapFault $e) { magixglobal_model_system::magixlog("SOAP Fault: (faultcode: {$e->faultcode}, faultstring: {$e->faultstring})", $e); } }
* http://www.magix-cms.com, magix-cms.com http://www.magix-cjquery.com * @license Dual licensed under the MIT or GPL Version 3 licenses. * @version 1.0 * @author Gérits Aurélien <*****@*****.**> * @name index * */ /** * Charge toutes les Classes de l'application */ $baseadmin = 'baseadmin.php'; if (file_exists($baseadmin)) { require $baseadmin; if (!defined('PATHADMIN')) { throw new Exception('PATHADMIN is not defined'); } } require '../lib/mcbackend.php'; /** * Autoload Frontend */ $members = new backend_controller_login(); $members->securePage(); $members->closeSession(); if (magixcjquery_filter_request::isSession('keyuniqid_admin')) { backend_controller_config::load_attribute_config(); if (!headers_sent()) { header('location: ' . magixcjquery_html_helpersHtml::getUrl() . '/admin/dashboard.php'); exit; } }
/** * * Init curl get * @param string $url * @param string $file */ private function curl_ping($url, $file) { try { // PING DU SITEMAP A GOOGLE $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.google.com/webmasters/tools/ping?sitemap=http%3A%2F%2F' . $url . '%2F' . $file); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_REFERER, magixcjquery_html_helpersHtml::getUrl()); curl_setopt($ch, CURLOPT_NOBODY, 1); $body = curl_exec($ch); curl_close($ch); } catch (Exception $e) { trigger_error($e->getMessage(), E_USER_ERROR); } }
/** * Smarty {geturl} function plugin * * Type: function * Name: getUrl * Date: August 21, 2009 * Purpose: Récupère l'url du nom de domaine ou défini le root du site automatiquement * Examples: {geturl} * Output: * @link * @author Gerits Aurelien * @version 1.0 * @param array * @param Smarty * @return string */ function smarty_function_geturl($params, $template) { return magixcjquery_html_helpersHtml::getUrl(); }
/** * @access public * @static * getUrlConcat Retourne la concaténation de la minification de fichiers * @param $options * @return string * @throws Exception * @author Gérits Aurelien and JB Demonte (http://jb.demonte.fr/) */ public static function getUrlConcat($options) { if (is_array($options)) { if (array_key_exists('caches', $options)) { $min_cachePath = $options['caches']; } else { throw new Exception("Error caches dir is not defined"); } if (array_key_exists('href', $options)) { $url = $options["href"]; $ext = 'css'; } elseif (array_key_exists('src', $options)) { $url = $options["src"]; $ext = 'js'; } if (array_key_exists('filesgroups', $options)) { $filesgroups = $options['filesgroups']; } else { $filesgroups = 'min/groupsConfig.php'; } if (array_key_exists('minDir', $options)) { $minDir = $options['minDir']; } else { $minDir = '/min/'; } if (array_key_exists('callback', $options)) { $callback = $options['callback']; } else { $callback = ''; } } else { throw new Exception("Error options is not array"); } $name = ""; //Parse a URL and return its components $parseurl = parse_url($url); //return position $position = strpos($parseurl['query'], '='); //return first query $query = substr($parseurl['query'], 0, $position); //return url after query $filesPath = substr(strrchr($parseurl['query'], '='), 1); // Group if ($query === 'g') { $filesCollection = array(); if (file_exists($filesgroups)) { $groups = (require $filesgroups); foreach (explode(",", $filesPath) as $group) { $filesCollection = array_merge($filesCollection, isset($groups[$group]) ? $groups[$group] : array()); } } else { throw new Exception("filesgroups is not exist"); } // Files } elseif ($query === 'f') { $filesCollection = explode(",", $filesPath); } foreach ($filesCollection as &$file) { $file = ltrim($file, "/"); $name .= $file . "|" . filemtime(self::base_path() . $file) . "|" . filesize(self::base_path() . $file) . "/"; } $sha1name = sha1($name) . "." . $ext; if (file_exists($min_cachePath) and is_writable($min_cachePath)) { $filepath = realpath(".") . "/" . $min_cachePath . "/" . $sha1name; if (!file_exists($filepath)) { $content = file_get_contents(magixcjquery_html_helpersHtml::getUrl() . $minDir . '?f=' . implode(",", $filesCollection)); file_put_contents($filepath, $content); } return $callback . "/" . $min_cachePath . "/" . $sha1name; } else { throw new Exception("Error " . $min_cachePath . " is not writable"); } }
function iniXmlRssReader($file = "/rss.xml") { $xml = new XMLReader(); $xml->open(magixcjquery_html_helpersHtml::getUrl() . $file, "UTF-8"); /*$value = '<item>'; while ($xml->read()) { $value .= $xml->value; } $value .= '</item>';*/ $value = $xml->read(); $xml->close(); return $value; }
/** * Compression GZ + ping Google */ private function compressedGooglePing($create) { $sitemap = new magixcjquery_xml_sitemap(); if (!extension_loaded('zlib')) { $sitemap->sendSitemapGoogle(substr(magixcjquery_html_helpersHtml::getUrl(), 7), 'sitemap.xml'); } else { $this->compressed(); $sitemap->sendSitemapGoogle(substr(magixcjquery_html_helpersHtml::getUrl(), 7), 'sitemap.xml.gz'); } $this->message->getNotify('pinguer'); }
/** * Smarty {widget_share_data} function plugin * * Type: function * Name: widget_share_data * Date: 24/03/2015 * Update: * Output: * @author Gerits Aurélien (http://www.magix-cms.com) * @version 1.0 * @param array * @param Smarty * @return string * @example * {widget_share_data assign="shareData" } OR {widget_share_data exclude=["viadeo","linkedin"] assign="shareData" } <ul id="share-box" class="nav navbar-nav navbar-right"> <li> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <span class="glyphicon glyphicon-share"> </span> <span class="dropdown-text"> {#share#|ucfirst} </span> </a> <ul id="share-nav" class="dropdown-menu"> {include file="section/loop/share.tpl" data=$shareData} </ul> </li> </ul> * LOOP {if is_array($data) && !empty($data)} {foreach $shareData as $item} <li> <a class="targetblank" href="{$item.url}" title="{#share_on#|ucfirst} {$item.name|ucfirst}"> <img src="/skin/{template}/img/share/{$item.img}" alt="{$item.name|ucfirst}" /> {$item.name|ucfirst} </a> </li> {/foreach} {/if} * OR {if is_array($data) && !empty($data)} {foreach $shareData as $item} <li> <a class="targetblank" href="{$item.url}" title="{#share_on#|ucfirst} {$item.name|ucfirst}"> <span class="fa fa-{$item.font}-square"></span> </a> </li> {/foreach} {/if} */ function smarty_function_widget_share_data($params, $template) { // *** Load active script var // ** Catch Domain var $url['root'] = magixcjquery_html_helpersHtml::getUrl(); $url['relativ'] = $_SERVER["REQUEST_URI"]; //strrpos récupère la dernière occurence de / et de . $url['share'] = $url['root'] . $url['relativ']; // ** Catch module's page name $smarty = frontend_model_smarty::getInstance(); // ** find active module $script['fileName'] = substr($_SERVER['SCRIPT_NAME'], 1); $script['chartBeforeExt'] = strpos($script['fileName'], '.'); $active_mod = substr($script['fileName'], 0, $script['chartBeforeExt']); // ** set active module name $name = null; switch ($active_mod) { case 'index': $name = $smarty->getTemplateVars('title'); break; case 'catalog': if (isset($_GET['idproduct'])) { $productData = $smarty->getTemplateVars('product'); $name = $productData['name']; } elseif (isset($_GET['idcls'])) { $subcatData = $smarty->getTemplateVars('subcat'); $name = $subcatData['name']; } elseif (isset($_GET['idclc'])) { $catData = $smarty->getTemplateVars('cat'); $name = $catData['name']; } else { $name = $smarty->getConfigVars('catalog_root_h1'); } break; case 'cms': $name = $smarty->getTemplateVars('name_page'); break; case 'news': if (isset($_GET['getnews'])) { $name = $smarty->getTemplateVars('name_news'); } elseif (isset($_GET['tag'])) { $name = $smarty->getConfigVars('news_root_h1') . ': ' . $_GET['tag']; } else { $name = $smarty->getConfigVars('news_root_h1'); } break; case 'plugin': $active_plugin = $_GET['magixmod']; switch ($active_plugin) { case 'contact': $name = $smarty->getConfigVars('contact_root_h1'); break; default: if (isset($_GET['pstring3'])) { $name = ucfirst(str_replace('-', ' ', 'pstring3')); } elseif (isset($_GET['pstring2'])) { $name = ucfirst(str_replace('-', ' ', 'pstring2')); } elseif (isset($_GET['pstring1'])) { $name = ucfirst(str_replace('-', ' ', 'pstring1')); } else { $name = $smarty->getConfigVars($active_mod . '_root_h1'); } } } // *** Set share data $name = str_replace(' ', '%20', $name); // W3C validation require no ' ' in url $data_default = array('facebook' => array('name' => 'facebook', 'url' => 'http://www.facebook.com/share.php?u=' . $url['share'], 'img' => 'facebook.png', 'font' => 'facebook'), 'twitter' => array('name' => 'twitter', 'url' => 'https://twitter.com/intent/tweet?text=' . $name . '&url=' . $url['share'], 'img' => 'twitter.png', 'font' => 'twitter'), 'viadeo' => array('name' => 'viadeo', 'url' => 'http://www.viadeo.com/shareit/share/?url=' . $url['share'] . '&title=' . $name . '&overview=' . $name, 'img' => 'viadeo.png', 'font' => ''), 'google' => array('name' => 'google', 'url' => 'https://plus.google.com/share?url=' . $url['share'], 'img' => 'google.png', 'font' => 'google-plus'), 'linkedin' => array('name' => 'linkedin', 'url' => 'http://www.linkedin.com/shareArticle?mini=true&url=' . $url['share'], 'img' => 'linkedin.png', 'font' => 'linkedin')); $exclude = isset($params['exclude']) ? $params['exclude'] : false; if ($exclude) { if (is_array($exclude)) { foreach ($exclude as $item) { unset($data_default[$item]); } } } $assign = isset($params['assign']) ? $params['assign'] : 'data'; $template->assign($assign, $data_default); }
/** * Smarty {widget_share_display} function plugin * * Type: function * Name: widget_share_display * Date: 04/01/2012 * Update: 12/01/2013 * Output: * @author Sire Sam (http://www.sire-sam.be) * @author Gerits Aurélien (http://www.magix-dev.be) * @version 1.0 * @param array * @param Smarty * @return string * <ul id="share-box" class="nav navbar-nav navbar-right"> <li> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <span class="glyphicon glyphicon-share"> </span> <span class="dropdown-text"> {#share#|ucfirst} </span> </a> {widget_share_display htmlStructure=[ 'container' => [ 'before' => '<ul id="share-nav" class="dropdown-menu">', 'after' => '</ul>' ] ] } </li> </ul> */ function smarty_function_widget_share_display($params, $template) { // *** Load active script var // ** Catch Domain var $url['root'] = magixcjquery_html_helpersHtml::getUrl(); $url['relativ'] = $_SERVER["REQUEST_URI"]; //strrpos récupère la dernière occurence de / et de . $url['share'] = $url['root'] . $url['relativ']; // ** Catch module's page name $smarty = frontend_model_smarty::getInstance(); // ** find active module $script['fileName'] = substr($_SERVER['SCRIPT_NAME'], 1); $script['chartBeforeExt'] = strpos($script['fileName'], '.'); $active_mod = substr($script['fileName'], 0, $script['chartBeforeExt']); // ** set active module name $name = null; switch ($active_mod) { case 'index': $name = $smarty->getTemplateVars('title'); break; case 'catalog': if (isset($_GET['idproduct'])) { $productData = $smarty->getTemplateVars('product'); $name = $productData['name']; } elseif (isset($_GET['idcls'])) { $subcatData = $smarty->getTemplateVars('subcat'); $name = $subcatData['name']; } elseif (isset($_GET['idclc'])) { $catData = $smarty->getTemplateVars('cat'); $name = $catData['name']; } else { $name = $smarty->getConfigVars('catalog_root_h1'); } break; case 'cms': $name = $smarty->getTemplateVars('name_page'); break; case 'news': if (isset($_GET['getnews'])) { $name = $smarty->getTemplateVars('name_news'); } elseif (isset($_GET['tag'])) { $name = $smarty->getConfigVars('news_root_h1') . ': ' . $_GET['tag']; } else { $name = $smarty->getConfigVars('news_root_h1'); } break; case 'plugin': $active_plugin = $_GET['magixmod']; switch ($active_plugin) { case 'contact': $name = $smarty->getConfigVars('contact_root_h1'); break; default: if (isset($_GET['pstring3'])) { $name = ucfirst(str_replace('-', ' ', 'pstring3')); } elseif (isset($_GET['pstring2'])) { $name = ucfirst(str_replace('-', ' ', 'pstring2')); } elseif (isset($_GET['pstring1'])) { $name = ucfirst(str_replace('-', ' ', 'pstring1')); } else { $name = $smarty->getConfigVars($active_mod . '_root_h1'); } } } // *** Set share data $name = str_replace(' ', '%20', $name); // W3C validation require no ' ' in url $data_default = array('facebook' => array('name' => 'facebook', 'url' => 'http://www.facebook.com/share.php?u=' . $url['share'], 'img' => 'facebook.png'), 'twitter' => array('name' => 'twitter', 'url' => 'https://twitter.com/intent/tweet?text=' . $name . '&url=' . $url['share'], 'img' => 'twitter.png'), 'viadeo' => array('name' => 'viadeo', 'url' => 'http://www.viadeo.com/shareit/share/?url=' . $url['share'] . '&title=' . $name . '&overview=' . $name, 'img' => 'viadeo.png'), 'google' => array('name' => 'google', 'url' => 'https://plus.google.com/share?url=' . $url['share'], 'onclick' => 'javascript:window.open(this.href,\'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\');return false;', 'img' => 'google.png')); // ** Select Data if (isset($params['dataSelect']['context'])) { $dataSelect = explode(',', $params['dataSelect']['context']); foreach ($dataSelect as $share) { if (array_key_exists($share, $data_default)) { $data[] = $data_default[$share]; } } } else { $data = $data_default; } // *** Set default html structure $strucHtml_default = array('container' => array('before' => '<ul>', 'after' => '</ul>'), 'item' => array('before' => '<li>', 'after' => '</li>'), 'img' => array('before' => ' ', 'after' => ' '), 'name' => array('before' => ' ', 'after' => ' '), 'current' => array('class' => ' current'), 'last' => array('class' => ' last', 'col' => 1)); // ** Set default elem to display $strucHtml_default['allow'] = array('', 'name', 'img'); $strucHtml_default['display'] = array(1 => array('', 'img', 'name')); // ** Update html struct & item setting with custom var (params['htmlStructure']) $custom = $params['htmlStructure'] ? $params['htmlStructure'] : null; $default = $strucHtml_default; if (is_array($custom)) { $default['display'] = array(); foreach ($custom as $k => $v) { foreach ($v as $sk => $sv) { if ($sv != null) { $default[$k][$sk] = $sv; } } if (array_search($k, $default['allow'])) { $default['display'][1][] = $k; } } } // ** Update html struct with display params (params['htmlDisplay']) if (isset($params['htmlDisplay'])) { $default['display'] = $params['htmlDisplay']; } // * push null value on case[0] (allow array search on format function) foreach ($default['display'] as $k => $v) { array_unshift($default['display'][$k], null); } $strucHtml = $default; // ** in cas diplay is null, we take default value if ($strucHtml['display'][1] == null) { $strucHtml['display'][1] = $strucHtml_default['display'][1]; } // *** Set translation var $t_share_on = frontend_model_template::getConfigVars('share_on'); // *** format items loop (foreach item) $items = null; foreach ($data as $row) { // ** format item loop (foreach element) $elem = null; foreach ($strucHtml['display'][1] as $elem_type) { if (array_search($elem_type, $strucHtml['display'][1])) { switch ($elem_type) { case 'name': $elem .= ucfirst($row['name']); break; case 'img': $elem .= '<img src="' . '/skin/' . frontend_model_template::frontendTheme()->themeSelected() . '/img/share/' . $row['img'] . '" alt="' . $row['name'] . '" />'; } } } // ** item construct $items .= $strucHtml['item']['before']; $items .= '<a id="share-' . $row['name'] . '" class="targetblank" href="' . $row['url'] . '" title="' . ucfirst($t_share_on) . ': ' . $row['name'] . '">'; $items .= $elem; $items .= '</a>'; $items .= $strucHtml['item']['after']; } // *** container construct $output = $strucHtml['container']['before']; $output .= isset($params['htmlPrepend']) ? $params['htmlPrepend'] : null; $output .= $items; $output .= isset($params['htmlAppend']) ? $params['htmlAppend'] : null; $output .= $strucHtml['container']['after']; return $output; }
/** * URL index du module suivant la langue * @param $idlang */ public function sitemap_uri_index($idlang) { $sitemap = new magixcjquery_xml_sitemap(); // Table des langues $lang = new backend_db_block_lang(); // Retourne le code ISO $db = $lang->s_data_iso($idlang); if ($db != null) { $sitemap->writeMakeNode(magixcjquery_html_helpersHtml::getUrl() . magixglobal_model_rewrite::filter_plugins_root_url($db['iso'], 'contact', true), $this->lastmod_dateFormat(), 'always', 0.7); } }
/** * class pagination FirstString * * @param first letters $firstlt * @param sql $request * @param $key * @param string $url * @return void */ function pagerString($firstlt, $request, $key, $rewrite = 'current', $url = false) { $lt_tampon = -1; $lt = null; //$rewrite = $url ? $url.$key.'/' : '?'.$key.'='; if ($rewrite == 'rewrite') { $urlreq = $_SERVER['PHP_SELF']; $point = strpos($urlreq, '.'); $subst = substr($urlreq, 0, $point); $rewrite = $subst . '/' . $url . '/' . $key . '/'; } elseif ($rewrite == 'current') { $rewrite = $_SERVER['PHP_SELF'] . '?' . $url . '='; } foreach ($request as $l) { $let = $l[$key]; if ($let == $firstlt) { $lt .= '<div class="current">' . magixcjquery_string_convert::upTextCase($firstlt) . '</div>'; } else { $lt .= '<a href="' . magixcjquery_html_helpersHtml::getUrl() . $rewrite . $let . '">' . magixcjquery_string_convert::upTextCase($l[$key]) . '</a>'; } //letters prev diff letters next if ($lt != $lt_tampon) { // Save new letters $lt_tampon .= $lt; } } return $lt; }
/** * @access private * Scanne le dossier skin (public) et retourne les images ou capture des thèmes */ private function scanTemplateDir($create) { $create->configLoad('local_' . backend_model_language::current_Language() . '.conf'); $skin = $this->directory_skin(); if (!is_readable($skin)) { throw new exception('skin is not minimal permission'); } $makefiles = new magixcjquery_files_makefiles(); $dir = $makefiles->scanRecursiveDir($skin, '.svn'); $count = count($dir); if ($count == 0) { throw new exception('skin is not found'); } if (!is_array($dir)) { throw new exception('skin is not array'); } $template = null; foreach ($dir as $d) { if ($d == $this->load_theme()) { $btn_class = ' btn-primary'; $btn_title = $create->getConfigVars('select'); } else { $ctpl = ''; $btn_class = ' btn-default'; $btn_title = $create->getConfigVars('choose'); } $themePath = self::directory_skin() . $d; if ($makefiles->scanDir($themePath) != null) { if (file_exists($themePath . '/screenshot.png')) { $img = 'src="' . magixcjquery_html_helpersHtml::getUrl() . '/skin/' . $d . '/screenshot.png"'; $srcData = ''; } else { $img = 'src="' . magixcjquery_html_helpersHtml::getUrl() . '/skin/default/screenshot.png"'; $srcData = ' data-src="holder.js/260x180"'; } $template .= '<li class="col-sm-4">'; $template .= '<div class="thumbnail">'; $template .= '<img ' . $img . $srcData . ' alt="' . $btn_title . '">'; $template .= '<div class="caption">'; $template .= '<h3>' . $d . '</h3>'; $template .= '<p><a data-skin="' . $d . '" class="skin-tpl btn btn-large btn-block' . $btn_class . '" href="#">' . $btn_title . '</a></p>'; $template .= '</div>'; $template .= '</div>'; $template .= '</li>'; } } return $template; }
/** * create dynamic galery * @param $array * @param $path * @param $records * @return string */ public static function dynamic_galery($array, $path, $records, $thumb = null) { $thumb = null; foreach ($array as $link) { $thumb .= '<a' . self::animated() . ' href="' . magixcjquery_html_helpersHtml::getUrl() . $path . $link[$records] . '.jpg">'; $thumb .= '<img src="' . magixcjquery_html_helpersHtml::getUrl() . $path . $thumb . $link[$records] . '.jpg" />'; $thumb .= '</a>'; } return $thumb; }