当前位置: 首页>>代码示例>>PHP>>正文


PHP JVersion::getShortVersion方法代码示例

本文整理汇总了PHP中JVersion::getShortVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP JVersion::getShortVersion方法的具体用法?PHP JVersion::getShortVersion怎么用?PHP JVersion::getShortVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JVersion的用法示例。


在下文中一共展示了JVersion::getShortVersion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getJoomlaVersion

 private function getJoomlaVersion()
 {
     $VERSION = new JVersion();
     // Store in our object for switching configs
     $this->version = $VERSION->getShortVersion();
     return $VERSION->getShortVersion();
 }
开发者ID:ranamimran,项目名称:persivia,代码行数:7,代码来源:bfSnapshot.php

示例2: preflight

 function preflight($type, $parent)
 {
     $jversion = new JVersion();
     // Installing component manifest file version
     $this->release = $parent->get("manifest")->version;
     // Manifest file minimum Joomla version
     $this->minimum_joomla_release = $parent->get("manifest")->attributes()->version;
     // Show the essential information at the install/update back-end
     echo '<p>Installing component manifest file version = ' . $this->release;
     echo '<br />Current manifest cache commponent version (if any) = ' . $this->getParam('version');
     echo '<br />Installing component manifest file minimum Joomla version = ' . $this->minimum_joomla_release;
     echo '<br />Current Joomla version = ' . $jversion->getShortVersion();
     // abort if the current Joomla release is older
     if (version_compare($jversion->getShortVersion(), $this->minimum_joomla_release, 'lt')) {
         Jerror::raiseWarning(null, 'Cannot install com_improvemycity in a Joomla release prior to ' . $this->minimum_joomla_release);
         return false;
     }
     // abort if the component being installed is not newer than the currently installed version
     if ($type == 'update') {
         $oldRelease = $this->getParam('version');
         $rel = $oldRelease . ' to ' . $this->release;
         if (version_compare($this->release, $oldRelease, 'lt')) {
             Jerror::raiseWarning(null, 'Incorrect version sequence. Cannot upgrade ' . $rel);
             return false;
         }
     } else {
         $rel = $this->release;
     }
     //echo '<p>' . JText::_('COM_IMPROVEMYCITY_PREFLIGHT_' . $type . ' ' . $rel) . '</p>';
 }
开发者ID:Ayner,项目名称:Improve-my-city,代码行数:30,代码来源:script.php

