/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ function display($tpl = null) { // Get config parameters $this->_document = JFactory::getDocument(); $this->_config = JSNConfigHelper::get(); // Initialize toolbar JSNMobilizeHelper::initToolbar('JSN_MOBILIZE_PAGE_CONFIGURATION_TITLE', 'mobilize-config', false); // Get messages $msgs = ''; if (!$this->_config->get('disable_all_messages')) { $msgs = JSNUtilsMessage::getList('CONFIGURATION'); $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : ''; } // Assign variables for rendering $this->assignRef('msgs', $msgs); // Load the submenu. $input = JFactory::getApplication()->input; JSNMobilizeHelper::addSubmenu($input->get('view', 'configuration')); if (!empty($_GET['g']) && $_GET['g'] == 'data') { echo JSNHtmlAsset::loadScript('jsn/data', array('language' => array('JSN_EXTFW_GENERAL_CLOSE' => JText::_('JSN_EXTFW_GENERAL_CLOSE'))), true); } // Load assets JSNMobilizeHelper::loadAssets(); // Display the template parent::display($tpl); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. * * @see fetch() * @since 11.1 */ function display($tpl = null) { $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); // Get config $config = JSNConfigHelper::get(); // Display the view parent::display($tpl); // Load assets JSNMobilizeHelper::loadAssets(); // $this->addAssets(); }
/** * Method for display page. * * @param boolean $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = null) { // Get config parameters $config = JSNConfigHelper::get(); // Set toolbar title JToolBarHelper::title(JText::_('JSN_MOBILIZE_PAGE_UPDATE_TITLE')); // Load assets JSNMobilizeHelper::loadAssets(); // Get messages $msgs = $config->get('disable_all_messages') ? '' : (count($msgs = JSNUtilsMessage::getList('EDIT')) ? JSNUtilsMessage::showMessages($msgs) : ''); // Assign variables for rendering $this->assignRef('msgs', $msgs); // Display the template parent::display($tpl); }
/** * Display method * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { // Set toolbar title JToolBarHelper::title(JText::_('JSN_MOBILIZE_HELP_HELP_AND_SUPPORT')); // Get config $config = JSNConfigHelper::get(); // Get messages $msgs = ''; if (!$config->get('disable_all_messages')) { $msgs = JSNUtilsMessage::getList('HELP'); $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : ''; } // Load assets JSNMobilizeHelper::loadAssets(); // Assign variables for rendering $this->assignRef('msgs', $msgs); // Display the template parent::display($tpl); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ function display($tpl = null) { // Get config parameters $config = JSNConfigHelper::get(); // Initialize toolbar JSNMobilizeHelper::initToolbar('JSN_MOBILIZE_PAGE_ABOUT_TITLE', 'mobilize-about', false); // Get messages $msgs = ''; if (!$config->get('disable_all_messages')) { $msgs = JSNUtilsMessage::getList('ABOUT'); $msgs = count($msgs) ? JSNUtilsMessage::showMessages($msgs) : ''; } // Load the submenu. $input = JFactory::getApplication()->input; JSNMobilizeHelper::addSubmenu($input->get('view', 'about')); // Assign variables for rendering $this->assignRef('msgs', $msgs); // Display the template parent::display($tpl); // Load assets JSNMobilizeHelper::loadAssets(); }
/** * Add the libraries css and javascript * * @return void * * @since 1.6 */ protected function addAssets() { // Initialize variables $config = JSNConfigHelper::get(); $jUri = JURI::getInstance(); JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/jquery-colorpicker/css/colorpicker.css'); JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/jquery-gradientpicker/jquery.gradientPicker.css'); JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/joomlashine/css/jsn-advanced-parameters.css'); JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/jquery-select2/select2.css'); JSNHtmlAsset::addStyle(JSN_URL_ASSETS . '/3rd-party/codemirror/lib/codemirror.css'); $device = "mobilize"; $links = ($links = $jUri->getScheme()) . (empty($links) ? '' : '://'); if (substr($config->get("link_{$device}"), 0, 1) == '/') { $links .= $jUri->getHost() . $config->get("link_{$device}"); } else { $links .= $config->get("link_{$device}") . JURI::root(true); } // Setup text translation $arrayTranslated = array('JSN_MOBILIZE_SWITCHER_TITLE', 'JSN_MOBILIZE_YOU_CAN_NOT_HIDE_THE_COPYLINK', 'JSN_MOBILIZE_SWITCHER_SETTINGS', 'JSN_MOBILIZE_CANCEL', 'JSN_MOBILIZE_SAVE', 'JSN_MOBILIZE_ALIGNMENT', 'JSN_MOBILIZE_SELECT_THEME', 'JSN_MOBILIZE_SELECT', 'JSN_MOBILIZE_CLEAR', 'JSN_MOBILIZE_IMAGE_ALT', 'JSN_MOBILIZE_IMAGE_URL', 'JSN_MOBILIZE_ENABLE_MOBILIZE_MENU_LINK', 'JSN_MOBILIZE_ENABLE_MOBILIZE_SEARCH_LINK', 'JSN_MOBILIZE_ENABLE_MOBILIZE_LOGIN_LINK', 'JSN_MOBILIZE_CHANGE', 'JSN_MOBILIZE_CLICK_SELECT', 'JSN_MOBILIZE_TITLE_SMARTPHONE', 'JSN_MOBILIZE_TITLE_TABLET', 'JSN_MOBILIZE_TYPE_POSITION', 'JSN_MOBILIZE_TYPE_MODULE', 'JSN_MOBILIZE_SELECT_MENU', 'JSN_MOBILIZE_SELECT_MODULE', 'JSN_MOBILIZE_SELECTED_MODULE', 'JSN_MOBILIZE_CLOSE', 'JSN_MOBILIZE_SELECT_LOGO', 'JSN_MOBILIZE_SELECT_STYLE', 'JSN_MOBILIZE_SELECT_POSITION', 'JSN_MOBILIZE_SELECT_MODULE', 'JSN_MOBILIZE_ENABLE_MOBILIZE_SWITCHER_LINK', 'JSN_MOBILIZE_ADD_ELEMENT', 'JSN_MOBILIZE_ADD_MODULE', 'JSN_MOBILIZE_ADD_POSITION', 'JSN_MOBILIZE_IMAGE_FILE', 'JSN_MOBILIZE_YES', 'JSN_MOBILIZE_NO', 'JSN_MOBILIZE_CONFIRM_LOAD_STYLE', 'JSN_MOBILIZE_SWITCH_TO_WEB_UI_FOR_MOBILIZE', 'JSN_MOBILIZE_STYLE_SETTINGS_IS_AVAILABLE_ONLY_IN_PRO_EDITION', 'JSN_MOBILIZE_UPGRADE_NOW', 'JSN_MOBILIZE_LINK_SOCIAL', 'JSN_MOBILIZE_DELETE', 'JSN_MOBILIZE_BROWSER', 'JSN_MOBILIZE_UPLOAD', 'JSN_MOBILIZE_UPGRADE_EDITION_TITLE', 'JSN_MOBILIZE_UPGRADE_EDITION', 'JSN_MOBILIZE_ADD_ELEMENT_IS_AVAILABLE_ONLY_IN_PRO_EDITION'); // Initialize Javascript $edition = defined('JSN_MOBILIZE_EDITION') ? JSN_MOBILIZE_EDITION : "free"; echo JSNHtmlAsset::loadScript('mobilize/profile', array('editions' => $edition, 'pathRoot' => JURI::root(), 'defaultTemplate' => $this->_defaultTempateSite, 'language' => JSNUtilsLanguage::getTranslated($arrayTranslated), 'listMenu' => $this->_menuType, 'listModule' => $this->_Modules, 'mobilizeLink' => $links, 'configuration' => isset($this->_items['configuration']) ? $this->_items['configuration'] : ''), true); JSNMobilizeHelper::loadAssets(); }
/** * Save form Design * * @param array $post Data form * * @return boolean */ public function saveDataDesign($post) { $profileId = $this->getState($this->getName() . '.id'); if (isset($post['jsnmobilize']) && count($post['jsnmobilize']) && $profileId) { $getDataDesign = $this->getDataDesign(); $listData = array(); if (!empty($getDataDesign)) { foreach ($getDataDesign as $item) { $listData[$item->name] = $item->design_id; } } if (isset($post['style'])) { $table = JTable::getInstance('Design', 'JSNMobilizeTable'); $table->bind(array('design_id' => isset($listData['mobilize-style']) ? intval($listData['mobilize-style']) : 0, 'profile_id' => $profileId, 'name' => 'mobilize-style', 'value' => json_encode($post['style']))); if (!$table->store()) { $this->setError($table->getError()); return false; } $getStyle = JSNMobilizeHelper::generateStyle($post['style']); $urlFolder = JPATH_ROOT . "/templates/jsn_mobilize/css/profiles"; $check = true; if (!JFolder::exists(JPath::clean($urlFolder))) { if (!JFolder::create(JPath::clean($urlFolder), 0777)) { $check = false; } } elseif (!is_writable(JPath::clean($urlFolder))) { $check = false; } if ($check) { $fileName = "profile_" . (int) $profileId . ".css"; $file = JPath::clean($urlFolder . "/" . $fileName); if (!JFile::write($file, $getStyle, true)) { $check = false; } } if ($check) { $table = JTable::getInstance('Design', 'JSNMobilizeTable'); $table->bind(array('design_id' => isset($listData['mobilize-css-file']) ? intval($listData['mobilize-css-file']) : 0, 'profile_id' => $profileId, 'name' => 'mobilize-css-file', 'value' => $fileName)); if (!$table->store()) { $this->setError($table->getError()); return false; } } else { $table = JTable::getInstance('Design', 'JSNMobilizeTable'); $table->bind(array('design_id' => isset($listData['mobilize-css-file']) ? intval($listData['mobilize-css-file']) : 0, 'profile_id' => $profileId, 'name' => 'mobilize-css-file', 'value' => "")); if (!$table->store()) { $this->setError($table->getError()); return false; } } if (!empty($post['mobilize_custom_css_files'])) { $table = JTable::getInstance('Design', 'JSNMobilizeTable'); $table->bind(array('design_id' => isset($listData['mobilize-custom-css-files']) ? intval($listData['mobilize-custom-css-files']) : 0, 'profile_id' => $profileId, 'name' => 'mobilize-custom-css-files', 'value' => json_encode($post['mobilize_custom_css_files']))); if (!$table->store()) { $this->setError($table->getError()); return false; } } else { $table = JTable::getInstance('Design', 'JSNMobilizeTable'); $table->bind(array('design_id' => isset($listData['mobilize-custom-css-files']) ? intval($listData['mobilize-custom-css-files']) : 0, 'profile_id' => $profileId, 'name' => 'mobilize-custom-css-files', 'value' => '')); if (!$table->store()) { $this->setError($table->getError()); return false; } } if (!empty($post['mobilize_custom_css_code'])) { $table = JTable::getInstance('Design', 'JSNMobilizeTable'); $table->bind(array('design_id' => isset($listData['mobilize-custom-css-code']) ? intval($listData['mobilize-custom-css-code']) : 0, 'profile_id' => $profileId, 'name' => 'mobilize-custom-css-code', 'value' => $post['mobilize_custom_css_code'])); if (!$table->store()) { $this->setError($table->getError()); return false; } if ($check) { $fileName = "custom_css_profile_" . (int) $profileId . ".css"; $file = JPath::clean($urlFolder . "/" . $fileName); JFile::write($file, $post['mobilize_custom_css_code'], true); } } else { $table = JTable::getInstance('Design', 'JSNMobilizeTable'); $table->bind(array('design_id' => isset($listData['mobilize-custom-css-code']) ? intval($listData['mobilize-custom-css-code']) : 0, 'profile_id' => $profileId, 'name' => 'mobilize-custom-css-code', 'value' => '')); if (!$table->store()) { $this->setError($table->getError()); return false; } if ($check) { $fileName = "custom_css_profile_" . (int) $profileId . ".css"; $file = JPath::clean($urlFolder . "/" . $fileName); JFile::write($file, $post['mobilize_custom_css_code'], true); } } $table = JTable::getInstance('Design', 'JSNMobilizeTable'); $table->bind(array('design_id' => isset($listData['mobilize-css']) ? intval($listData['mobilize-css']) : 0, 'profile_id' => $profileId, 'name' => 'mobilize-css', 'value' => $getStyle)); if (!$table->store()) { $this->setError($table->getError()); return false; } } foreach ($post['jsnmobilize'] as $key => $data) { if (is_array($data)) { $dataItem = new stdClass(); foreach ($data as $item) { if (!empty($item)) { $item = !empty($item) ? get_magic_quotes_gpc() == true || get_magic_quotes_runtime() == true ? stripslashes($item) : $item : ''; $items = json_decode($item); $itemValue = isset($items) ? key($items) : ''; $itemType = isset($items->{$itemValue}) ? $items->{$itemValue} : ''; $dataItem->{$itemValue} = $itemType; } } $data = json_encode($dataItem); } else { $data = !empty($data) ? get_magic_quotes_gpc() == true || get_magic_quotes_runtime() == true ? stripslashes($data) : $data : ''; } $table = JTable::getInstance('Design', 'JSNMobilizeTable'); $table->bind(array('design_id' => isset($listData[$key]) ? intval($listData[$key]) : 0, 'profile_id' => $profileId, 'name' => $key, 'value' => $data)); if (!$table->store()) { $this->setError($table->getError()); return false; } } } }
* @version $Id$ * @package JSN_Mobilize * @subpackage SystemPlugin * @author JoomlaShine Team <*****@*****.**> * @copyright Copyright (C) 2012 JoomlaShine.com. All Rights Reserved. * @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html * * Websites: http://www.joomlashine.com * Technical Support: Feedback - http://www.joomlashine.com/contact-us/get-support.html */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); if (!class_exists('JSNMobilizeHelper')) { require_once JPATH_ROOT . '/administrator/components/com_mobilize/helpers/mobilize.php'; } $isloaded = JSNMobilizeHelper::checkVMVersion(); if ($isloaded != true) { if (!class_exists('shopFunctionsF')) { require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php'; } $comUserOption = shopfunctionsF::getComUserOption(); } if (empty($this->url)) { $uri = JFactory::getURI(); $url = $uri->toString(array('path', 'query', 'fragment')); } else { $url = $this->url; } $user = JFactory::getUser(); if (!isset($this->show)) { $this->show = true;
<?php //$document->addStyleSheet(JURI::root() . '/plugins/system/jsnframework/assets/3rd-party/jquery-ui/css/ui-bootstrap/jquery-ui-1.9.0.custom.css'); $document->addStyleSheet(JURI::root() . 'media/jui/css/bootstrap.min.css'); $document->addStyleSheet(JURI::root() . 'media/jui/css/bootstrap-responsive.min.css'); $document->addStyleSheet(JURI::root() . 'templates/jsn_mobilize/css/template.css'); $document->addStyleSheet('//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css'); $document->addStyleSheet(JURI::root() . '/administrator/components/com_mobilize/assets/css/mobilize.css'); if (!$cookieStyle) { if ($cssFile && JFolder::exists(JPath::clean(JPATH_ROOT . "/templates/jsn_mobilize/css/profiles" . $cssFile))) { $document->addStyleSheet(JURI::root() . '/templates/jsn_mobilize/css/profiles/' . $cssFile); } else { $css = $mCfg->get('css') ? $mCfg->get('css') : ""; $document->addStyleDeclaration($css); } } else { $css = JSNMobilizeHelper::generateStyle($cookieStyle); $css = str_replace("\n", "", $css); $document->addStyleDeclaration($css); } if ($customCssCode) { $document->addStyleDeclaration($customCssCode); } if (!empty($customCssFiles)) { if (is_string($customCssFiles)) { $customCssFiles = json_decode($customCssFiles); } if (!empty($customCssFiles)) { foreach ($customCssFiles as $file) { $document->addStyleSheet($file); } }
/** * Reder Theme * * @param type $item itemlist * * @return html code */ public function renderTheme($item) { $getProfile = JSNMobilizeHelper::getDesignByProfileId($item->profile_id); foreach ($getProfile as $profile) { if ($profile->name == "style") { if (strpos($profile->value, "jsn_") === false) { if ($profile->value == "ios") { $value = "iOS"; } else { $value = ucfirst($profile->value); } } else { $value = str_replace("jsn_", "", $profile->value); $value = "JSN " . ucfirst($value); } return $value; } } }
/** * get Style Options * * @param String $key Object Style * * @param String $value Object Style * * @param null &$font Object Font * * @param null &$option Object Style * * @return style code */ public static function getStyleOptions($key, $value, &$font = null, &$option = null) { $keyStyle = explode("_", $key); $css = array(); if ($keyStyle && !empty($value)) { $keyStyle = $keyStyle[count($keyStyle) - 1]; switch ($keyStyle) { case "normalColor": case "soildColor": case "gradientColor": if (strpos($value, "(")) { preg_match('/(.*?)\\((.*?), (.*?)\\s(.*?), (.*?)\\s(.*?)\\)/', $value, $matches, PREG_OFFSET_CAPTURE); $value1 = !empty($matches[2][0]) ? $matches[2][0] : ''; $value2 = !empty($matches[3][0]) ? $matches[3][0] : ''; $value3 = !empty($matches[4][0]) ? $matches[4][0] : ''; $value4 = !empty($matches[5][0]) ? $matches[5][0] : ''; $value5 = !empty($matches[6][0]) ? $matches[6][0] : ''; $css[] = "background: " . $value2 . ";"; $css[] = "background:linear-gradient(135deg, " . $value2 . " " . $value3 . "," . $value4 . " " . $value5 . ");"; $css[] = "background:-moz-linear-gradient(" . $value1 . ", " . $value2 . " " . $value3 . ", " . $value4 . " " . $value5 . ");"; $css[] = "background:-webkit-gradient(linear, left top, right bottom, color-stop(" . $value3 . "," . $value2 . "), color-stop(" . $value5 . "," . $value4 . "));"; $css[] = "background:-webkit-linear-gradient(" . $value1 . ", " . $value2 . " " . $value3 . "," . $value4 . " " . $value5 . ");"; $css[] = "background:-o-linear-gradient(" . $value1 . ", " . $value2 . " " . $value3 . "," . $value4 . " " . $value5 . ");"; $css[] = "background:-ms-linear-gradient(" . $value1 . ", " . $value2 . " " . $value3 . "," . $value4 . " " . $value5 . ");"; $css[] = "filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='" . $value2 . "', endColorstr='" . $value4 . "',GradientType=1 );"; } else { $css[] = "background:" . $value . ";"; } break; case "activeColor": $css[] = "background:" . $value . ";"; break; case "borderThickness": $option['border'] = $value . "px"; break; case "borderColor": $option['border-color'] = $value; break; case "borderStyle": $option['border-style'] = $value; break; case "fontFace": $css[] = "font-family:" . $value . ";"; if (!in_array($value, array('Verdana', 'Georgia', 'Courier New', 'Arial', 'Tahoma', 'Trebuchet MS'))) { $font[] = "@import url(http://fonts.googleapis.com/css?family=" . str_replace(" ", "+", $value) . ");"; } break; case "fontStyle": if ($value == "bold") { $css[] = "font-weight:" . $value . ";"; } else { $css[] = "font-style:" . $value . ";"; } break; case "fontSize": $css[] = "font-size:" . $value . "px;"; break; case "iconColor": $css[] = "color:" . $value . ";"; if ($value != "black") { $css[] = "background-image: url('" . JURI::root(true) . "/media/jui/img/glyphicons-halflings-white.png');"; } $css[] = "color:" . $value . ";"; break; case "linkColor": case "fontColor": $css[] = "color:" . $value . ";"; break; case "roundedCornerRadius": $css[] = "border-radius:" . $value . "px;"; break; case "shadowSpread": $option[] = "0 1px 2px " . $value . "px"; break; case "shadowColor": $option[] = "rgba(" . implode(",", JSNMobilizeHelper::hex2rgb($value)) . ",0.5)"; break; case "marginleft": $css[] = "margin-left:" . $value . "px;"; break; case "marginright": $css[] = "margin-right:" . $value . "px;"; break; case "margintop": $css[] = "margin-top:" . $value . "px;"; break; case "marginbottom": $css[] = "margin-bottom:" . $value . "px;"; break; case "paddingleft": $css[] = "padding-left:" . $value . "px;"; break; case "paddingright": $css[] = "padding-right:" . $value . "px;"; break; case "paddingtop": $css[] = "padding-top:" . $value . "px;"; break; case "paddingbottom": $css[] = "padding-bottom:" . $value . "px;"; break; case "alignment": $css[] = "text-align:" . $value . ";"; break; } } //var_dump($css); return implode("\n", $css); }