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


PHP Tinebase_Config::getAppConfig方法代碼示例

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


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

示例1: get

 /**
  * get by id
  *
  * @param string $_id
  * @return Tinebase_Record_RecordSet
  * @throws  Tinebase_Exception_AccessDenied
  */
 public function get($_id)
 {
     $configRecord = $this->_configBackend->get($_id);
     $app = Tinebase_Application::getInstance()->getApplicationById($configRecord->application_id);
     if (!Tinebase_Core::getUser()->hasRight($app->name, 'admin')) {
         throw new Tinebase_Exception_AccessDenied("You do not have admin rights for {$app->name}");
     }
     $appConfigObject = Tinebase_Config::getAppConfig($app->name);
     $definition = $appConfigObject->getDefinition($configRecord->name);
     $this->_mergeDefinition($configRecord, $definition);
     $configRecord->source = Tinebase_Model_Config::SOURCE_DB;
     return $configRecord;
 }
開發者ID:hernot,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:20,代碼來源:Config.php

示例2: update_14

 /**
  * update to 8.15
  *
  * move keyFieldConfig defaults to config files
  */
 public function update_14()
 {
     // either put default to DB or delete form DB
     $cb = new Tinebase_Backend_Sql(array('modelName' => 'Tinebase_Model_Config', 'tableName' => 'config'));
     $configRecords = $cb->getAll();
     // iterate installed apps
     foreach (Tinebase_Application::getInstance()->getApplications() as $application) {
         try {
             // get config
             $config = Tinebase_Config::getAppConfig($application->name);
             if (!method_exists($config, 'getProperties')) {
                 continue;
             }
             foreach ($config->getProperties() as $name => $property) {
                 if ($property['type'] == Tinebase_Config_Abstract::TYPE_KEYFIELD_CONFIG) {
                     $dbConfig = $config->get($name);
                     $dbConfigRecords = $dbConfig['records']->toArray();
                     $defaultRecords = isset($property['default']['records']) ? $property['default']['records'] : null;
                     if ($defaultRecords && json_encode($dbConfigRecords) != json_encode($defaultRecords)) {
                         // set default value
                         if (array_key_exists('default', $property['default'])) {
                             $dbConfig->default = $property['default']['default'];
                             $config->set($name, $dbConfig->toArray());
                         }
                     } else {
                         // delete default config
                         $configRecord = $configRecords->filter('application_id', $application->getId())->filter('name', $name)->getFirstRecord();
                         if ($configRecord) {
                             $cb->delete($configRecord->getId());
                         }
                     }
                 }
             }
         } catch (Exception $e) {
             Setup_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ . ' could not migrate keyFieldConfig ' . $e);
         }
     }
     $this->setApplicationVersion('Tinebase', '8.15');
 }
開發者ID:hernot,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:44,代碼來源:Release8.php

示例3: saveConfigSettings

 /**
  * save settings
  * 
  * @param array $_settings
  * @return void
  */
 public function saveConfigSettings($_settings)
 {
     // only admins are allowed to do this
     $this->checkRight(Tinebase_Acl_Rights::ADMIN);
     $appConfig = Tinebase_Config::getAppConfig($this->_applicationName);
     if ($appConfig !== NULL) {
         $appConfig->set(Tinebase_Config::APPDEFAULTS, $_settings);
     }
 }
開發者ID:hernot,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:15,代碼來源:Abstract.php

示例4: _getResolvedKeyfield

 /**
  * return translated Keyfield string
  *
  * @param String $_property
  * @param String $_keyfield
  * @param String $_application
  * @return string
  */
 protected function _getResolvedKeyfield($_property, $_keyfield, $_application)
 {
     $i18nApplication = Tinebase_Translation::getTranslation($_application);
     $config = Tinebase_Config::getAppConfig($_application);
     $result = $config->get($_keyfield)->records->getById($_property);
     return isset($result->value) ? $i18nApplication->translate($result->value) : $_property;
 }
開發者ID:hernot,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:15,代碼來源:Abstract.php


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