Ejemplo n.º 1
0
 function __construct()
 {
     if (!$this->checkPermission()) {
         $this->data['nopermission'] = true;
     } else {
         $this->data['nopermission'] = false;
     }
     $this->loadView();
     //build data_port value
     $this->data['data_port'] = Qdmvc_Helper::getDataPortPath(static::getDataPort(), $this->getPageView());
     //pre value for page List
     $this->data['role'] = isset($_GET['qdrole']) ? $_GET['qdrole'] : '';
     //lookup, navigate
     $this->data['lookupid'] = isset($_GET['qdlookupid']) ? $_GET['qdlookupid'] : null;
     $this->data['returnid'] = isset($_GET['qdreturnid']) ? $_GET['qdreturnid'] : null;
     $this->data['getfield'] = isset($_GET['qdgetfield']) ? $_GET['qdgetfield'] : null;
     $this->data['view_style'] = 'normal';
     $this->data['language'] = Qdmvc_Config::getLanguage();
     $this->data['init_obj'] = $this->getInitObjJSON();
     if ($this->data['role'] == 'lookup' || $this->data['role'] == 'navigate') {
         $this->data['view_style'] = 'compact';
         //compact, full
     }
     static::initFields();
 }
Ejemplo n.º 2
0
 public static function getMsg($key)
 {
     if (Qdmvc_Config::getLanguage() == 'vi-VN') {
         return isset(static::$msg[$key]) ? static::$msg[$key] : '@' . $key;
     } else {
         return isset(static::$msg2[$key]) ? static::$msg2[$key] : '@' . $key;
     }
 }
 public function nav_menu_link_4()
 {
     $re = array();
     $options = QdProductCat::getFieldOptions('type3', Qdmvc_Config::getLanguage());
     array_push($re, array('title' => $options[QdProductCat::$TYPE3_DCN], 'url' => get_site_url(null, 'do-cong-nghe.html'), 'id' => QdProductCat::$TYPE3_DCN));
     array_push($re, array('title' => $options[QdProductCat::$TYPE3_XE], 'url' => get_site_url(null, 'xe.html'), 'id' => QdProductCat::$TYPE3_XE));
     $this->genItemsNav(4, $re);
 }
 public function qd_register_custom_menu_page()
 {
     //main page
     add_menu_page('QD PLUGIN', 'QD PLUGIN', 'qdmvc_admin', 'main', array($this, 'add_page_main'));
     //sub pages
     //Auto add sub Page based on Index tree
     //return;
     foreach (Qdmvc_Page_Index::getIndex() as $p_name => $config) {
         add_submenu_page('main', $config['Caption'][Qdmvc_Config::getLanguage()], $config['Caption'][Qdmvc_Config::getLanguage()], 'qdmvc_admin', $p_name, array($this, "{$p_name}"));
     }
 }
Ejemplo n.º 5
0
 private function checkMandatory()
 {
     $cf = static::getFieldsConfig();
     $re = true;
     foreach ($cf as $key => $config) {
         if (Qdmvc_Helper::isNullOrEmpty($this->{$key})) {
             if (static::ISMANDATORY($key)) {
                 $this->pushValidateError($key, sprintf(Qdmvc_Message::getMsg('msg_field_mandatory'), $this->id, static::getFieldCaption($key, Qdmvc_Config::getLanguage())), 'error');
                 $re = false;
             }
         }
     }
     return $re;
 }