コード例 #1
0
ファイル: Html.php プロジェクト: houzhenggang/cobalt
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     $app = \Cobalt\Container::fetch('app');
     $document = $app->getDocument();
     $document->addScript(JURI::base() . 'src/Cobalt/media/js/cobalt-admin.js');
     /** Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     $configModel = new ConfigModel();
     /** Component version **/
     $installedVersion = ConfigHelper::getVersion();
     $latestVersion = VersionHelper::getLatestVersion();
     $updateUrl = "http://www.cobaltcrm.org/support/login";
     $updatesFeed = $configModel->getUpdatesRSS();
     /** Launch completion **/
     $config = $configModel->getConfig();
     $this->launch_default = $config->launch_default;
     $percentage = $menu['percentage'];
     $this->setup_percent = $percentage;
     /** php version check **/
     $this->php_version = (double) phpversion();
     $this->php_version_check = $this->php_version >= 5.3 ? TRUE : FALSE;
     /** View Ref **/
     $this->installedVersion = $installedVersion;
     $this->latestVersion = $latestVersion;
     $this->updateUrl = $updateUrl;
     $this->updatesFeed = $updatesFeed;
     //display
     return parent::render();
 }
コード例 #2
0
ファイル: Html.php プロジェクト: houzhenggang/cobalt
 public function render($tpl = null)
 {
     //authenticate the current user to make sure they are an admin
     UsersHelper::authenticateAdmin();
     //display toolbar
     $this->toolbar = new Toolbar();
     $this->toolbar->save();
     //document
     $document = JFactory::getDocument();
     $document->addScript(JURI::base() . "/src/Cobalt/media/js/cobalt-admin.js");
     /* Menu Links **/
     $menu = MenuHelper::getMenuModules();
     $this->menu = $menu;
     //get model
     $model = new ConfigModel();
     $layout = $this->getLayout();
     $model->set("_layout", $layout);
     //get config
     $config = $model->getConfig();
     //generate timezones
     $list = timezone_identifiers_list();
     $timezones = array();
     foreach ($list as $zone) {
         $timezones[$zone] = $zone;
     }
     //view references
     $this->imap_found = function_exists('imap_open') ? TRUE : FALSE;
     $this->config = $config;
     $this->timezones = $timezones;
     $this->time_formats = DateHelper::getTimeFormats();
     $this->languages = ConfigHelper::getLanguages();
     $this->language = ConfigHelper::getLanguage();
     //display
     return parent::render();
 }
コード例 #3
0
ファイル: ConfigHelper.php プロジェクト: houzhenggang/cobalt
 /**
  * Get the configuration value for the specified field. If the field was not found in the config, return null.
  *
  * @param  string  $field           The name of the field
  * @param  boolean $serializedArray True if the field is stored as an array
  * @return mixed   The value of the field in the #__jf_configuration table
  */
 public static function getConfigValue($field, $serializedArray = FALSE)
 {
     $configModel = new ConfigModel();
     $config = $configModel->getConfig(TRUE);
     if (is_array($config) && array_key_exists($field, $config)) {
         $value = $serializedArray == TRUE && $config[$field] != 0 && $config[$field] != "0" ? unserialize($config[$field]) : $config[$field];
     } else {
         $value = null;
     }
     return $value;
 }