示例3: display

 function display($tpl = null)
 {
     echo '
     <style type="text/css">
     .icon-48-logo_left { background-image: url(../administrator/components/com_contentbuilder/views/logo_left.png); }
     </style>
     ';
     jimport('joomla.version');
     $version = new JVersion();
     if (version_compare($version->getShortVersion(), '1.6', '>=')) {
         echo '<link rel="stylesheet" href="' . JURI::root(true) . '/administrator/components/com_contentbuilder/views/bluestork.fix.css" type="text/css" />';
     }
     if (version_compare(CBJOOMLAVERSION, '3.0', '<')) {
         JToolBarHelper::title('<img src="components/com_contentbuilder/views/logo_right.png" alt="" align="top" /> <span style="display:inline-block; vertical-align:middle"> :: ' . JText::_('COM_CONTENTBUILDER_FORMS') . '</span>', 'logo_left.png');
     } else {
         JToolBarHelper::title('ContentBuilder :: ' . JText::_('COM_CONTENTBUILDER_FORMS') . '</span>', 'logo_left.png');
     }
     if (version_compare($version->getShortVersion(), '3.0', '<')) {
         JToolBarHelper::editListX();
         JToolBarHelper::addNewX();
         JToolBarHelper::customX('copy', 'copy', '', JText::_('COM_CONTENTBUILDER_COPY'));
     } else {
         JToolBarHelper::addNew();
         JToolBarHelper::custom('copy', 'copy', '', JText::_('COM_CONTENTBUILDER_COPY'));
         JToolBarHelper::editList();
     }
     JToolBarHelper::deleteList();
     if (version_compare($version->getShortVersion(), '1.6', '>=')) {
         JToolBarHelper::preferences('com_contentbuilder');
     }
     // Get data from the model
     $items = $this->get('Data');
     $pagination = $this->get('Pagination');
     $tags = $this->get('Tags');
     $state = $this->get('state');
     $lists['order_Dir'] = $state->get('forms_filter_order_Dir');
     $lists['order'] = $state->get('forms_filter_order');
     $lists['state'] = JHTML::_('grid.state', $state->get('forms_filter_state'));
     $lists['limitstart'] = $state->get('limitstart');
     $lists['filter_tag'] = $state->get('forms_filter_tag');
     $ordering = $lists['order'] == 'ordering';
     $this->assignRef('ordering', $ordering);
     $this->assignRef('tags', $tags);
     $this->assignRef('lists', $lists);
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:48,代码来源:view.html.php

示例4: addToolbar

 /**
  * Display the toolbar
  *
  * @access      private
  */
 protected function addToolbar()
 {
     $state = $this->get('State');
     $doc = JFactory::getDocument();
     $version = new JVersion();
     JToolBarHelper::addNew('sitemap.add');
     JToolBarHelper::custom('sitemap.edit', 'edit.png', 'edit_f2.png', 'JTOOLBAR_EDIT', true);
     $doc->addStyleDeclaration('.icon-48-sitemap {background-image: url(components/com_xmap/images/sitemap-icon.png);}');
     JToolBarHelper::title(JText::_('XMAP_SITEMAPS_TITLE'), 'sitemap.png');
     JToolBarHelper::custom('sitemaps.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_Publish', true);
     JToolBarHelper::custom('sitemaps.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
     if (version_compare($version->getShortVersion(), '3.0.0', '>=')) {
         JToolBarHelper::custom('sitemaps.setdefault', 'featured.png', 'featured_f2.png', 'XMAP_TOOLBAR_SET_DEFAULT', true);
     } else {
         JToolBarHelper::custom('sitemaps.setdefault', 'default.png', 'default_f2.png', 'XMAP_TOOLBAR_SET_DEFAULT', true);
     }
     if ($state->get('filter.published') == -2) {
         JToolBarHelper::deleteList('', 'sitemaps.delete', 'JTOOLBAR_DELETE');
     } else {
         JToolBarHelper::trash('sitemaps.trash', 'JTOOLBAR_TRASH');
     }
     JToolBarHelper::divider();
     if (class_exists('JHtmlSidebar')) {
         JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true));
         JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
         $this->sidebar = JHtmlSidebar::render();
     }
 }
开发者ID:alvarovladimir,项目名称:messermeister_ab_rackservers,代码行数:33,代码来源:view.html.php

示例5: getInput

	protected function getInput()
	{
            $db = JFactory::getDbo();
            $query = $db->getQuery(true);
            $query->select('TIME_TO_SEC(TIMEDIFF(ADDDATE(`lastattempt`,INTERVAL `penalty` MINUTE),NOW())) AS timeleft,ip,firstattempt,lastattempt,attempts,penalty')->from('#__plg_system_adminexile')->where('penalty > 0')->order('lastattempt DESC');
            $db->setQuery($query);
            $blocked = $db->loadObjectList();
            if(!count($blocked)) return '';
            $version = new JVersion;
            $shortversion = explode('.',$version->getShortVersion());
            $return=array();
            $deletetext = '';
            if($shortversion[0] == 2) {
                $deletetext = JText::_('JACTION_DELETE');
            }
            $return[]='<table class="table table-condensed table-striped bruteforce"><tr><th>IP</th><th>'.JText::_('PLG_SYS_ADMINEXILE_FIRST_ATTEMPT').'</th><th>'.JText::_('PLG_SYS_ADMINEXILE_LAST_ATTEMPT').'</th><th>'.JText::_('PLG_SYS_ADMINEXILE_ATTEMPTS').'</th><th>'.JText::_('PLG_SYS_ADMINEXILE_PENALTY').'</th><td></td></tr>';
            foreach($blocked as $match) {
                if($match->timeleft <= 0) {
                    $query = $db->getQuery(true);
                    $query->delete('#__plg_system_adminexile')->where('ip = '.$db->quote($match->ip));
                    $db->setQuery($query);
                    $db->query();                    
                } else {
                    $buttons = '<button class="btn btn-mini removeblock hasTip" data-block="'.htmlentities(json_encode(array('ip'=>$match->ip,'firstattempt'=>$match->firstattempt))).'" data-toggle="tooltip" title="'.JText::_('JACTION_DELETE').'"><i class="icon-trash"></i>'.$deletetext.'</button>';
                    $return[]='<td>'.$match->ip.'</td><td>'.$match->firstattempt.'</td><td>'.$match->lastattempt.'</td><td>'.$match->attempts.'</td><td>'.$match->penalty.'</td><td>'.$buttons.'</td></tr>';
                }
            }
            $return[]='</table>';
            return implode("\n",$return);
	}
