예제 #1
0
    /**
     * The form field type.
     *
     * @var		string
     * @since	1.6
     */
    protected function getInput()
    {
        JHTML::_('behavior.modal', 'a.jsn-modal');
        $doc = JFactory::getDocument();
        $templateName = explode(DS, str_replace(array('\\elements', '/elements'), '', dirname(__FILE__)));
        $templateName = $templateName[count($templateName) - 1];
        require_once JPATH_ROOT . DS . 'templates' . DS . $templateName . DS . 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
        $doc->addScript(JURI::root() . 'templates/' . $templateName . '/admin/js/jsn_slider.js');
        $doc->addScript(JURI::root() . 'templates/' . $templateName . '/admin/js/jsn_admin.js');
        $doc->addStyleSheet(JURI::root() . 'templates/' . $templateName . '/admin/css/jsn_admin.css');
        $doc->addScriptDeclaration('
			var templateLang					= {};
			templateLang.expand_all				= "' . JText::_('EXPAND_ALL') . '";
			templateLang.collapse_all			= "' . JText::_('COLLAPSE_ALL') . '";
		');
        $jsnUtils = JSNUtils::getInstance();
        $tellMore = '';
        $html = '';
        $result = $jsnUtils->getTemplateDetails();
        $templateVersion = $result->version;
        $templateName = $result->name;
        $templateEdition = $result->edition;
        $templateName = str_replace('_', ' ', $templateName);
        $templateEdition = strtolower($templateEdition);
        // check System Cache - Plugin
        define('JSN_CACHESENSITIVE', $jsnUtils->checkSystemCache());
        $hashCookieIndex = isset($_COOKIE['HashCookieIndex']) ? json_decode($_COOKIE['HashCookieIndex']) : null;
        if (empty($hashCookieIndex->selected)) {
            $hashCookieIndex->selected = '0,';
            setcookie('HashCookieIndex', json_encode($hashCookieIndex), 0, '/');
        }
        $jsAccordion = "window.addEvent('domready', function(){\n\t\t\t\t\t\t\t\tnew Accordion(\$\$('.panel h3.jpane-toggler'), \$\$('.panel div.jpane-slider'), {\n\t\t\t\t\t\t\t\t\tonActive: function(toggler, i) {\n\t\t\t\t\t\t\t\t\t\ttoggler.addClass('jpane-toggler-down');\n\t\t\t\t\t\t\t\t\t\ttoggler.removeClass('jpane-toggler');\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tonBackground: function(toggler, i) {\n\t\t\t\t\t\t\t\t\t\ttoggler.addClass('jpane-toggler');\n\t\t\t\t\t\t\t\t\t\ttoggler.removeClass('jpane-toggler-down');\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tduration: 300,\n\t\t\t\t\t\t\t\t\topacity: false,\n\t\t\t\t\t\t\t\t\talwaysHide: true\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});";
        $doc->addScriptDeclaration($jsAccordion);
        $templateName = preg_replace('/_(free|pro)$/i', '', $result->name);
        $templateDocName = strtolower(str_replace('_', '-', $templateName));
        $templateReadableName = preg_replace('/^JSN_(.*)/ie', '"JSN " . ucfirst(strtolower("\\1"))', $templateName);
        $html = '<div class="jsn-quickstarted">';
        $html .= '<p>' . JTEXT::sprintf('WELCOME_MESSAGE', $templateReadableName) . '</p>
				<ol id="jsn-quickstart-links">
					<li>
						' . JText::_('INSTALL_SAMPLE_DATA_AS_SEEN_ON_DEMO_WEBSITE') . '
						<a class="jsn-modal btn link-button" rel="{handler: \'iframe\', size: {x: 750, y: 650}, closable: false}" href="../index.php?template=' . strtolower($result->name) . '&tmpl=jsn_installsampledata&template_style_id=' . JRequest::getInt('id') . '">' . JText::_('INSTALL_SAMPLE_DATA') . '</a>
					</li>
					<li>
						' . JText::_('WATCH_CONFIGURATION_VIDEOS_ON_YOUTUBE') . '
						<a class="btn link-button" href="http://www.joomlashine.com/docs/joomla-templates/template-configuration-videos.html" target="_blank">Watch videos</a>
					</li>
					<li>
						' . JText::_('DOWNLOAD_AND_READ_DOCUMENT_IN_PDF') . '
						<a class="btn link-button" href="http://www.joomlashine.com/joomla-templates/' . $templateDocName . '-docs.zip">Download documentation</a>
					</li>
				</ol>';
        $html .= '</div>';
        return $html;
    }
예제 #2
0
파일: jsnabout.php 프로젝트: Rikisha/proj
 /**
  * The form field type.
  *
  * @var		string
  * @since	1.6
  */
 protected function getInput()
 {
     JHTML::_('behavior.modal', 'a.jsn-modal');
     require_once dirname(dirname(__FILE__)) . DS . 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
     $jsnUtils = JSNUtils::getInstance();
     $doc = JFactory::getDocument();
     $templateName = $jsnUtils->getTemplateName();
     $copyright = '';
     $html = '';
     $manifestCache = $jsnUtils->getTemplateManifestCache($templateName);
     $manifestCache = json_decode($manifestCache);
     $result = $jsnUtils->getTemplateDetails();
     $frontIndexPath = JURI::root() . $jsnUtils->determineFrontendIndex();
     $proExists = $jsnUtils->checkProEditionExist($templateName, true);
     $doc->addScriptDeclaration("\n\t\t\tfunction checkIntegrity()\n\t\t\t{\n\t\t\t\t\$('jsn-check-integrity').set('html', '');\n\t\t\t\t\$('jsn-check-integrity-result').set('html', '');\n\t\t\t\tvar actionIntegrityUrl = '" . $frontIndexPath . "';\n\n\t\t\t\tvar resultIntegrityMsg = new Element('span');\n\t\t\t\tresultIntegrityMsg.set('class','jsn-integrity-checking');\n\t\t\t\tresultIntegrityMsg.set('html','" . JText::_('CHECKING', true) . "');\n\t\t\t\tresultIntegrityMsg.inject(\$('jsn-check-integrity-result'));\n\n\t\t\t\tvar jsonRequest = new Request.JSON({url: actionIntegrityUrl, onSuccess: function(jsonObj){\n\t\t\t\t\tif(jsonObj.integrity == '1') {\n\t\t\t\t\t\tresultIntegrityMsg.set('class','jsn-modification-exist');\n\t\t\t\t\t\tresultIntegrityMsg.set('html','<span>" . JText::_('SOME_FILES_HAVE_BEEN_MODIFIED', true) . ". <a href=\"../index.php?template=" . $templateName . "&tmpl=jsn_listmodifiedfiles\" class=\"link-action\" id=\"see-file-details\" rel=\"{handler: \\'iframe\\', size: {x: 570, y:320}}\" onclick=\"SqueezeBox.fromElement(\$(\\'see-file-details\\'), {parse: \\'rel\\'}); return false;\">" . JText::_('SEE_DETAILS_FILE', true) . "</a></span>');\n\t\t\t\t\t} else if (jsonObj.integrity == '0') {\n\t\t\t\t\t\tresultIntegrityMsg.set('class','jsn-no-modification');\n\t\t\t\t\t\tresultIntegrityMsg.set('html','" . JText::_('NO_FILES_MODIFICATION_FOUND', true) . "');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresultIntegrityMsg.set('class','jsn-no-modification');\n\t\t\t\t\t\tresultIntegrityMsg.set('html','" . JText::_('NO_CHECKSUM_FILE_FOUND', true) . "');\n\t\t\t\t\t}\n\t\t\t\t\tresultIntegrityMsg.inject(\$('jsn-check-integrity-result'));\n\t\t\t\t}}).get({'template': '" . $templateName . "', 'tmpl': 'jsn_runajax', 'task': 'checkFilesIntegrity'});\n\t\t\t}\n\n\t\t\twindow.addEvent('domready', function(){\n\t\t\t   \$('jsn-check-version').set('html', '');\n\t\t\t\tvar actionVersionUrl = '" . $frontIndexPath . "';\n\t\t\t\tvar resultVersionMsg = new Element('span');\n\t\t\t\tresultVersionMsg.set('class','jsn-version-checking');\n\t\t\t\tresultVersionMsg.set('html',' - " . JText::_('CHECKING_VERSION', true) . "');\n\t\t\t\tresultVersionMsg.inject(\$('jsn-check-version-result'));\n\t\t\t\tvar jsonRequest = new Request.JSON({url: actionVersionUrl, onSuccess: function(jsonObj){\n\t\t\t\t\tif(jsonObj.connection && jsonObj.version != '') {\n\t\t\t\t\t\tif(jsonObj.version == '" . $manifestCache->version . "') {\n\t\t\t\t\t\t\tresultVersionMsg.set('class','jsn-latest-version');\n\t\t\t\t\t\t\tresultVersionMsg.set('html',' - " . JText::_('THE_LATEST_VERSION') . "');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresultVersionMsg.set('class','jsn-outdated-version');\n\t\t\t\t\t\t\tresultVersionMsg.set('html',' - <a href=\"../index.php?template=" . $templateName . "&tmpl=jsn_autoupdater&template_style_id=" . JRequest::getInt('id') . "\" class=\"link-action\" id=\"jsn-auto-update\" rel=\"{handler: \\'iframe\\', size: {x: 750, y:680}}\" onclick=\"SqueezeBox.fromElement(\$(\\'jsn-auto-update\\'), {parse: \\'rel\\'}); return false;\">" . JText::_('UPDATE_NOW', true) . "'+jsonObj.version+'</a>');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresultVersionMsg.set('class','jsn-connection-fail');\n\t\t\t\t\t\tresultVersionMsg.set('html',' <span class=\"grey\">-</span> " . JText::_('CONNECTION_FAILED', true) . "');\n\t\t\t\t\t}\n\t\t\t\t\tresultVersionMsg.inject(\$('jsn-check-version-result'));\n\t\t\t\t}}).get({'template': '" . $templateName . "', 'tmpl': 'jsn_runajax', 'task': 'checkVersion'});\n\t\t\t\t\$('jsn-check-integrity').addEvent('click', function() {checkIntegrity()});\n\t\t\t});\n\n\t\t");
     $explodedTemplateName = explode('_', $templateName);
     if (strstr($result->copyright, $result->author) === false) {
         $copyright = $result->copyright . ' (<a target="_blank" title="' . $result->author . '" href="' . $result->authorUrl . '">' . $result->author . '</a>)';
     } else {
         $copyright = str_replace($result->author, '<a target="_blank" title="' . $result->author . '" href="' . $result->authorUrl . '">' . $result->author . '</a>', $result->copyright);
     }
     $staticLink = $result->authorUrl . '/joomla-templates/' . @$explodedTemplateName[0] . '-' . @$explodedTemplateName[1] . '.html';
     $html = '<div class="jsn-about">';
     $html .= '<div class="jsn-product-intro">';
     $html .= '<table width="100%"><tbody><tr><td width="10">';
     $html .= '<div class="jsn-template-thumbnail">';
     $html .= '<img src ="../templates/' . $templateName . '/template_thumbnail.png" width="206" height="150" />';
     $html .= '</div>';
     $html .= '</td><td>';
     $html .= '<div class="jsn-template-details">';
     $html .= '<h2>';
     $html .= str_replace('_', ' ', $result->name) . ' ' . $result->edition;
     $html .= '</h2>';
     if ($proExists === false) {
         $html .= '<a class="link-button jsn-modal" title="' . JText::_('UPGRADE_TO_PRO') . '" rel="{handler: \'iframe\', size: {x: 750, y: 650}, closable: false}" href="../index.php?template=' . strtolower($result->name) . '&tmpl=jsn_upgrade&template_style_id=' . JRequest::getInt('id') . '"><span class="icon-proversion">' . JText::_('JSN_UPGRADE_TEMPLATE') . '</span></a>';
     }
     $html .= '<hr />';
     $html .= '<dl>';
     $html .= '<dt>' . JText::_('VERSION') . ':</dt><dd><strong class="jsn-current-version">' . $manifestCache->version . '</strong><a href="javascript:void(0);" class="link-action" id="jsn-check-version"></a><span id="jsn-check-version-result"></span></dd>';
     $html .= '<dt>' . JText::_('COPYRIGHT') . ':</dt><dd>' . $copyright . '</dd>';
     $html .= '<dt>' . JText::_('INTEGRITY') . ':</dt><dd><a href="javascript:void(0);" class="link-action" id="jsn-check-integrity">' . JText::_('CHECK_FOR_FILES_MODIFICATION') . '</a><span id="jsn-check-integrity-result"></span></dd>';
     $html .= '</dl></td></tr></tbody></table></div><div class="jsn-product-cta">';
     $html .= '<div style="float: left; width: 60%;"><ul class="horizontal-list"><li><a rel="{handler: \'iframe\', size: {x: 640, y: 510}}" href="' . $result->authorUrl . '/' . @$explodedTemplateName[2] . '-joomla-templates-promo.html" class="link-button jsn-modal"><span class="icon-gallery">' . JText::_('SEE_OTHER_TEMPLATES') . '</span></a></li></ul></div>';
     $html .= '<div style="float: right; text-align: right;"><ul class="horizontal-list">';
     $html .= '<li><a target="_blank" title="Connect with us on Facebook" href="http://www.facebook.com/joomlashine"><img width="24" height="24" alt="Connect with us on Facebook" src="' . JURI::root() . 'templates/' . strtolower($result->name) . '/admin/images/icon-facebook.png"></a></li>';
     $html .= '<li><a target="_blank" title="Follow us on Twitter" href="http://www.twitter.com/joomlashine"><img width="24" height="24" alt="Follow us on Twitter" src="' . JURI::root() . 'templates/' . strtolower($result->name) . '/admin/images/icon-twitter.png"></a></li>';
     $html .= '<li><a target="_blank" title="Watch us on YouTube" href="http://www.youtube.com/joomlashine"><img width="24" height="24" alt="Watch us on YouTube" src="' . JURI::root() . 'templates/' . strtolower($result->name) . '/admin/images/icon-youtube.png"></a></li>';
     $html .= '</ul></div>';
     $html .= '</div>';
     $html .= '</div>';
     return $html;
 }
예제 #3
0
 function setTemplateInfo()
 {
     $objUtils = JSNUtils::getInstance();
     $objReadXMLFile = new JSNReadXMLFile();
     $templateManifest = $objReadXMLFile->getTemplateManifestFileInformation();
     if ($templateManifest['edition'] != '' && $templateManifest['edition'] != 'free') {
         $edition = 'pro ' . $templateManifest['edition'];
     } else {
         $edition = 'free';
     }
     $this->_edition = $edition;
     $this->_based_identified_name = '';
     $this->_identified_name = str_replace('jsn', 'tpl', strtolower($templateManifest['name']));
     $this->_joomla_version = $objUtils->getJoomlaVersion(true);
     $this->_full_name = strtolower($templateManifest['full_name']);
     $this->_name = strtolower($templateManifest['name']);
     $this->_template_version = $templateManifest['version'];
 }
예제 #4
0
 /**
  * The form field type.
  *
  * @var		string
  * @since	1.6
  */
 protected function getInput()
 {
     require_once dirname(dirname(__FILE__)) . DS . 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
     $jsnUtils = JSNUtils::getInstance();
     $doc = JFactory::getDocument();
     $templateName = $jsnUtils->getTemplateName();
     $templateAbsPath = JPATH_ROOT . DS . 'templates' . DS . $templateName;
     $attr = $this->element['disabled'] ? 'disabled="' . $this->element['disabled'] . '"' : '';
     $default = $this->element['default'] ? $this->element['default'] : '';
     $data = $jsnUtils->getPositions($templateName);
     $html = '<div class="jsn-positionmapping">';
     if ($this->value) {
         $html .= $jsnUtils->renderPositionComboBox($this->value, $data['desktop'], 'Select position', 'jform[params][' . $this->element['name'] . ']', $attr);
     } else {
         $html .= $jsnUtils->renderPositionComboBox($default, $data['desktop'], 'Select position', 'jform[params][' . $this->element['name'] . ']', $attr);
     }
     $html .= '</div>';
     return $html;
 }
예제 #5
0
파일: jsnspacer.php 프로젝트: Rikisha/proj
 /**
  * Method to get the field label markup.
  *
  * @return  string  The field label markup.
  * @since   11.1
  */
 protected function getLabel()
 {
     $jsnUtils = JSNUtils::getInstance();
     $result = $jsnUtils->getTemplateDetails();
     $proExists = $jsnUtils->checkProEditionExist($jsnUtils->getTemplateName(), true);
     if (!JSN_CACHESENSITIVE && $this->element['cachesensitive'] == 'yes') {
         return implode('', array());
     }
     $html = array();
     $class = $this->element['class'] ? (string) $this->element['class'] : '';
     $html[] = '<span class="spacer">';
     $html[] = '<span class="before"></span>';
     $html[] = '<span class="' . $class . '">';
     if ((string) $this->element['hr'] == 'true') {
         $html[] = '<hr class="' . $class . '" />';
     } else {
         $label = '';
         // Get the label text from the XML element, defaulting to the element name.
         $text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name'];
         $text = $this->translateLabel ? JText::_($text) : $text;
         // Build the class for the label.
         $class = !empty($this->description) ? 'hasTip' : '';
         $class = $this->required == true ? $class . ' required' : $class;
         // Add the opening label tag and main attributes attributes.
         $label .= '<label id="' . $this->id . '-lbl" class="' . $class . '"';
         // If a description is specified, use it to build a tooltip.
         if (!empty($this->description)) {
             $label .= ' title="' . htmlspecialchars(trim($text, ':') . '::' . ($this->translateDescription ? JText::_($this->description) : $this->description), ENT_COMPAT, 'UTF-8') . '"';
         }
         // Add the label text and closing tag.
         if ($proExists === false) {
             $upgrade_link = '<strong><a class="link-action jsn-modal" rel="{handler: \'iframe\', size: {x: 750, y: 650}, closable: false}" href="../index.php?template=' . strtolower($result->name) . '&tmpl=jsn_upgrade&template_style_id=' . JRequest::getInt('id') . '">Upgrade now</a></strong>';
         } else {
             $upgrade_link = '';
         }
         $label .= '>' . JText::sprintf($text, $upgrade_link) . '</label>';
         $html[] = $label;
     }
     $html[] = '</span>';
     $html[] = '<span class="after"></span>';
     $html[] = '</span>';
     return implode('', $html);
 }
예제 #6
0
파일: modules.php 프로젝트: Rikisha/proj
function modChrome_jsnmodule($module, &$params, &$attribs)
{
    $jsnutils = JSNUtils::getInstance();
    $moduleTitleOuput = '<span class="jsn-moduleicon">' . $module->title . '</span>';
    $beginModuleContainerOutput = '';
    $endModuleContainerOutput = '';
    // Check module class for xHTML output
    if (isset($attribs['class'])) {
        // Check value in attribute class to generate appropriate xHTML code for module title
        if (preg_match("/\\bjsn-duohead\\b/", (string) $attribs['class'])) {
            $moduleTitleOuput = '<span class="jsn-moduleicon">' . $jsnutils->wrapFirstWord($module->title) . '</span>';
        }
        if (preg_match("/\\bjsn-innerhead\\b/", (string) $attribs['class'])) {
            $moduleTitleOuput = '<span class="jsn-moduletitle_inner1"><span class="jsn-moduletitle_inner2">' . $moduleTitleOuput . '</span></span>';
        }
        // Check value in attribute class to generate appropriate xHTML code for module container
        if (preg_match("/\\bjsn-triobox\\b/", (string) $attribs['class'])) {
            $beginModuleContainerOutput = '<div class="jsn-top"><div class="jsn-top_inner"></div></div><div class="jsn-middle"><div class="jsn-middle_inner">';
            $endModuleContainerOutput = '</div></div><div class="jsn-bottom"><div class="jsn-bottom_inner"></div></div>';
        } else {
        }
        if (preg_match("/\\bjsn-roundedbox\\b/", (string) $attribs['class'])) {
            $beginModuleContainerOutput = '<div><div>';
            $endModuleContainerOutput = '</div></div>';
        } else {
        }
    }
    // Generate output code to template
    echo '<div class="' . $params->get('moduleclass_sfx') . ' jsn-modulecontainer"><div class="jsn-modulecontainer_inner">';
    echo $beginModuleContainerOutput;
    if ($module->showtitle) {
        echo '<h3 class="jsn-moduletitle">' . $moduleTitleOuput . '</h3>';
    }
    echo '<div class="jsn-modulecontent">';
    echo $module->content;
    echo '<div class="clearbreak"></div></div>';
    echo $endModuleContainerOutput;
    echo '</div></div>';
}
예제 #7
0
 /**
  * The form field type.
  *
  * @var		string
  * @since	1.6
  */
 protected function getInput()
 {
     require_once dirname(dirname(__FILE__)) . DS . 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
     $jsnUtils = JSNUtils::getInstance();
     $templateName = $jsnUtils->getTemplateName();
     $doc = JFactory::getDocument();
     $attr = '';
     $jconfig = new JConfig();
     // Initialize some field attributes.
     $attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
     $attr .= (string) $this->element['disabled'] == 'true' ? ' disabled="disabled"' : '';
     $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
     $value = htmlspecialchars(html_entity_decode($this->value, ENT_QUOTES), ENT_QUOTES);
     $root_folder = str_replace('\\', '/', JPATH_ROOT) . '/';
     $html = '<div class="jsn-cachefolder">';
     if (!$this->element['disabled']) {
         $doc->addScriptDeclaration("\n\t\t\t\twindow.addEvent('domready', function(){ \n\t\t\t\t\t\$('jform_params_cachefolder').addEvents({\n\t\t\t\t\t\tkeyup: function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\$('jform_params_cachefolder').fireEvent('hideCheckLink');\n\t\t\t\t\t\t},\n\t\t\t\t\t\tkeydown: function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\$('jform_params_cachefolder').fireEvent('hideCheckLink');\n\t\t\t\t\t\t},\n\t\t\t\t\t\thideCheckLink: function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif( \$('jform_params_cachefolder').value == '') \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\$('jsn-checkcache').set('styles', {'visibility': 'hidden'});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\$('jsn-checkcache').set('styles', {'visibility': 'visible'});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\t\n\t\t\t\t\t\$('jsn-checkcache-action').addEvent('click', function() {\n\t\t\t\t\t\tactionUrl = '" . JURI::root() . "index.php';\n\t\t\t\t\t\tvar resultMsg = new Element('font');\n\t\t\t\t\t\tvar jsonRequest = new Request.JSON({url: actionUrl, onSuccess: function(jsonObj){\n\t\t\t\t\t\t\t\$('jsn-checkcache-result').set('html' , '');\n\t\t\t\t\t\t\tif(jsonObj.isDir) {\n\t\t\t\t\t\t\t\tif(jsonObj.isWritable) {\n\t\t\t\t\t\t\t\t\tresultMsg.set({color: 'green', text: '" . JText::_('FOLDER_EXISTS_WRITABLE') . "'});\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tresultMsg.set({color: 'red', text: '" . JText::_('FOLDER_NOT_WRITABLE') . "'});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresultMsg.set({color: 'red', text: '" . JText::_('FOLDER_NOT_EXISTS') . "'});\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tresultMsg.inject(\$('jsn-checkcache-result'));\n\t\t\t\t\t\t}}).get({'template': '" . $templateName . "', 'tmpl': 'jsn_runajax', 'cache_folder': '" . $root_folder . "' + \$('jform_params_cachefolder').value , 'task': 'checkCacheFolder'});\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t");
         $html .= '<input value="' . $value . '" type="text" name="' . $this->name . '" id="jform_params_cachefolder" ' . $attr . ' /><span id="jsn-checkcache"><a id="jsn-checkcache-action" class="link-action" href="javascript:void(0)">' . JText::_('CHECK_CACHE_FOLDER') . '</a><span id="jsn-checkcache-result"></span></span>';
     } else {
         $html .= '<input value="' . $value . '" type="text" name="' . $this->name . '" id="jform_params_cachefolder" ' . $attr . ' /><span id="jsn-checkcache"><span class="link-disabled">' . JText::_('CHECK_CACHE_FOLDER') . '</span></span>';
     }
     $html .= '</div>';
     return $html;
 }
예제 #8
0
파일: default.php 프로젝트: Rikisha/proj
<?php

/**
 * @version		$Id: default.php 20196 2011-01-09 02:40:25Z ian $
 * @package		Joomla.Site
 * @subpackage	mod_menu
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */
// No direct access.
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$template = $app->getTemplate();
require_once JPATH_THEMES . DS . $template . DS . 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
$jsn_utils = JSNUtils::getInstance();
// Note. It is important to remove spaces between elements.
?>

<ul class="<?php 
echo $class_sfx;
?>
"<?php 
$tag = '';
if ($params->get('tag_id') != NULL) {
    $tag = $params->get('tag_id') . '';
    echo ' id="' . $tag . '"';
}
?>
>
<?php 
$count = 1;
예제 #9
0
파일: jsn_ajax.php 프로젝트: Rikisha/proj
 /**
  *
  * Initialize instance of JSNUtils class
  */
 function _setUtilsInstance()
 {
     $this->_obj_utils = JSNUtils::getInstance();
 }
예제 #10
0
/**
 * @author    JoomlaShine.com http://www.joomlashine.com
 * @copyright Copyright (C) 2008 - 2011 JoomlaShine.com. All rights reserved.
 * @license   GNU/GPL v2 http://www.gnu.org/licenses/gpl-2.0.html
 * @version   $Id: jsn_autoupdater.php 11613 2012-03-08 09:31:14Z hieudm $
 */
// No direct access
defined('_JEXEC') or die('Restricted access');
require_once 'includes' . DS . 'jsn_defines.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_readxmlfile.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_auto_updater_helper.php';
$session = JFactory::getSession();
$obj_read_xml_file = new JSNReadXMLFile();
$obj_utils = new JSNUtils();
$obj_updater_helper = new JSNAutoUpdaterHelper();
$template_manifest = $obj_read_xml_file->getTemplateManifestFileInformation();
$manifest_cache = $obj_utils->getTemplateManifestCache();
$manifest_cache = json_decode($manifest_cache);
/* Determine front-end index path, including lang sef if available */
$frontIndexPath = JURI::root() . $obj_utils->determineFrontendIndex();
/* Form template identified_name */
$explodedName = explode('_', $template_manifest['name']);
$templateIdName = 'tpl_' . $explodedName[1];
/* Get template latest version from session if possible */
$templateVersionSesId = md5('template_version_' . strtolower($template_manifest['full_name']));
$versionFromSes = $session->get($templateVersionSesId, null, 'jsntemplatesession');
if (!is_null($versionFromSes)) {
    $latest_version = $versionFromSes;
} else {
예제 #11
0
/**
 * @author    JoomlaShine.com http://www.joomlashine.com
 * @copyright Copyright (C) 2008 - 2011 JoomlaShine.com. All rights reserved.
 * @license   GNU/GPL v2 http://www.gnu.org/licenses/gpl-2.0.html
 * @version   $Id: jsn_manualupdater.php 11613 2012-03-08 09:31:14Z hieudm $
 */
// No direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem.file');
require_once 'includes' . DS . 'jsn_defines.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_readxmlfile.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_manual_updater_helper.php';
$session = JFactory::getSession();
$obj_read_xml_file = new JSNReadXMLFile();
$obj_utils = new JSNUtils();
$obj_updater_helper = new JSNManualUpdaterHelper();
$template_manifest = $obj_read_xml_file->getTemplateManifestFileInformation();
$template_style_id = JRequest::getInt('template_style_id', 0, 'GET');
$task = JRequest::getWord('task', '', 'POST');
$login_identifier = md5('state_update_login_' . strtolower($template_manifest['full_name']));
$result_update = false;
$file_name = '';
$frontIndexPath = JURI::root() . $obj_utils->determineFrontendIndex();
$templateNameParts = explode('_', strtolower($template_manifest['full_name']));
$templateInfoLink = 'http://www.joomlashine.com/joomla-templates/' . $templateNameParts[0] . '-' . $templateNameParts[1] . '.html';
if ($template_manifest['edition'] != '' && $template_manifest['edition'] != 'free') {
    $downloadLink = 'http://www.joomlashine.com/customer-area.html';
    $downloadText = JText::sprintf('JSN_UPDATE_MANUAL_MES2_PRO', $downloadLink);
} else {
    $downloadLink = 'http://www.joomlashine.com/joomla-templates/' . $templateNameParts[0] . '-' . $templateNameParts[1] . '-download.html';
예제 #12
0
 * @license   GNU/GPL v2 http://www.gnu.org/licenses/gpl-2.0.html
 * @version   $Id: jsn_updaternotification.php 15592 2012-08-28 09:33:04Z giangnd $
 */
// No direct access
defined('_JEXEC') or die('Restricted access');
include_once 'includes' . DS . 'jsn_defines.php';
include_once 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
include_once 'includes' . DS . 'lib' . DS . 'jsn_readxmlfile.php';
include_once 'includes' . DS . 'lib' . DS . 'jsn_updater_helper.php';
include_once 'includes' . DS . 'lib' . DS . 'jsn_httpsocket.php';
include_once 'includes' . DS . 'lib' . DS . 'jsn_downloadtemplatepackage.php';
$template_style_id = JRequest::getInt('template_style_id', 0, 'GET');
$type = JRequest::getVar('type', 'auto', 'GET');
$session = JFactory::getSession();
$obj_read_xml_file = new JSNReadXMLFile();
$obj_utils = new JSNUtils();
$obj_updater_helper = new JSNUpdaterHelper();
$template_manifest = $obj_read_xml_file->getTemplateManifestFileInformation();
if ($template_manifest['edition'] != '' && $template_manifest['edition'] != 'free') {
    $edition = strtolower('pro_' . $template_manifest['edition']);
} else {
    $edition = 'free';
}
$manifest_cache = $obj_utils->getTemplateManifestCache();
$manifest_cache = json_decode($manifest_cache);
/* Form template identified_name */
$template_name = strtolower($manifest_cache->name);
$template_version_identifier = md5('template_version_' . $template_name);
$customer_info_identifier = md5('state_update_customer_info_' . $template_name);
$login_identifier = md5('state_update_login_' . $template_name);
$version_from_session = $session->get($template_version_identifier, null, 'jsntemplatesession');
예제 #13
0
 function socketDownload()
 {
     /**
      * When it come across this point from a JSNDownloadPackage instance,
      * the fsockopen will always be used, not cURL nor fOPEN
      */
     $objJSNUtil = JSNUtils::getInstance();
     if (!function_exists('fsockopen')) {
         if ($objJSNUtil->cURLCheckFunctions()) {
             return $this->cURLDownload();
         } elseif ($objJSNUtil->fOPENCheck()) {
             return $this->fOPENDownload();
         } else {
             return false;
         }
     }
     $crlf = "\r\n";
     $response = '';
     $data = '';
     if (is_array($this->_data) && count($this->_data) > 0) {
         $data = array();
         while (list($n, $v) = each($this->_data)) {
             $data[] = "{$n}={$v}";
         }
         $data = implode('&', $data);
         $contentType = "Content-type: application/x-www-form-urlencoded" . $crlf;
     } else {
         $data = $this->_data;
         $contentType = "Content-type: text/xml" . $crlf;
     }
     if (is_null($this->_referer)) {
         $referer = JURI::root();
     }
     $this->_fp = @fsockopen(($this->_protocol == 'https' ? 'ssl://' : '') . $this->_host, $this->_port, $errno, $errstr);
     if ($this->_fp === false) {
         return false;
     }
     if ($this->_method == 'post') {
         $req = 'POST ' . $this->_uri . ' HTTP/1.1' . $crlf . 'Host: ' . $this->_host . $crlf . 'Referer: ' . $referer . $crlf . $contentType . 'Content-length: ' . strlen($data) . $crlf . 'Connection: close' . $crlf . $crlf . $data;
     } elseif ($this->_method == 'get') {
         $req = 'GET ' . $this->_uri . $this->_query . ' HTTP/1.1' . $crlf . 'Host: ' . $this->_host . $crlf . 'Connection: close' . $crlf . $crlf;
         @fwrite($this->_fp, $req);
     }
     while (is_resource($this->_fp) && $this->_fp && !feof($this->_fp)) {
         $response .= fread($this->_fp, 1024);
     }
     @fclose($this->_fp);
     $pos = @strpos($response, $crlf . $crlf);
     if ($pos === false) {
         return $response;
     }
     $header = substr($response, 0, $pos);
     $body = substr($response, $pos + 2 * strlen($crlf));
     $headers = array();
     $lines = explode($crlf, $header);
     foreach ($lines as $line) {
         if (($pos = strpos($line, ':')) !== false) {
             $headers[strtolower(trim(substr($line, 0, $pos)))] = trim(substr($line, $pos + 1));
         }
     }
     /* Modify a bit for sample data extension installing */
     if (isset($headers['location']) && $this->_nofollow !== true) {
         $http = new JSNHTTPSocket($headers['location'], $this->_data, $this->_referer, $this->_method);
         return $http->socketDownload();
     } else {
         return $body;
     }
 }
예제 #14
0
<?php

/**
 * @author    JoomlaShine.com http://www.joomlashine.com
 * @copyright Copyright (C) 2008 - 2012 JoomlaShine.com. All rights reserved.
 * @license   GNU/GPL v2 http://www.gnu.org/licenses/gpl-2.0.html
 * @version   $Id: jsn_upgrade.php 13532 2012-06-26 03:20:42Z ngocpm $
 */
// No direct access
defined('_JEXEC') or die('Restricted access');
require_once 'includes' . DS . 'jsn_defines.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_readxmlfile.php';
require_once 'includes' . DS . 'lib' . DS . 'jsn_proupgrade_helper.php';
$jsnUtils = new JSNUtils();
$jsnReadXml = new JSNReadXMLFile();
$joomlaVersion = $jsnUtils->getJoomlaVersion(true);
$templateManifest = $jsnReadXml->getTemplateManifestFileInformation();
$templateLowName = strtolower($templateManifest['full_name']);
$jsnUpgradeHelper = new JSNProUpgradeHelper($templateManifest, $joomlaVersion);
$task = JRequest::getVar('task', '');
$manualUpgrade = JRequest::getVar('manual', 0);
$autoUpgradeTried = JRequest::getVar('auto_tried', 0, 'GET');
$templateStyleId = JRequest::getInt('template_style_id', 0, 'GET');
$frontIndexPath = JURI::root() . $jsnUtils->determineFrontendIndex();
/* Session variables */
$session = JFactory::getSession();
$sessionTemp = array();
$sessionTemp['upgrader'] = md5('jsn_upgrader_' . $templateLowName);
$sessionTemp['joomla_login'] = md5('joomla_login_' . $templateLowName);
$sessionTemp['jsn_login'] = md5('jsn_login_' . $templateLowName);
예제 #15
0
파일: jsnmedia.php 프로젝트: Rikisha/proj
 protected function getInput()
 {
     require_once dirname(dirname(__FILE__)) . DS . 'includes' . DS . 'lib' . DS . 'jsn_utils.php';
     $jsnUtils = JSNUtils::getInstance();
     $templateName = $jsnUtils->getTemplateName();
     /* Form the internal path to default template logo */
     $defaultLogoPath = '';
     if (strpos($this->name, 'mobileLogoPath') !== false) {
         $defaultLogoPath = 'templates/' . $templateName . '/images/logo-m.png';
     } elseif (strpos($this->name, 'logoPath') !== false) {
         $defaultLogoPath = 'templates/' . $templateName . '/images/logo.png';
     }
     if ($this->value == '') {
         $this->value = $defaultLogoPath;
     }
     $assetField = $this->element['asset_field'] ? (string) $this->element['asset_field'] : 'asset_id';
     $authorField = $this->element['created_by_field'] ? (string) $this->element['created_by_field'] : 'created_by';
     $asset = $this->form->getValue($assetField) ? $this->form->getValue($assetField) : (string) $this->element['asset_id'];
     $disabled = (string) $this->element['disabled'] == 'true' ? true : false;
     // check System Cache Plugin
     $cacheSensitive = JSN_CACHESENSITIVE && (string) $this->element['cachesensitive'] == 'yes';
     if ($cacheSensitive) {
         $disabled = true;
     }
     if ($asset == "") {
         $asset = JRequest::getCmd('option');
     }
     $link = (string) $this->element['link'];
     if (!self::$initialised) {
         // Load the modal behavior script.
         JHtml::_('behavior.modal');
         // Build the script.
         $script = array();
         $script[] = '	function jInsertFieldValue(value, id) {';
         $script[] = '		var old_id = document.id(id).value;';
         $script[] = '		if (old_id != id) {';
         $script[] = '			var elem = document.id(id)';
         $script[] = '			elem.value = value;';
         $script[] = '			elem.fireEvent("change");';
         $script[] = '		}';
         $script[] = '	}';
         // Add the script to the document head.
         JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
         self::$initialised = true;
     }
     // Initialize variables.
     $html = array();
     $attr = '';
     // Initialize some field attributes.
     $attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
     $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
     $attr .= $disabled ? ' disabled="disabled"' : '';
     // Initialize JavaScript field attributes.
     $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
     // The text field.
     $html[] = '<div class="fltlft">';
     $html[] = '	<input type="text" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . ' readonly="readonly"' . $attr . ' />';
     $html[] = '</div>';
     $directory = (string) $this->element['directory'];
     if ($this->value == $defaultLogoPath) {
         $folder = '';
     } elseif (file_exists(JPATH_ROOT . '/' . $this->value)) {
         $folder = explode('/', $this->value);
         array_shift($folder);
         array_pop($folder);
         $folder = implode('/', $folder);
     } elseif (file_exists(JPATH_ROOT . '/images/' . $directory)) {
         $folder = $directory;
     } else {
         $folder = '';
     }
     // The button.
     $unactived = $disabled ? ' jsn-disabled-button' : '';
     $ref = $disabled ? '' : ' rel="{handler: \'iframe\', size: {x: 800, y: 500}}"';
     $href = $disabled ? ' href="javascript:void(0);"' : ' href="' . ($this->element['readonly'] ? '' : ($link ? $link : 'index.php?option=com_media&amp;view=images&amp;tmpl=component&amp;asset=' . $asset . '&amp;author=' . $this->form->getValue($authorField)) . '&amp;fieldid=' . $this->id . '&amp;folder=' . $folder) . '"';
     $modal = $disabled ? '' : ' class="modal"';
     $html[] = '<div class="button2-left' . $unactived . '">';
     $html[] = '	<div class="blank">';
     $html[] = '		<a' . $modal . ' title="' . JText::_('JLIB_FORM_BUTTON_SELECT') . '"' . $href . $ref . '>';
     $html[] = '			' . JText::_('JLIB_FORM_BUTTON_SELECT') . '</a>';
     $html[] = '	</div>';
     $html[] = '</div>';
     $html[] = '<div class="button2-left' . $unactived . '">';
     $html[] = '	<div class="blank">';
     $html[] = '		<a title="' . JText::_('LOGO_BUTTON_DEFAULT') . '"' . ' href="javascript:void(0);"' . ' onclick="document.getElementById(\'' . $this->id . '\').value=\'' . htmlspecialchars($defaultLogoPath, ENT_COMPAT, 'UTF-8') . '\';">';
     $html[] = '			' . JText::_('LOGO_BUTTON_DEFAULT') . '</a>';
     $html[] = '	</div>';
     $html[] = '</div>';
     return implode("\n", $html);
 }
예제 #16
0
 function installSampleDataManually()
 {
     $filename = $this->getPackageFromUpload();
     if (!$filename) {
         return false;
     }
     $obj_read_xml_file = new JSNReadXMLFile();
     $obj_utils = new JSNUtils();
     $unpack_package = $this->unpackPackage($filename);
     $template_manifest = json_decode($obj_utils->getTemplateManifestCache(), true);
     $array_non_basic_module = $this->getNonBasicModule();
     $array_non_basic_admin_module = $this->getNonBasicAdminModule();
     $array_3rd_extension_menu = $this->getThirdExtensionMenus();
     $domain = $this->getDomain();
     $errors = array();
     $isNotExsited = array();
     $folderbackup = $this->_template_folder_path . DS . 'backups';
     if ($unpack_package) {
         $sample_data_xml = $obj_read_xml_file->getSampleDataFileContent($unpack_package, $this->_template_folder_name);
         $installed_data = $sample_data_xml['installed_data'];
         if ($installed_data && is_array($installed_data)) {
             if (trim($sample_data_xml['version']) != trim($template_manifest['version'])) {
                 $this->deleteSampleDataFile($filename);
                 $this->deleteSampleDataFolder($unpack_package);
                 $msg = JText::_('JSN_SAMPLE_DATA_OUTDATED_PRODUCT') . ' <a class="link-action" href="http://www.joomlashine.com/docs/general/how-to-update-product.html" target="_blank">' . JText::_('JSN_SAMPLE_DATA_HOW_TO_UPDATE') . '</a>';
                 JError::raiseWarning('SOME_ERROR_CODE', JText::_($msg));
                 return false;
             } else {
                 $result_check_existing_extension = $this->checkExistingExtensions($installed_data);
                 foreach ($result_check_existing_extension as $key => $value) {
                     if ($value['hasData'] === false) {
                         unset($installed_data[$key]);
                     } else {
                         if ($value['exist']) {
                             $extenstion_manifest = $obj_read_xml_file->getExtensionManifestFileInformation($key, $value['manifestPath']);
                             if (count($extenstion_manifest)) {
                                 if (@$extenstion_manifest['version'] != $installed_data[$key]->version) {
                                     $errors[] = '<strong>' . $installed_data[$key]->description . '</strong> - ' . 'Version <strong>' . $installed_data[$key]->version . '</strong> is required. <a class="link-action" href="http://www.joomlashine.com/docs/general/how-to-update-product.html" target="_blank">How to update?</a>';
                                     unset($installed_data[$key]);
                                 }
                             } else {
                                 $errors[] = '<strong>' . $installed_data[$key]->description . '</strong> - ' . 'the version information not found in sample data package.';
                                 unset($installed_data[$key]);
                             }
                         } else {
                             $errors[] = '<strong>' . $installed_data[$key]->description . '</strong> - ' . 'Extension is not installed. <a class="link-action" href="http://www.joomlashine.com/joomla-extensions/jsn-' . $key . '.html" target="_blank">Get it now.</a>';
                             $isNotExsited[] = $key;
                             unset($installed_data[$key]);
                         }
                     }
                 }
                 $this->returnError('false', $errors);
                 $obj_backup = JSNBackup::getInstance();
                 if (is_writable($folderbackup)) {
                     $backup_file_name = $obj_backup->executeBackup($this->_template_folder_path . DS . 'backups', $domain, $installed_data);
                 }
                 $this->deleteNonBasicAdminModule();
                 $this->installSampleData($installed_data);
                 if (count($isNotExsited)) {
                     $asset = JTable::getInstance('Asset');
                     foreach ($isNotExisted as $element) {
                         $element = 'com_' . $element;
                         if ($asset->loadByName($element)) {
                             $asset->delete();
                         }
                     }
                 }
                 $this->runQueryNonBasicModule($array_non_basic_module);
                 $this->runQueryNonBasicModule($array_non_basic_admin_module, true);
                 $this->restoreThirdExtensionMenus($array_3rd_extension_menu);
                 $this->rebuildMenu();
                 $this->copyContentFromFilesFolder($unpack_package);
                 $this->deleteSampleDataFolder($unpack_package);
                 $this->setDefaultTemplate(strtolower($template_manifest['name']));
                 $this->deleteSampleDataFile($filename);
                 return true;
             }
         } else {
             $this->deleteSampleDataFile($filename);
             $msg = JText::_('JSN_SAMPLE_DATA_INVALID');
             JError::raiseWarning('SOME_ERROR_CODE', $msg);
         }
         return false;
     } else {
         $msg = JText::_('JSN_SAMPLE_DATA_UNABLE_EXTRACT_PACKAGE');
         JError::raiseWarning('SOME_ERROR_CODE', $msg);
     }
     return false;
 }