當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CATSUtility::getVersionAsInteger方法代碼示例

本文整理匯總了PHP中CATSUtility::getVersionAsInteger方法的典型用法代碼示例。如果您正苦於以下問題:PHP CATSUtility::getVersionAsInteger方法的具體用法?PHP CATSUtility::getVersionAsInteger怎麽用?PHP CATSUtility::getVersionAsInteger使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CATSUtility的用法示例。


在下文中一共展示了CATSUtility::getVersionAsInteger方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getNews

 /**
  * Returns news for the dashboard (if a new version is available).
  *
  * @return html
  */
 public static function getNews()
 {
     $systemInfoDb = new SystemInfo();
     $systemInfo = $systemInfoDb->getSystemInfo();
     /* Update daily. */
     $lastWeeksDate = time() - SECONDS_IN_A_DAY;
     $lastCheck = strtotime($systemInfo['date_version_checked']);
     if ($lastWeeksDate > $lastCheck) {
         self::checkForUpdate();
         /* Refresh the new information. */
         $systemInfo = $systemInfoDb->getSystemInfo();
     }
     /* Only display new version news if a new version is available. */
     if ($systemInfo['available_version'] > CATSUtility::getVersionAsInteger()) {
         return urldecode($systemInfo['available_version_description']);
     }
     return '';
 }
開發者ID:PublicityPort,項目名稱:OpenCATS,代碼行數:23,代碼來源:NewVersionCheck.php

示例2: _printCommonHeader

 /**
  * Prints template header HTML.
  *
  * @param string page title
  * @param array JavaScript / CSS files to load
  * @return void
  */
 private static function _printCommonHeader($pageTitle, $headIncludes = array())
 {
     if (!is_array($headIncludes)) {
         $headIncludes = array($headIncludes);
     }
     $siteID = $_SESSION['CATS']->getSiteID();
     /* This prevents caching problems when SVN updates are preformed. */
     if ($_SESSION['CATS']->getCachedBuild() > 0) {
         $javascriptAntiCache = '?b=' . $_SESSION['CATS']->getCachedBuild();
     } else {
         $javascriptAntiCache = '?v=' . CATSUtility::getVersionAsInteger();
     }
     echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"', "\n";
     echo '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', "\n";
     echo '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">', "\n";
     echo '<head>', "\n";
     echo '<title>CATS - ', $pageTitle, '</title>', "\n";
     echo '<meta http-equiv="Content-Type" content="text/html; charset=', HTML_ENCODING, '" />', "\n";
     echo '<link rel="icon" href="images/favicon.ico" type="image/x-icon" />', "\n";
     echo '<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />', "\n";
     echo '<link rel="alternate" type="application/rss+xml" title="RSS" href="', CATSUtility::getIndexName(), '?m=rss" />', "\n";
     /* Core JS files */
     echo '<script type="text/javascript" src="js/lib.js' . $javascriptAntiCache . '"></script>', "\n";
     echo '<script type="text/javascript" src="js/quickAction.js' . $javascriptAntiCache . '"></script>', "\n";
     echo '<script type="text/javascript" src="js/calendarDateInput.js' . $javascriptAntiCache . '"></script>', "\n";
     echo '<script type="text/javascript" src="js/submodal/subModal.js' . $javascriptAntiCache . '"></script>', "\n";
     echo '<script type="text/javascript" src="js/jquery-1.3.2.min.js' . $javascriptAntiCache . '"></script>', "\n";
     echo '<script type="text/javascript">CATSIndexName = "' . CATSUtility::getIndexName() . '";</script>', "\n";
     $headIncludes[] = 'main.css';
     foreach ($headIncludes as $key => $filename) {
         /* Done manually to prevent a global dependency on FileUtility. */
         if ($filename == 'tinymce') {
             echo '<script language="javascript" type="text/javascript" src="lib/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>' . "\n" . '<script language="javascript" type="text/javascript">tinyMCE.init({
                         mode : "specific_textareas",
                         editor_selector : "mceEditor",
                         width : "100%",
                     	theme : "advanced",
                     	theme_advanced_buttons1 : "bold,italic,strikethrough,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,link,unlink,separator,underline,forecolor,separator,removeformat,cleanup,separator,charmap,separator,undo,redo",
                     	theme_advanced_buttons2 : "",
                     	theme_advanced_buttons3 : "",
                     	language : "en",
                     	theme_advanced_toolbar_location : "top",
                     	theme_advanced_toolbar_align : "left",
                     	theme_advanced_resizing : true,
                     	browsers : "msie,gecko,opera,safari",
                     	dialog_type : "modal",
                     	theme_advanced_resize_horizontal : false,
                     	convert_urls : false,
                     	relative_urls : false,
                     	remove_script_host : false,
                     	force_p_newlines : false,
                     	force_br_newlines : true,
                     	convert_newlines_to_brs : false,
                     	remove_linebreaks : false,
                     	fix_list_elements : true
                     });</script>' . "\n";
         } else {
             $extension = substr($filename, strrpos($filename, '.') + 1);
             $filename .= $javascriptAntiCache;
             if ($extension == 'js') {
                 echo '<script type="text/javascript" src="', $filename, '"></script>', "\n";
             } else {
                 if ($extension == 'css') {
                     echo '<style type="text/css" media="all">@import "', $filename, '";</style>', "\n";
                 }
             }
         }
     }
     echo '<!--[if IE]><link rel="stylesheet" type="text/css" href="ie.css" /><![endif]-->', "\n";
     echo '<![if !IE]><link rel="stylesheet" type="text/css" href="not-ie.css" /><![endif]>', "\n";
     echo '</head>', "\n\n";
 }