开发者ID:networksoft,项目名称:seekerplus2.com,代码行数:30,代码来源:blocklist.php

示例6: save

 static function save($option, $pkg)
 {
     $database = JFactory::getDBO();
     $row = new facileFormsMenus($database);
     jimport('joomla.version');
     $version = new JVersion();
     if (version_compare($version->getShortVersion(), '3.0', '>=')) {
         unset($_POST['ordering']);
         unset($row->ordering);
     }
     // bind it to the table
     if (!$row->bind($_POST)) {
         echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
         exit;
     }
     // if
     // store it in the db
     if (!$row->store()) {
         echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
         exit;
     }
     // if
     $row->reorder('parent=' . $row->parent);
     $result = updateComponentMenus();
     $type = 'message';
     $msg = BFText::_('COM_BREEZINGFORMS_MENUS_SAVED');
     if ($result != '') {
         $msg = $result;
         $type = 'error';
     }
     JFactory::getApplication()->redirect("index.php?option={$option}&act=managemenus&pkg={$pkg}", $msg, $type);
 }
开发者ID:juancarlos26,项目名称:checkilistabap,代码行数:32,代码来源:menu.class.php

示例7: display

 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->categories = Djc2Categories::getInstance();
     $user = JFactory::getUser();
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->ordering = array();
     foreach ($this->items as &$item) {
         if (!isset($this->ordering[$item->parent_id])) {
             $this->ordering[$item->parent_id] = array();
         }
         $this->ordering[$item->parent_id][] = $item->id;
     }
     $this->addToolbar();
     if (class_exists('JHtmlSidebar') && $user->authorise('core.admin')) {
         $this->sidebar = JHtmlSidebar::render();
     }
     $version = new JVersion();
     if (version_compare($version->getShortVersion(), '3.0.0', '<')) {
         $tpl = 'legacy';
     }
     parent::display($tpl);
 }
开发者ID:jputz12,项目名称:OneNow-Vshop,代码行数:29,代码来源:view.html.php

