簡介:Zurmo的不少功能都是經過配置的形式來完成,有php
全局配置的一些功能體如今,頂部的導航行,最左邊的導航行等等,這些都是公共的部分。此外還有一些其餘的功能,這裏就不一一列舉了。模塊獨立的配置是針對模塊內部的配置,每一個模塊的樣式,功能均可以根據配置的參數來改變。接下來介紹全局的配置
。數據庫
二:Zurmo
讀取數據順序數組
1:系統安裝時候的順序:緩存
讀取代碼配置 --> 存入數據庫 --> 緩存
2:之後系統運行的時候順序:app
緩存 --> 數據庫 --> 代碼配置
詳解第一點:url
Zurmo
安裝的時候,會從一些代碼配置文件讀取配置,好比 zurmo/app/protected/modules/zurmo/ZurmoModule.php
文件,代碼以下。spa
public static function getDefaultMetadata() { $metadata = array(); $metadata['global'] = array( 'configureMenuItems' => array( array( 'category' => ZurmoModule::ADMINISTRATION_CATEGORY_GENERAL, 'titleLabel' => "eval:Zurmo::t('ZurmoModule', 'Global Configuration')", 'descriptionLabel' => "eval:Zurmo::t('ZurmoModule', 'Manage Global Configuration')", 'route' => '/zurmo/default/configurationEdit', 'right' => self::RIGHT_ACCESS_GLOBAL_CONFIGURATION, ), array( 'category' => ZurmoModule::ADMINISTRATION_CATEGORY_GENERAL, 'titleLabel' => "eval:Zurmo::t('ZurmoModule', 'Currency Configuration')", 'descriptionLabel' => "eval:Zurmo::t('ZurmoModule', 'Manage Currency Configuration')", 'route' => '/zurmo/currency/configurationList', 'right' => self::RIGHT_ACCESS_CURRENCY_CONFIGURATION, ), array( 'category' => ZurmoModule::ADMINISTRATION_CATEGORY_GENERAL, 'titleLabel' => "eval:Zurmo::t('Core', 'Languages')", 'descriptionLabel' => "eval:Zurmo::t('ZurmoModule', 'Manage Active Languages')", 'route' => '/zurmo/language/configurationList', 'right' => self::RIGHT_ACCESS_GLOBAL_CONFIGURATION, ), array( 'category' => ZurmoModule::ADMINISTRATION_CATEGORY_GENERAL, 'titleLabel' => "eval:Zurmo::t('ZurmoModule', 'Developer Tools')", 'descriptionLabel' => "eval:Zurmo::t('ZurmoModule', 'Access Developer Tools')", 'route' => '/zurmo/development/', 'right' => self::RIGHT_ACCESS_GLOBAL_CONFIGURATION, ), array( 'category' => ZurmoModule::ADMINISTRATION_CATEGORY_GENERAL, 'titleLabel' => "eval:Zurmo::t('ZurmoModule', 'Authentication Configuration')", 'descriptionLabel' => "eval:Zurmo::t('ZurmoModule', 'Manage Authentication Configuration')", 'route' => '/zurmo/authentication/configurationEdit', 'right' => self::RIGHT_ACCESS_GLOBAL_CONFIGURATION, ), array( 'category' => ZurmoModule::ADMINISTRATION_CATEGORY_GENERAL, 'titleLabel' => "eval:Zurmo::t('ZurmoModule', 'Plugins')", 'descriptionLabel' => "eval:Zurmo::t('ZurmoModule', 'Manage Plugins and Integrations')", 'route' => '/zurmo/plugins/configurationEdit', 'right' => self::RIGHT_ACCESS_GLOBAL_CONFIGURATION, ), array( 'category' => ZurmoModule::ADMINISTRATION_CATEGORY_GENERAL, 'titleLabel' => "eval:Zurmo::t('ZurmoModule', 'User Interface Configuration')", 'descriptionLabel' => "eval:Zurmo::t('ZurmoModule', 'Manage User Interface Configuration')", 'route' => '/zurmo/default/userInterfaceConfigurationEdit', 'right' => self::RIGHT_ACCESS_GLOBAL_CONFIGURATION, ), array( 'category' => ZurmoModule::ADMINISTRATION_CATEGORY_GENERAL, 'titleLabel' => "eval:Zurmo::t('ZurmoModule', 'System Configuration')", 'descriptionLabel' => "eval:Zurmo::t('ZurmoModule', 'Manage System Configuration')", 'route' => '/zurmo/default/systemConfigurationEdit', 'right' => self::RIGHT_ACCESS_GLOBAL_CONFIGURATION, ), ), 'headerMenuItems' => array( array( 'label' => "eval:Zurmo::t('ZurmoModule', 'Administration')", 'url' => array('/configuration'), 'right' => self::RIGHT_ACCESS_ADMINISTRATION, 'order' => 1, 'mobile' => false, ), array( 'label' => "eval:Zurmo::t('ZurmoModule', 'Get More')", 'url' => 'eval:ZurmoModule::resolveGetMoreUrl()', 'order' => 9, 'mobile' => true, ), array( 'label' => "eval:Zurmo::t('ZurmoModule', 'About Zurmo')", 'url' => array('/zurmo/default/about'), 'order' => 10, 'mobile' => true, ), ), 'configureSubMenuItems' => array( array( 'category' => self::ADMINISTRATION_CATEGORY_AUTHENTICATION, 'titleLabel' => "eval:Zurmo::t('ZurmoModule', 'LDAP Configuration')", 'descriptionLabel' => "eval:Zurmo::t('ZurmoModule', 'Manage LDAP Authentication')", 'route' => '/zurmo/ldap/configurationEditLdap', 'right' => self::RIGHT_ACCESS_GLOBAL_CONFIGURATION, ), ), 'adminTabMenuItemsModuleOrdering' => array( 'home', 'configuration', 'designer', 'import', 'groups', 'users', 'roles', 'workflows', 'contactWebForms' ), 'tabMenuItemsModuleOrdering' => array( 'home', 'mashableInbox', 'accounts', 'leads', 'contacts', 'opportunities', 'marketing', 'projects', 'products', 'reports', ) ); return $metadata; }
以後會把這些配置信息存入到數據庫的一個名叫 globalmetadata
的表。配置以序列化的形式存入 serializedmetadata
字段中,咱們能夠選取 一條 classname
的值爲 ZurmoModule
的序列化值解序列出來看看。就能夠發現ZurmoModule
的配置是其中的一部分,還有一部分是從其餘地方讀取。以後會存入緩存
中。.net
PS:有時候可能會出現你改了這裏的配置,可是頁面卻沒有改變。code
Update Custom Data
操做,這個操做的本質就是把配置存入globalmetadata
表中。以後再刷新頁面,頁面就發生改變了。上面的註解就是第二點的之後系統運行的時候讀取數據的順序了。orm
三:清除緩存 和 Update Custom Data
的操做
具體步驟看我在CSDN的文章,這兩點的重要性我也在博客寫了。不少時候的操做與這兩步密切相關。
四:getDefaultMetadata()
方法 metadata['global']
數組中的部分配置參數:
configureMenuItems
headerMenuItems
configureSubMenuItems
adminTabMenuItemsModuleOrdering
tabMenuItemsModuleOrdering
headerMenuItems
參數對應的頁面上:
adminTabMenuItemsModuleOrdering
參數對應的頁面上:
tabMenuItemsModuleOrdering
參數對應的頁面上:
還有部分的參數的位置遲點再補上。
若有不對,請指正!