開發者ID:rankinp,項目名稱:OpenCATS,代碼行數:79,代碼來源:TemplateUtility.php

示例3: administration

 private function administration()
 {
     /* Bail out if the user doesn't have SA permissions. */
     if ($this->_realAccessLevel < ACCESS_LEVEL_DEMO && !$_SESSION['CATS']->hasUserCategory('careerportal')) {
         CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
     }
     $systemInfo = new SystemInfo();
     $systemInfoData = $systemInfo->getSystemInfo();
     if (isset($systemInfoData['available_version']) && $systemInfoData['available_version'] > CATSUtility::getVersionAsInteger()) {
         $newVersion = true;
     } else {
         $newVersion = false;
     }
     if (isset($systemInfoData['disable_version_check']) && $systemInfoData['disable_version_check']) {
         $versionCheckPref = false;
     } else {
         $versionCheckPref = true;
     }
     if ($this->_realAccessLevel >= ACCESS_LEVEL_ROOT || $this->_realAccessLevel == ACCESS_LEVEL_DEMO) {
         $systemAdministration = true;
     } else {
         $systemAdministration = false;
     }
     // FIXME: 's' isn't a good variable name.
     if (isset($_GET['s'])) {
         switch ($_GET['s']) {
             case 'siteName':
                 $templateFile = './modules/settings/SiteName.tpl';
                 break;
             case 'newVersionCheck':
                 if (!$systemAdministration) {
                     CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
                     return;
                     //$this->fatal(ERROR_NO_PERMISSION);
                 }
                 $this->_template->assign('versionCheckPref', $versionCheckPref);
                 $this->_template->assign('availableVersion', $systemInfoData['available_version']);
                 $this->_template->assign('newVersion', $newVersion);
                 $this->_template->assign('newVersionNews', NewVersionCheck::getNews());
                 $templateFile = './modules/settings/NewVersionCheck.tpl';
                 break;
             case 'passwords':
                 if (!$systemAdministration) {
                     CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
                     return;
                     //$this->fatal(ERROR_NO_PERMISSION);
                 }
                 $templateFile = './modules/settings/Passwords.tpl';
                 break;
             case 'localization':
                 if ($this->_realAccessLevel < ACCESS_LEVEL_SA) {
                     CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
                     return;
                     //$this->fatal(ERROR_NO_PERMISSION);
                 }
                 $this->_template->assign('timeZone', $_SESSION['CATS']->getTimeZone());
                 $this->_template->assign('isDateDMY', $_SESSION['CATS']->isDateDMY());
                 $templateFile = './modules/settings/Localization.tpl';
                 break;
             case 'systemInformation':
                 if ($this->_realAccessLevel < ACCESS_LEVEL_SA) {
                     CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
                     return;
                     //$this->fatal(ERROR_NO_PERMISSION);
                 }
                 $db = DatabaseConnection::getInstance();
                 $databaseVersion = $db->getRDBMSVersion();
                 $installationDirectory = realpath('./');
                 if (SystemUtility::isWindows()) {
                     $OSType = 'Windows';
                 } else {
                     if (SystemUtility::isMacOSX()) {
                         $OSType = 'Mac OS X';
                     } else {
                         $OSType = 'UNIX';
                     }
                 }
                 $schemaVersions = ModuleUtility::getModuleSchemaVersions();
                 $this->_template->assign('databaseVersion', $databaseVersion);
                 $this->_template->assign('installationDirectory', $installationDirectory);
                 $this->_template->assign('OSType', $OSType);
                 $this->_template->assign('schemaVersions', $schemaVersions);
                 $templateFile = './modules/settings/SystemInformation.tpl';
                 break;
             default:
                 $templateFile = './modules/settings/Administration.tpl';
                 break;
         }
     } else {
         $templateFile = './modules/settings/Administration.tpl';
         /* Load extra settings. */
         $extraSettings = array();
         $modules = ModuleUtility::getModules();
         foreach ($modules as $moduleName => $parameters) {
             $extraSettingsModule = $parameters[MODULE_SETTINGS_ENTRIES];
             if ($extraSettingsModule != false) {
                 foreach ($extraSettingsModule as $extraSettingsModuleData) {
                     if ($extraSettingsModuleData[2] <= $this->_realAccessLevel) {
                         $extraSettings[] = $extraSettingsModuleData;
                     }
//.........這裏部分代碼省略.........
開發者ID:rankinp,項目名稱:OpenCATS,代碼行數:101,代碼來源:SettingsUI.php

示例4: loadTheme


//.........這裏部分代碼省略.........
                       /* EEO Report subtab.  Shouldn't be visible if EEO tracking is disabled. */
                       $EEOSettings = new EEOSettings($_SESSION['CATS']->getSiteID());
                       $EEOSettingsRS = $EEOSettings->getAll();

                       if ($EEOSettingsRS['enabled'] == 1)
                       {
                           echo '<li><a href="', $link, '" style="'.$style.'">', $subTabText, '</a></li>', "\n";
                       }
                   }


                   /* Tab is ok to draw. */
                   else if ($link != '')
                   {
                       /* Normal subtab. */
                       echo '<li><a href="', $link, '" style="'.$style.'">', $subTabText, '</a></li>', "\n";
                   }
               }

               if (!eval(Hooks::get('TEMPLATE_UTILITY_DRAW_SUBTABS'))) return;

               echo '</ul>';
           }

           echo '</li>';
        }

        $_AUIEO_TABS=  ob_get_clean();

        $systemInfo = new SystemInfo();
        $systemInfoData = $systemInfo->getSystemInfo();
        $AUIEO_DOWNLOAD_LATEST="";
        if (isset($systemInfoData['available_version']) &&
            $systemInfoData['available_version'] > CATSUtility::getVersionAsInteger() &&
            isset($systemInfoData['disable_version_check']) &&
            !$systemInfoData['disable_version_check'] &&
            $_SESSION['CATS']->getAccessLevel() >= ACCESS_LEVEL_SA)
        {
            $AUIEO_DOWNLOAD_LATEST = "<a href='http://www.catsone.com/download.php' target='catsdl'>A new CATS version is available!</a><br />";
        }
        $AUIEO_RECENT="";
        if (!empty($MRU))
        {
            $AUIEO_RECENT = '<span class="MRUTitle">Recent:&nbsp;</span>&nbsp;{$MRU}';
        }
        else
        {
            $AUIEO_RECENT = '<span class="MRUTitle"></span>&nbsp;';
        }
        $AUIEO_HAS_USER_CATEGORY="";
        //FIXME:  Abstract into a hook.
        if ($_SESSION['CATS']->hasUserCategory('msa'))
        {
            $AUIEO_HAS_USER_CATEGORY = "<input type='hidden' name='m' value='asp' />
                <input type='hidden' name='a' value='aspSearch' />
                <span class='quickSearchLabel' id='quickSearchLabel>ASP Search:</span>&nbsp;";
        }
        else
        {
            $AUIEO_HAS_USER_CATEGORY = "<input type='hidden' name='m' value='home' />
                <input type='hidden' name='a' value='quickSearch' />
                <span class='quickSearchLabel' id='quickSearchLabel'>Quick Search:</span>&nbsp;";
        }


        $wildCardString = '';
開發者ID:Hassanj343,項目名稱:candidats,代碼行數:67,代碼來源:Template.php


注:本文中的CATSUtility::getVersionAsInteger方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。