示例8: onDisplay

 function onDisplay($name, $asset, $author)
 {
     global $app;
     JHtml::_('behavior.modal');
     $doc = JFactory::getDocument();
     $link = $app->isAdmin() ? '..' : '';
     $link .= '/plugins/editors-xtd/rokbox/views/rokbox-picker.php?';
     $link .= 'textarea=' . $name;
     $link .= '&asset=' . $asset;
     $link .= '&author=' . $author;
     $link .= '&bp=' . urlencode(JURI::root());
     $version = new JVersion();
     $image_path = JURI::root(true) . '/plugins/editors-xtd/rokbox/assets/images/';
     if (version_compare($version->getShortVersion(), '3.0', '>=')) {
         $style = ".btn .icon-linkrokbox {background: url(" . $image_path . "rokbox_14x14.png) 100% 0 no-repeat;}";
     } else {
         $style = ".button2-left .linkrokbox {background: url(" . $image_path . "rokbox-button.png) 100% 0 no-repeat;}";
     }
     $doc->addStyleDeclaration($style);
     $button = new JObject();
     $button->set('modal', true);
     $button->set('class', 'btn');
     $button->set('link', $link);
     $button->set('text', JText::_('RokBox'));
     $button->set('name', 'linkrokbox');
     $button->set('options', "{handler: 'iframe', size: {x: 520, y: 430}}");
     return $button;
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:28,代码来源:rokbox.php

示例9: display

 function display($tpl = null)
 {
     $this->days = $this->get('Days');
     $this->countDays = $this->get('CountDays');
     $this->state = $this->get('State');
     jimport('joomla.html.pagination');
     $limit = JRequest::getVar('limit', '25', '', 'int');
     $limitstart = JRequest::getVar('limitstart', '0', '', 'int');
     $pagination = new JPagination($this->countDays, $limitstart, $limit);
     $this->pagination = $pagination;
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     if (class_exists('JHtmlSidebar')) {
         $this->sidebar = JHtmlSidebar::render();
     }
     $version = new JVersion();
     if (version_compare($version->getShortVersion(), '3.0.0', '<')) {
         $tpl = 'legacy';
     }
     parent::display($tpl);
 }
开发者ID:politik86,项目名称:test2,代码行数:25,代码来源:view.html.php

示例10: com_install

function com_install()
{
    // Initialize system variables
    $db = JFactory::getDBO();
    $application = JFactory::getApplication();
    // Do a simple PHP-check
    if (version_compare(phpversion(), '5.2.0', '>=') == false) {
        $application->enqueueMessage(JText::_('PHP 5.2.0 or higher is required.'), 'error');
        return false;
    }
    // Do a simple Joomla! version-check
    $jversion = new JVersion();
    if (version_compare($jversion->getShortVersion(), '1.5.9', '>=') == false) {
        $application->enqueueMessage(JText::_('Joomla! 1.5.9 or higher is required.'), 'error');
        return false;
    }
    // Collection of queries were going to try
    $update_queries = array('INSERT INTO `#__simplelists_categories` (`id`, `category_id` ) SELECT `id`,`catid` FROM `#__simplelists`', 'ALTER TABLE `#__simplelists` DROP COLUMN `catid`', 'ALTER TABLE `#__simplelists` ADD COLUMN `link_type` INT(11) NOT NULL DEFAULT 0 AFTER `title`', 'ALTER TABLE `#__simplelists` ADD COLUMN `hits` INT(11) NOT NULL DEFAULT 0 AFTER `ordering`', 'ALTER TABLE `#__simplelists` CHANGE `url` `link` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL', 'ALTER TABLE `#__simplelists` ADD COLUMN `created` DATETIME NOT NULL DEFAULT "0000-00-00 00:00:00" AFTER `published`', 'ALTER TABLE `#__simplelists` ADD COLUMN `created_by` INT(11) NOT NULL DEFAULT 0 AFTER `created`', 'ALTER TABLE `#__simplelists` ADD COLUMN `created_by_alias` TEXT AFTER `created_by`', 'ALTER TABLE `#__simplelists` ADD COLUMN `modified` DATETIME NOT NULL DEFAULT "0000-00-00 00:00:00" AFTER `created_by_alias`', 'ALTER TABLE `#__simplelists` ADD COLUMN `modified_by` INT(11) NOT NULL DEFAULT 0 AFTER `modified`', 'ALTER TABLE `#__simplelists` ADD COLUMN `modified_by_alias` TEXT AFTER `modified_by`', 'UPDATE `#__components` SET `link`="option=com_simplelists", `admin_menu_link`="option=com_simplelists&view=categories" WHERE `admin_menu_link`="option=com_categories&section=com_simplelists"', 'UPDATE `#__components` SET `link`="option=com_simplelists", `admin_menu_link`="option=com_simplelists&view=items" WHERE `admin_menu_link`="option=com_simplelists"', 'UPDATE `#__simplelists` SET `picture`=CONCAT("images/simplelists/", picture) WHERE `picture` != "" AND `picture` NOT LIKE "%images/simplelists%"', 'DELETE FROM #__simplelists_categories WHERE id NOT IN ( SELECT id FROM #__simplelists )', 'ALTER TABLE `#__simplelists` CHANGE `link_type` `link_type` VARCHAR( 20 ) NOT NULL', 'UPDATE `#__simplelists` SET `link_type`="" WHERE `link_type`="0"', 'UPDATE `#__simplelists` SET `link_type`="custom" WHERE `link_type`="1"', 'UPDATE `#__simplelists` SET `link_type`="menuitem" WHERE `link_type`="2"', 'UPDATE `#__simplelists` SET `link_type`="article" WHERE `link_type`="3"', 'UPDATE `#__simplelists` SET `link_type`="image" WHERE `link_type`="4"', 'UPDATE `#__simplelists` SET `link_type`="file" WHERE `link_type`="5"', 'UPDATE `#__categories` SET `image`=CONCAT("images/simplelists/", image) WHERE `image` != "" AND `image` NOT LIKE "%images/simplelists%" AND `section`="com_simplelists"', 'ALTER TABLE `#__simplelists` ADD `alias` VARCHAR(255) NOT NULL AFTER `title`', 'ALTER TABLE `#__simplelists` ADD `access` INT( 11 ) NOT NULL AFTER `published`', 'RENAME TABLE  `#__simplelists` TO  `#__simplelists_items`', 'UPDATE #__menu SET link = REPLACE(link,"option=com_simplelists&view=simplelist","option=com_simplelists&view=items")', 'ALTER TABLE `#__simplelists_items` ADD `asset_id` INT( 11 ) NOT NULL AFTER  `id`', 'ALTER TABLE `#__simplelists_items` ADD `article_id` INT( 11 ) NOT NULL AFTER  `asset_id`', 'ALTER TABLE `#__simplelists_items` CHANGE `link_type` `link_type` VARCHAR(255) NOT NULL DEFAULT "0"', 'ALTER TABLE `#__simplelists_items` ADD `flags` VARCHAR(10) NOT NULL AFTER `picture`', 'DROP TABLE  `#__simplelists_plugins`');
    // Perform all queries - we don't care if it fails
    foreach ($update_queries as $query) {
        $db->debug(0);
        $db->setQuery($query);
        $db->query();
    }
}
开发者ID:renekreijveld,项目名称:SimpleLists,代码行数:25,代码来源:install.simplelists.php

示例11: getInput

 /**
  * Method to get the field input markup.
  */
 protected function getInput()
 {
     $version = new JVersion();
     $jversion = explode('.', $version->getShortVersion());
     $title = trim($this->element['title']);
     $image_src = $this->element['imagesrc'];
     $text = trim($this->element['text']);
     $link = $this->element['link'];
     $titleintext = false;
     if ($this->element['titleintext']) {
         $titleintext = $this->element['titleintext'] === 'true';
     }
     if (intval($jversion[0]) > 2 || $image_src && intval($jversion[0]) < 3) {
         $html = '<div style="padding-top: 5px; overflow: inherit">';
     } else {
         $html = '<div>';
     }
     if ($titleintext) {
         $html .= '<strong>' . JText::_($title) . '</strong>: ';
     }
     if ($text) {
         $html .= JText::sprintf($text, $link);
     }
     if (intval($jversion[0]) > 2) {
         // J3+
     } else {
         $html .= '</div>';
     }
     $html .= '</div>';
     return $html;
 }
开发者ID:esorone,项目名称:efcpw,代码行数:34,代码来源:imagelink.php

示例12: getInput

 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     $html = '';
     $minversion = $this->element['minversion'];
     $downloadlink = $this->element['downloadlink'];
     $version = new JVersion();
     $jversion = explode('.', $version->getShortVersion());
     $class = '';
     $style = '';
     if (intval($jversion[0]) > 2) {
         $class = 'alert alert-warning';
     } else {
         $style = 'margin: 5px 0; padding: 8px 35px 8px 14px; border-radius: 4px; border: 1px solid #FBEED5; background-color: #FCF8E3; color: #C09853;';
     }
     if (!JFolder::exists(JPATH_ROOT . '/libraries/syw')) {
         $html .= '<div class="' . $class . '" style="' . $style . '">';
         $html .= '    <span>' . JText::_('SYW_MISSING_SYWLIBRARY') . '</span><br />';
         $html .= '    <a href="' . $downloadlink . '" target="_blank">' . JText::_('SYW_DOWNLOAD_SYWLIBRARY') . '</a>';
         $html .= '</div>';
     } else {
         jimport('syw.version');
         if (!SYWVersion::isCompatible($minversion)) {
             $html .= '<div class="' . $class . '" style="' . $style . '">';
             $html .= '    <span>' . JText::_('SYW_NONCOMPATIBLE_SYWLIBRARY') . '</span><br />';
             $html .= '    <span>' . JText::_('SYW_UPDATE_SYWLIBRARY') . JText::_('SYW_OR') . '</span>';
             $html .= '    <a href="' . $downloadlink . '" target="_blank">' . strtolower(JText::_('SYW_DOWNLOAD_SYWLIBRARY')) . '</a>';
             $html .= '</div>';
         }
     }
     return $html;
 }
