'Name', 'description' => 'Description'); var $nameFields = array('name'); var $name = 'Vtiger'; public function getName($includeParentIfExists = false) { if($includeParentIfExists) { return $this->getParentName() .':'. $this->name; } return $this->name; } public function getParentName() { return 'Settings'; } public function getBaseTable() { return $this->baseTable; } public function getBaseIndex() { return $this->baseIndex; } public function setListFields($fieldNames) { $this->listFields = $fieldNames; return $this; } public function getListFields() { if(!$this->listFieldModels) { $fields = $this->listFields; $fieldObjects = array(); foreach($fields as $fieldName => $fieldLabel) { $fieldObjects[$fieldName] = new Vtiger_Base_Model(array('name' => $fieldName, 'label' => $fieldLabel)); } $this->listFieldModels = $fieldObjects; } return $this->listFieldModels; } /** * Function to get name fields of this module * @return list field names */ public function getNameFields() { return $this->nameFields; } /** * Function to get field using field name * @param $fieldName * @return */ public function getField($fieldName) { return new Vtiger_Base_Model(array('name' => $fieldName, 'label' => $fieldName)); } public function hasCreatePermissions() { return true; } /** * Function to get all the Settings menus * @return - List of Settings_Vtiger_Menu_Model instances */ public function getMenus() { return Settings_Vtiger_Menu_Model::getAll(); } /** * Function to get all the Settings menu items for the given menu * @return - List of Settings_Vtiger_MenuItem_Model instances */ public function getMenuItems($menu=false) { $menuModel = false; if($menu) { $menuModel = Settings_Vtiger_Menu_Model::getInstance($menu); } return Settings_Vtiger_MenuItem_Model::getAll($menuModel); } public function isPagingSupported(){ return true; } /** * Function to get the instance of Settings module model * @return Settings_Vtiger_Module_Model instance */ public static function getInstance($name='Settings:Vtiger') { $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'Module', $name); return new $modelClassName(); } /** * Function to get Index view Url * @return URL */ public function getIndexViewUrl() { return 'index.php?module='.$this->getName().'&parent='.$this->getParentName().'&view=Index'; } }