开发者ID:esorone,项目名称:efcpw,代码行数:37,代码来源:sywlibtest.php

示例13: getLabel

 /**
  * Method to get the field label markup for a spacer.
  * Use the label text or name from the XML element as the spacer or
  * Use a hr="true" to automatically generate plain hr markup
  *
  * @return  string  The field label markup.
  *
  * @since   11.1
  */
 protected function getLabel()
 {
     $document = JFactory::getDocument();
     $version = new JVersion();
     if (version_compare($version->getShortVersion(), '3.0.0', '<')) {
         $document->addStylesheet(JURI::base(true) . '/components/com_djclassifieds/assets/style.css');
     } else {
         $document->addStylesheet(JURI::base(true) . '/components/com_djclassifieds/assets/style.css');
     }
     $html = array();
     $class = $this->element['class'] ? (string) $this->element['class'] : '';
     $class .= ' djspacer';
     $html[] = '<span class="spacer">';
     $html[] = '<span class="before"></span>';
     $html[] = '<span class="' . $class . '">';
     $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' : '';
     // Add the opening label tag and main attributes attributes.
     $label .= '<label id="' . $this->id . '-lbl">' . $text;
     // If a description is specified, use it to build a tooltip.
     if (!empty($this->description)) {
         $label .= ' <div class="small">' . ($this->translateDescription ? JText::_($this->description) : $this->description) . '</div> ';
     }
     // Add the label text and closing tag.
     $label .= '</label>';
     $html[] = $label;
     $html[] = '</span>';
     $html[] = '<span class="after"></span>';
     $html[] = '</span>';
     return implode('', $html);
 }
开发者ID:andremarceloteixeira,项目名称:relaixamento.com-local,代码行数:44,代码来源:djspacer.php

示例14: checkAccess

 private function checkAccess()
 {
     if (JFactory::getUser()->get('guest')) {
         $msg = JText::_("SALE_PLEASE_LOGIN_BEFORE");
         $redirectUrl = base64_encode("index.php?option=com_enmasse&controller=saleReports&task=dealReport");
         $version = new JVersion();
         $joomla = $version->getShortVersion();
         if (substr($joomla, 0, 3) >= '1.6') {
             $link = JRoute::_("index.php?option=com_users&view=login&return=" . $redirectUrl, false);
         } else {
             $link = JRoute::_("index.php?option=com_user&view=login&return=" . $redirectUrl, false);
         }
         JFactory::getApplication()->redirect($link, $msg);
     }
     $salesPersonId = JFactory::getSession()->get('salesPersonId');
     if ($salesPersonId == null) {
         $salesPerson = JModel::getInstance('salesPerson', 'enmasseModel')->getByUserName(JFactory::getUser()->get('username'));
         if ($salesPerson != null) {
             JFactory::getSession()->set('salesPersonId', $salesPerson->id);
         } else {
             $msg = JText::_('SALE_NO_ACCESS');
             $link = JRoute::_("index.php?option=com_enmasse&controller=deal&task=listing", false);
             JFactory::getApplication()->redirect($link, $msg);
         }
     }
     return $salesPersonId;
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:27,代码来源:salereports.php

示例15: getInput

 /**
  * Method to get the field input markup
  */
 protected function getInput()
 {
     $lang = JFactory::getLanguage();
     $lang->load('lib_syw.sys', JPATH_SITE);
     $setting_to_test = trim($this->element['setting']);
     $version = new JVersion();
     $jversion = explode('.', $version->getShortVersion());
     $html = '';
     if (!ini_get($setting_to_test)) {
         if (intval($jversion[0]) > 2) {
             // Joomla! 3+
             $html .= '<div class="alert alert-error">';
         } else {
             $html .= '<div style="clear: both; margin: 5px 0; padding: 8px 35px 8px 14px; border-radius: 4px; border: 1px solid #EED3D7; background-color: #F2DEDE; color: #B94A48;">';
         }
         $html .= '<span>';
         $html .= JText::sprintf('LIB_SYW_PHPSETTING_DISABLED', $setting_to_test);
         $html .= '</span>';
         $html .= '</div>';
         return $html;
     } else {
         if (intval($jversion[0]) > 2) {
             // Joomla! 3+
             $html .= '<div class="alert alert-success">';
         } else {
             $html .= '<div style="clear: both; margin: 5px 0; padding: 8px 35px 8px 14px; border-radius: 4px; border: 1px solid #D6E9C6; background-color: #DFF0D8; color: #468847;">';
         }
         $html .= '<span>';
         $html .= JText::sprintf('LIB_SYW_PHPSETTING_ENABLED', $setting_to_test);
         $html .= '</span>';
         $html .= '</div>';
     }
     return $html;
 }
开发者ID:ashanrupasinghe,项目名称:slbcv1,代码行数:37,代码来源:phpsettingtest.php


注:本文中的JVersion::getShortVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。