当前位置: 首页>>代码示例>>PHP>>正文


PHP FieldList::getAllFields方法代码示例

本文整理汇总了PHP中FieldList::getAllFields方法的典型用法代码示例。如果您正苦于以下问题:PHP FieldList::getAllFields方法的具体用法?PHP FieldList::getAllFields怎么用?PHP FieldList::getAllFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FieldList的用法示例。


在下文中一共展示了FieldList::getAllFields方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getPageWithElement

 /**
  * @return 	string 	contains the displayable information for a selected group
  *
  * @access 	public
  */
 function getPageWithElement($regroup)
 {
     require_once _base_ . '/lib/lib.form.php';
     if ($regroup == 'templ_man') {
         return $this->_maskTemplateManager();
     } elseif ($regroup == 'suiteman') {
         return $this->_maskSuiteManager();
     }
     $lang =& DoceboLanguage::createInstance('configuration', 'framework');
     $reSetting = sql_query("\r\n\t\tSELECT param_name, param_value, value_type, max_size\r\n\t\tFROM " . $this->table . "\r\n\t\tWHERE regroup = '" . $regroup . "' AND\r\n\t\t\thide_in_modify = '0'\r\n\t\tORDER BY regroup, pack, sequence");
     $html = '';
     while (list($var_name, $var_value, $value_type, $max_size) = sql_fetch_row($reSetting)) {
         $i_after = ' <span class="ico-tooltip" id="tt_target_' . $var_name . '" title="' . $lang->def('_CONF_DESCR_' . strtoupper($var_name)) . '">info</span>';
         switch ($value_type) {
             case "register_type":
                 //on off
                 $html .= Form::getOpenCombo($lang->def('_' . strtoupper($var_name))) . Form::getLineRadio('', 'label_bold', $lang->def('_REGISTER_TYPE_SELF'), $var_name . '_self', 'option[' . $var_name . ']', 'self', $var_value == 'self') . Form::getLineRadio('', 'label_bold', $lang->def('_REGISTER_TYPE_SELF_OPTIN'), $var_name . '_self_optin', 'option[' . $var_name . ']', 'self_optin', $var_value == 'self_optin') . Form::getLineRadio('', 'label_bold', $lang->def('_REGISTER_TYPE_MODERATE'), $var_name . '_moderate', 'option[' . $var_name . ']', 'moderate', $var_value == 'moderate') . Form::getLineRadio('', 'label_bold', $lang->def('_REGISTER_TYPE_ADMIN'), $var_name . '_admin', 'option[' . $var_name . ']', 'admin', $var_value == 'admin') . Form::getCloseCombo($i_after);
                 break;
             case "register_tree":
                 $register_possible_option = array('off' => $lang->def('_DONT_USE_TREE_REGISTRATION'), 'manual_insert' => $lang->def('_USE_WITH_MANUALEINSERT'), 'selection' => $lang->def('_USE_WITH_SELECTION'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $register_possible_option, $var_value, $i_after);
                 break;
             case "field_tree":
                 require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
                 $fl = new FieldList();
                 $all_fields = $fl->getAllFields(false);
                 $fields[0] = $lang->def('_NO_VALUE');
                 foreach ($all_fields as $key => $val) {
                     $fields[$val[FIELD_INFO_ID]] = $val[FIELD_INFO_TRANSLATION];
                 }
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $fields, $var_value, $i_after);
                 break;
             case "save_log_attempt":
                 //on off
                 $html .= Form::getOpenCombo($lang->def('_' . strtoupper($var_name))) . Form::getLineRadio('', 'label_bold', $lang->def('_SAVE_LA_ALL'), $var_name . '_all', 'option[' . $var_name . ']', 'all', $var_value == 'all') . Form::getLineRadio('', 'label_bold', $lang->def('_SAVE_LA_AFTER_MAX'), $var_name . '_after_max', 'option[' . $var_name . ']', 'after_max', $var_value == 'after_max') . Form::getLineRadio('', 'label_bold', $lang->def('_NO'), $var_name . '_no', 'option[' . $var_name . ']', 'no', $var_value == 'no') . Form::getCloseCombo($i_after);
                 break;
             case "language":
                 //drop down language
                 $langs = Docebo::langManager()->getAllLangCode();
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $langs, array_search($var_value, $langs), $i_after);
                 break;
             case "template":
                 //drop down template
                 $templ = getTemplateList();
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $templ, array_search($var_value, $templ), $i_after);
                 break;
             case "hteditor":
                 //drop down hteditor
                 $ht_edit = getHTMLEditorList();
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $ht_edit, $var_value, $i_after);
                 break;
             case "layout_chooser":
                 //drop down hteditor
                 $layout = array('left' => Lang::t('_LAYOUT_LEFT'), 'over' => Lang::t('_LAYOUT_OVER'), 'right' => Lang::t('_LAYOUT_RIGHT'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $layout, $var_value, $i_after);
                 break;
             case "pubflow_method_chooser":
                 //drop down hteditor
                 $options = array('onestate' => Lang::t('_PUBFLOW_ONESTATE'), 'twostate' => Lang::t('_PUBFLOW_TWOSTATE'), 'advanced' => Lang::t('_PUBFLOW_ADVANCED'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $options, $var_value, $i_after);
                 break;
             case "field_select":
                 require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
                 $fl = new FieldList();
                 $all_fields = $fl->getAllFields();
                 $fields = array();
                 foreach ($all_fields as $key => $val) {
                     $fields[$val[FIELD_INFO_ID]] = $val[FIELD_INFO_TRANSLATION];
                 }
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $fields, $var_value, $i_after);
                 break;
             case "sel_sms_gateway":
                 $options = array('0' => Lang::t('_SMS_GATEWAY_AUTO'), '1' => Lang::t('_SMS_GATEWAY_1'), '2' => Lang::t('_SMS_GATEWAY_2'), '3' => Lang::t('_SMS_GATEWAY_3'), '4' => Lang::t('_SMS_GATEWAY_4'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $options, $var_value, $i_after);
                 break;
             case "menuvoice":
             case "menuvoice_course_public":
             case "layout_chooser":
                 //drop down hteditor
                 $layout = array('left' => Lang::t('_LAYOUT_LEFT'), 'over' => Lang::t('_LAYOUT_OVER'), 'right' => Lang::t('_LAYOUT_RIGHT'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $layout, $var_value, $i_after);
                 break;
             case "grpsel_chooser":
                 $layout = array('group' => $lang->def('_GROUPS'), 'orgchart' => $lang->def('_ORGCHART'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $layout, $var_value, $i_after);
                 break;
             case "tablist_coursecatalogue":
                 $lang_c =& DoceboLanguage::createInstance('catalogue', 'lms');
                 $tab_selected = unserialize(urldecode($var_value));
                 $tab_list = array('time' => $lang_c->def('_TAB_VIEW_TIME'), 'category' => $lang_c->def('_TAB_VIEW_CATEGORY'), 'all' => $lang_c->def('_ALL'));
                 if (Get::sett('use_coursepath') == '1') {
                     $tab_list['pathcourse'] = $lang_c->def('_COURSEPATH');
                 }
                 if (Get::sett('use_social_courselist') == 'on') {
                     $tab_list['mostscore'] = $lang_c->def('_TAB_VIEW_MOSTSCORE');
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:class.conf.php

示例2: getPageWithElement

 /**
  * @return 	string 	contains the displayable information for a selected group
  *
  * @access 	public
  */
 function getPageWithElement($regroup)
 {
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('configuration', 'lms');
     $reSetting = sql_query("\r\n\t\tSELECT param_name, param_value, value_type, max_size \r\n\t\tFROM " . $this->table . " \r\n\t\tWHERE regroup = '" . $regroup . "' AND \r\n\t\t\thide_in_modify = '0'\r\n\t\tORDER BY sequence");
     $html = '';
     while (list($var_name, $var_value, $value_type, $max_size) = sql_fetch_row($reSetting)) {
         switch ($value_type) {
             case "point_field":
                 require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
                 $fl = new FieldList();
                 $all_fields = $fl->getAllFields();
                 $fields[0] = $lang->def('_NO_VALUE');
                 foreach ($all_fields as $key => $val) {
                     $fields[$val[FIELD_INFO_ID]] = $val[FIELD_INFO_TRANSLATION];
                 }
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $fields, $var_value);
                 break;
             case "language":
                 //drop down language
                 $langs = Docebo::langManager()->getAllLangCode();
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $langs, array_search($var_value, $langs));
                 break;
             case "template":
                 //drop down template
                 $templ = getTemplateList();
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $templ, array_search($var_value, $templ));
                 break;
             case "hteditor":
                 //drop down hteditor
                 $ht_edit = getHTMLEditorList();
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $ht_edit, $var_value);
                 break;
             case "layout_chooser":
                 //drop down hteditor
                 $layout = array('left' => Lang::t('_LAYOUT_LEFT'), 'over' => Lang::t('_LAYOUT_OVER'), 'right' => Lang::t('_LAYOUT_RIGHT'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $layout, $var_value);
                 break;
             case "sel_news":
                 $mode = array('off' => Lang::t('_DONT_SHOW'), 'link' => Lang::t('_SHOW_AS_LINK'), 'block' => Lang::t('_SHOW_AS_BLOCK'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $mode, $var_value);
                 break;
             case "enum":
                 //on off
                 $html .= Form::openFormLine() . Form::getInputCheckbox($var_name . '_on', 'option[' . $var_name . ']', 'on', $var_value == 'on', '') . ' ' . Form::getLabel($var_name . '_on', $lang->def('_' . strtoupper($var_name))) . Form::closeFormLine();
                 break;
             case "menuvoice":
             case "menuvoice_course_public":
             case "check":
                 //on off
                 $html .= Form::getCheckbox($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', 1, $var_value == 1);
                 break;
             case "tablist_coursecatalogue":
                 $lang_c =& DoceboLanguage::createInstance('catalogue', 'lms');
                 $tab_selected = unserialize(urldecode($var_value));
                 $tab_list = array('time' => $lang_c->def('_TAB_VIEW_TIME'), 'category' => $lang_c->def('_TAB_VIEW_CATEGORY'), 'all' => $lang_c->def('_ALL'));
                 if (Get::sett('use_coursepath') == '1') {
                     $tab_list['pathcourse'] = $lang_c->def('_COURSEPATH');
                 }
                 if (Get::sett('use_social_courselist') == 'on') {
                     $tab_list['mostscore'] = $lang_c->def('_TAB_VIEW_MOSTSCORE');
                     $tab_list['popular'] = $lang_c->def('_TAB_VIEW_MOSTPOPULAR');
                     $tab_list['recent'] = $lang_c->def('_TAB_VIEW_RECENT');
                 }
                 foreach ($tab_list as $tab_code => $name) {
                     $html .= Form::getCheckbox($name, 'tablist_' . $tab_code, 'tablist[' . $tab_code . ']', 1, isset($tab_selected[$tab_code]));
                 }
                 break;
             case "first_coursecatalogue_tab":
                 $lang_c =& DoceboLanguage::createInstance('catalogue', 'lms');
                 $tab_list = array('time' => $lang_c->def('_TAB_VIEW_TIME'), 'category' => $lang_c->def('_TAB_VIEW_CATEGORY'), 'all' => $lang_c->def('_ALL'));
                 if (Get::sett('use_coursepath') == '1') {
                     $tab_list['pathcourse'] = $lang_c->def('_COURSEPATH');
                 }
                 if (Get::sett('use_social_courselist') == 'on') {
                     $tab_list['mostscore'] = $lang_c->def('_TAB_VIEW_MOSTSCORE');
                     $tab_list['popular'] = $lang_c->def('_TAB_VIEW_MOSTPOPULAR');
                     $tab_list['recent'] = $lang_c->def('_TAB_VIEW_RECENT');
                 }
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $tab_list, $var_value);
                 break;
             case "tablist_mycourses":
                 //$var_value=deformat($var_value);
                 $arr_value = explode(',', $var_value);
                 //$arr_value=array();
                 $tab_list = array();
                 $tab_list[''] = $lang->def('_MYCOURSES_NOTUSED');
                 $tab_list['status'] = $lang->def('_STATUS');
                 $tab_list['name'] = $lang->def('_NAME');
                 $tab_list['code'] = $lang->def('_CODE');
                 $html .= '<div class="form_line_l"><p>' . '<label class="floating">' . $lang->def('_' . strtoupper($var_name)) . '</label></p>';
                 for ($i = 0; $i < 3; $i++) {
                     $html .= Form::getInputDropdown('dropdown', $var_name . '_' . $i, "mycourses[{$i}]", $tab_list, isset($arr_value[$i]) ? $arr_value[$i] : '', '');
                 }
                 $html .= '</div>';
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:class.conf_lms.php

示例3: FieldList

 /**
  * Assign fields mandatory and user for group
  **/
 function loadAssignField2($groupid)
 {
     $arr_fields = $_POST[DIRECTORY_ID][DIRECTORY_OP_ADDFIELD];
     $idst_group = $_POST[DIRECTORY_ID]['idst_group'];
     require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
     if (isset($_POST[DIRECTORY_ID]['save_assignfield2'])) {
         $fl = new FieldList();
         $arr_fields_mandatory = $_POST[DIRECTORY_ID]['field_mandatory'];
         $arr_fields_useraccess = $_POST[DIRECTORY_ID]['field_useraccess'];
         foreach ($arr_fields as $id_filed => $status) {
             switch ($status) {
                 case GROUP_FIELD_NO:
                     $fl->removeFieldFromGroup($id_filed, $idst_group);
                     break;
                 case GROUP_FIELD_NORMAL:
                     $fl->addFieldToGroup($id_filed, $idst_group, isset($arr_fields_mandatory[$id_filed]) ? $arr_fields_mandatory[$id_filed] : 'false', isset($arr_fields_useraccess[$id_filed]) ? $arr_fields_useraccess[$id_filed] : 'readonly');
                     break;
             }
         }
         Util::jump_to('index.php?modname=directory&op=listgroup');
     } elseif (isset($_POST[DIRECTORY_ID]['cancel_assignfield'])) {
         Util::jump_to('index.php?modname=directory&op=listgroup');
     }
     $fl = new FieldList();
     $arr_all_fields = $fl->getAllFields();
     require_once _base_ . '/lib/lib.form.php';
     $form = new Form();
     $GLOBALS['page']->setWorkingZone('content');
     $GLOBALS['page']->add(getTitleArea($this->lang->def('_GROUPS') . ': ' . $groupid, 'directory_group'));
     $GLOBALS['page']->add('<div class="std_block">');
     $GLOBALS['page']->add($form->openForm('directoryassignfieldgroupmandatory', 'index.php?modname=directory&amp;op=assignfieldmandatory'));
     $GLOBALS['page']->add($form->openElementSpace());
     // print custom fields status
     $arr_fields_normal = $fl->getFieldsFromIdst(array($idst_group));
     $GLOBALS['page']->add($form->getHidden(DIRECTORY_ID . '_idst_group', DIRECTORY_ID . '[idst_group]', $idst_group));
     foreach ($arr_fields as $id_filed => $status) {
         $GLOBALS['page']->add($form->getHidden(DIRECTORY_ID . '_' . $id_filed, DIRECTORY_ID . '[' . DIRECTORY_OP_ADDFIELD . '][' . $id_filed . ']', $status));
     }
     $GLOBALS['page']->add($form->openFormLine() . '<div class="label_effect">&nbsp;</div>' . '<div class="label_head">' . $this->lang->def('_MANDATORY') . '</div>' . '<div class="label_head">' . $this->lang->def('_DIRECTORY_GROUP_FIELD_WRITE') . '</div>' . $form->closeFormLine());
     // checkbox for mandatory and useraccess
     foreach ($arr_fields as $id_filed => $status) {
         if ($status == GROUP_FIELD_NORMAL) {
             $GLOBALS['page']->add($form->openFormLine() . '<div class="label_effect">' . $arr_all_fields[$id_filed][FIELD_INFO_TRANSLATION] . '</div>' . '<input class="label_head" type="checkbox"' . ' id="' . DIRECTORY_ID . '_' . $id_filed . '_mandatory"' . ' name="' . DIRECTORY_ID . '[field_mandatory][' . $id_filed . ']"' . ' value="true"');
             if (isset($arr_fields_normal[$id_filed]) && $arr_fields_normal[$id_filed][FIELD_INFO_MANDATORY] == 'true') {
                 $GLOBALS['page']->add(' checked="checked"');
             }
             $GLOBALS['page']->add(' />');
             $GLOBALS['page']->add($form->getLabel(DIRECTORY_ID . '_' . $id_filed . '_mandatory', $this->lang->def('_MANDATORY'), 'label_bold access-only'));
             // checkbox for useraccess
             $GLOBALS['page']->add('<input class="label_head" type="checkbox"' . ' id="' . DIRECTORY_ID . '_' . $id_filed . '_useraccess"' . ' name="' . DIRECTORY_ID . '[field_useraccess][' . $id_filed . ']"' . ' value="readwrite"');
             if (isset($arr_fields_normal[$id_filed]) && $arr_fields_normal[$id_filed][FIELD_INFO_USERACCESS] == 'readwrite') {
                 $GLOBALS['page']->add(' checked="checked"');
             }
             $GLOBALS['page']->add(' />');
             $GLOBALS['page']->add($form->getLabel(DIRECTORY_ID . '_' . $id_filed . '_useraccess', $this->lang->def('_DIRECTORY_GROUP_FIELD_WRITE'), 'label_bold access-only'));
             $GLOBALS['page']->add($form->closeFormLine());
         }
     }
     $GLOBALS['page']->add($form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('save_assignfield2' . DIRECTORY_ID, DIRECTORY_ID . '[save_assignfield2]', $this->lang->def('_SAVE')) . $form->getButton('cancel_assignfield' . DIRECTORY_ID, DIRECTORY_ID . '[cancel_assignfield]', $this->lang->def('_UNDO')) . $form->closeButtonSpace());
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:63,代码来源:class.directory.php

示例4: connect

 function connect()
 {
     require_once _base_ . '/lib/lib.userselector.php';
     require_once _adm_ . '/modules/org_chart/tree.org_chart.php';
     $this->directory = new UserSelector();
     //$this->tree_view = $this->directory->getTreeView_OrgView();
     $orgDb = new TreeDb_OrgDb($GLOBALS['prefix_fw'] . '_org_chart_tree');
     $this->tree_view = new TreeView_OrgView($orgDb, 'organization_chart', Get::sett('title_organigram_chart'));
     $this->tree_view->aclManager =& Docebo::aclm();
     list($this->tree_desc) = $this->tree_view->tdb->getDescendantsSTFromST(array($this->tree));
     require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
     // load language for fields names
     $lang_dir = DoceboLanguage::createInstance('admin_directory', 'framework');
     $fl = new FieldList();
     $fl->setGroupFieldsTable($GLOBALS['prefix_fw'] . ORGCHAR_FIELDTABLE);
     $arr_fields = $fl->getAllFields();
     $this->cols_descriptor = NULL;
     if ($this->dbconn === NULL) {
         $this->dbconn = $GLOBALS['dbConn'];
     }
     $table_fields = array(array('Field' => 'idOrg', 'Type' => 'text'), array('Field' => 'idParent', 'Type' => 'text'), array('Field' => 'path', 'Type' => 'text'), array('Field' => 'level', 'Type' => 'text'));
     $this->cols_descriptor = array();
     foreach ($table_fields as $field_info) {
         if (!in_array($field_info['Field'], $this->ignore_cols)) {
             $mandatory = in_array($field_info['Field'], $this->mandatory_cols);
             if (isset($this->default_cols[$field_info['Field']])) {
                 $this->cols_descriptor[] = array(DOCEBOIMPORT_COLNAME => $lang_dir->def('_DIRECTORY_FILTER_' . $field_info['Field']), DOCEBOIMPORT_COLID => $field_info['Field'], DOCEBOIMPORT_COLMANDATORY => $mandatory, DOCEBOIMPORT_DATATYPE => $field_info['Type'], DOCEBOIMPORT_DEFAULT => $this->default_cols[$field_info['Field']]);
             } else {
                 $this->cols_descriptor[] = array(DOCEBOIMPORT_COLNAME => $lang_dir->def('_DIRECTORY_FILTER_' . $field_info['Field']), DOCEBOIMPORT_COLID => $field_info['Field'], DOCEBOIMPORT_COLMANDATORY => $mandatory, DOCEBOIMPORT_DATATYPE => $field_info['Type']);
             }
         }
     }
     foreach ($arr_fields as $field_id => $field_info) {
         if (in_array($field_info[FIELD_INFO_TYPE], $this->valid_filed_type)) {
             $this->cols_descriptor[] = array(DOCEBOIMPORT_COLNAME => $field_info[FIELD_INFO_TRANSLATION], DOCEBOIMPORT_COLID => $field_id, DOCEBOIMPORT_COLMANDATORY => FALSE, DOCEBOIMPORT_DATATYPE => 'text');
         }
     }
     $this->tree_view->tdb->setFolderLang($this->default_lang);
     $arr_foldersid = $this->tree_view->tdb->getFoldersIdFromIdst(array($this->tree));
     $folderid = $arr_foldersid[$this->tree];
     $root_folder = $this->tree_view->tdb->getFolderById($folderid);
     $arr_id = $this->tree_view->tdb->getDescendantsId($root_folder);
     $this->arr_folders = array();
     if ($arr_id !== FALSE) {
         $coll_folders = $this->tree_view->tdb->getFoldersCollection($arr_id);
         // make the new structure
         $curr_path = array();
         while (($folder = $coll_folders->getNext()) !== FALSE) {
             $curr_path = array_slice($curr_path, 0, $folder->level - $root_folder->level - 1);
             $curr_path[] = $folder->otherValues[ORGDB_POS_TRANSLATION];
             $this->arr_folders[implode('/', $curr_path)] = array('id' => $folder->id, 'inserted' => FALSE);
         }
     }
     return TRUE;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:55,代码来源:connector.doceboorgchart.php

示例5: getPageWithElement

 /**
  * @param 	string	contains the group selected
  *
  * @return 	string 	contains the displayable information for a selected group
  */
 function getPageWithElement($group_selected)
 {
     if ($group_selected != 'user_manager') {
         return '';
     }
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('user_managment', 'framework');
     $reSetting = sql_query("\r\n\t\tSELECT param_name, param_value, value_type, max_size\r\n\t\tFROM " . $this->_table . "\r\n\t\tWHERE pack = 'log_option' AND\r\n\t\t\thide_in_modify = '0'\r\n\t\tORDER BY sequence");
     $html = '';
     while (list($var_name, $var_value, $value_type, $max_size) = sql_fetch_row($reSetting)) {
         switch ($value_type) {
             case "register_type":
                 //on off
                 $html .= Form::getOpenCombo($lang->def('_' . strtoupper($var_name))) . Form::getLineRadio('', 'label_bold', $lang->def('_REGISTER_TYPE_SELF'), $var_name . '_self', 'option[' . $var_name . ']', 'self', $var_value == 'self') . Form::getLineRadio('', 'label_bold', $lang->def('_REGISTER_TYPE_SELF_OPTIN'), $var_name . '_self_optin', 'option[' . $var_name . ']', 'self_optin', $var_value == 'self_optin') . Form::getLineRadio('', 'label_bold', $lang->def('_REGISTER_TYPE_MODERATE'), $var_name . '_moderate', 'option[' . $var_name . ']', 'moderate', $var_value == 'moderate') . Form::getLineRadio('', 'label_bold', $lang->def('_REGISTER_TYPE_ADMIN'), $var_name . '_admin', 'option[' . $var_name . ']', 'admin', $var_value == 'admin') . Form::getCloseCombo();
                 break;
             case "register_tree":
                 $register_possible_option = array('off' => $lang->def('_DONT_USE_TREE_REGISTRATION'), 'manual_insert' => $lang->def('_USE_WITH_MANUALEINSERT'), 'selection' => $lang->def('_USE_WITH_SELECTION'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $register_possible_option, $var_value);
                 break;
             case "field_tree":
                 require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
                 $fl = new FieldList();
                 $all_fields = $fl->getAllFields(false);
                 $fields[0] = $lang->def('_NO_VALUE');
                 foreach ($all_fields as $key => $val) {
                     $fields[$val[FIELD_INFO_ID]] = $val[FIELD_INFO_TRANSLATION];
                 }
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $fields, $var_value);
                 break;
             case "save_log_attempt":
                 //on off
                 $html .= Form::getOpenCombo($lang->def('_' . strtoupper($var_name))) . Form::getLineRadio('', 'label_bold', $lang->def('_SAVE_LA_ALL'), $var_name . '_all', 'option[' . $var_name . ']', 'all', $var_value == 'all') . Form::getLineRadio('', 'label_bold', $lang->def('_SAVE_LA_AFTER_MAX'), $var_name . '_after_max', 'option[' . $var_name . ']', 'after_max', $var_value == 'after_max') . Form::getLineRadio('', 'label_bold', $lang->def('_NO'), $var_name . '_no', 'option[' . $var_name . ']', 'no', $var_value == 'no') . Form::getCloseCombo();
                 break;
             case "enum":
                 //on off
                 $html .= Form::openFormLine() . Form::getInputCheckbox($var_name . '_on', 'option[' . $var_name . ']', 'on', $var_value == 'on', '') . ' ' . Form::getLabel($var_name . '_on', $lang->def('_' . strtoupper($var_name)), 'label_bold') . Form::closeFormLine();
                 break;
                 //uncrypted password
             //uncrypted password
             case "password":
                 $html .= Form::getPassword($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $max_size, $var_value);
                 break;
                 //string or int
             //string or int
             default:
                 $html .= Form::getTextfield($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $max_size, $var_value);
         }
     }
     return $html;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:55,代码来源:lib.usermanager.php

示例6: getGapList

 public function getGapList($id_fncrole, $pagination, $filter = false)
 {
     if ($id_fncrole <= 0) {
         return false;
     }
     //invalid role
     //validate pagination data
     if (!is_array($pagination)) {
         $pagination = array();
     }
     $_startIndex = isset($pagination['startIndex']) ? (int) $pagination['startIndex'] : 0;
     $_results = isset($pagination['results']) ? (int) $pagination['results'] : Get::sett('visuItem', 25);
     $_sort = 'competence_name';
     $_dir = 'ASC';
     if (isset($pagination['dir'])) {
         switch (strtoupper($pagination['dir'])) {
             case 'ASC':
                 $_dir = 'ASC';
                 break;
             case 'DESC':
                 $_dir = 'DESC';
                 break;
         }
     }
     if (isset($pagination['sort'])) {
         switch ($pagination['sort']) {
             case 'competence':
                 $_sort = 'competence_name ' . $_dir . ', usr.userid ';
                 break;
             case 'userid':
                 $_sort = 'usr.userid ' . $_dir . ', competence_name ';
                 break;
             case 'lastname':
                 $_sort = 'usr.lastname ' . $_dir . ', usr.firstname ' . $_dir . ', usr.userid';
                 break;
             case 'firstname':
                 $_sort = 'usr.firstname ' . $_dir . ', usr.lastname ' . $_dir . ', usr.userid';
                 break;
             case 'score_got':
                 $_sort = 'cmu.score_got ';
                 break;
             case 'score_req':
                 $_sort = 'fnc.score ';
                 break;
             case 'gap':
                 $_sort = 'gap ' . $_dir . ', competence_name ' . $_dir . ', usr.userid ';
                 break;
                 //case 'date_expire': $_sort = 'date_expire '; break;
             //case 'date_expire': $_sort = 'date_expire '; break;
             default:
                 $_sort = $pagination['sort'] . ' ' . $_dir . ', competence_name ' . $_dir . ', usr.userid ';
                 break;
         }
     }
     //validate filter data and abjust query
     $where_filter = "";
     if (is_array($filter)) {
         $conditions = array();
         if (isset($filter['text']) && $filter['text'] != '') {
             $conditions[] = " (cml.name LIKE '%" . $filter['text'] . "%' " . " OR usr.userid LIKE '%" . $filter['text'] . "%' " . " OR usr.firstname LIKE '%" . $filter['text'] . "%' " . " OR usr.lastname LIKE '%" . $filter['text'] . "%') ";
         }
         if (isset($filter['show_gap']) && $filter['show_gap'] != 0) {
             $conditions[] = $filter['show_gap'] == 1 ? " fnc.score > IF(cmu.score_got,cmu.score_got,0) " : " fnc.score <= IF(cmu.score_got,cmu.score_got,0) ";
         }
         if (isset($filter['show_expired']) && $filter['show_expired'] != 0) {
             $conditions[] = $filter['show_expired'] == 1 ? " ( (DATE_ADD(cmu.last_assign_date,INTERVAL fnc.expiration DAY)) < NOW() AND fnc.expiration > 0 ) " : " ( (DATE_ADD(cmu.last_assign_date,INTERVAL fnc.expiration DAY)) >= NOW() OR fnc.expiration <= 0)";
         }
         if (count($conditions) > 0) {
             $where_filter .= " WHERE " . implode(" AND ", $conditions);
         }
     }
     $language = getLanguage();
     $comps_table = '%lms_competence';
     //cmp
     $clang_table = '%lms_competence_lang';
     //cml
     $ucomp_table = '%lms_competence_user';
     //cmu
     $users_table = '%adm_user';
     //usr
     $fnccm_table = $this->_getRolesCompetencesTable();
     //fnc
     //mount query
     if (isset($filter['user']) && $filter['user'] > 0) {
         $_users = array($filter['user']);
     } else {
         $_users = $this->getAllUsers($id_fncrole);
     }
     $dynFilter = isset($filter['dyn_filter']) ? $filter['dyn_filter'] : false;
     if ($dynFilter) {
         require_once _adm_ . '/lib/lib.field.php';
         //retrieve custom fields definitions data
         $fman = new FieldList();
         $fields = $fman->getAllFields();
         //retrieve which fields are required
         $custom_fields = array_keys($fields);
     }
     if (!empty($_users)) {
         $query = "SELECT usr.idst, usr.userid, usr.firstname, usr.lastname, cmu.last_assign_date, fnc.score as score_requested, " . " fnc.id_competence, cml.name as competence_name, cmu.score_got, fnc.score, fnc.expiration, cmp.type " . ", (fnc.score-IF(cmu.score_got,cmu.score_got,0)) as gap ";
         //.", (DATE_ADD(cmu.last_assign_date,INTERVAL fnc.expiration DAY)) as date_expire "
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:FunctionalrolesAdm.php

示例7: assignfields_action

 public function assignfields_action()
 {
     //check permissions
     if (!$this->permissions['mod_org']) {
         Util::jump_to('index.php?r=' . $this->link . '/show');
     }
     require_once _adm_ . '/lib/lib.field.php';
     $id_org = Get::req('idst_group', DOTY_INT, 0);
     $fields_use = Get::req('fields_use', DOTY_MIXED, array());
     $fields_inherit = Get::req('fields_inherit', DOTY_MIXED, array());
     $fields_mandatory = Get::req('fields_mandatory', DOTY_MIXED, array());
     $fields_invisible = Get::req('fields_invisible', DOTY_MIXED, array());
     $fields_userinherit = Get::req('fields_userinherit', DOTY_MIXED, array());
     $fl = new FieldList();
     $acl_man = Docebo::user()->getAclManager();
     $count = 0;
     $all_fields = $fl->getAllFields();
     foreach ($all_fields as $field) {
         $id_field = $field[FIELD_INFO_ID];
         if (isset($fields_use[$id_field])) {
             $arr_idgroups = array();
             if (isset($fields_inherit[$id_field])) {
                 //$arr_idorgs = $acl_man->getGroupGDescendants($id_org);
                 //$arr_idorgs[] = $id_org;
                 //$arr_idorgs = array_unique($arr_idorgs);
                 $arr_idgroups[] = $acl_man->getGroupST('oc_' . $id_org);
                 $arr_idgroups[] = $acl_man->getGroupST('ocd_' . $id_org);
             } else {
                 $arr_idgroups[] = $acl_man->getGroupST('oc_' . $id_org);
                 $fl->removeFieldFromGroup($id_field, $acl_man->getGroupST('ocd_' . $id_org));
             }
             foreach ($arr_idgroups as $idst_group) {
                 $res = $fl->addFieldToGroup($id_field, $idst_group, isset($fields_mandatory[$id_field]) ? 'true' : 'false', isset($fields_invisible[$id_field]) ? 'readwrite' : 'readonly', isset($fields_userinherit[$id_field]) ? 1 : 0);
                 if ($res) {
                     $count++;
                 }
             }
         } else {
             $res = $fl->removeFieldFromGroup($id_field, $acl_man->getGroupST('oc_' . $id_org));
             $res = $fl->removeFieldFromGroup($id_field, $acl_man->getGroupST('ocd_' . $id_org));
             if ($res) {
                 $count++;
             }
         }
     }
     $output = array('success' => true, 'total' => count($fields_use), 'done' => $count);
     echo $this->json->encode($output);
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:48,代码来源:UsermanagementAdmController.php

示例8: FieldList

 function loadAssignField3()
 {
     $arr_fields = $_POST[$this->id]['field_set'];
     $idst_group = $_POST[$this->id]['idst_group'];
     require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
     $fl = new FieldList();
     $arr_all_fields = $fl->getAllFields();
     $arr_fields_normal = $fl->getFieldsFromIdst(array($idst_group));
     require_once _base_ . '/lib/lib.form.php';
     $form = new Form();
     $tree = $form->getFormHeader($this->lang->def('_ORG_CHART_LIST_FIELDS'));
     $tree .= $form->openElementSpace();
     $tree .= $this->printState();
     $tree .= $form->getHidden($this->id . '_idst_group', $this->id . '[idst_group]', $idst_group);
     // print custom fields status
     foreach ($arr_fields as $id_filed => $status) {
         $tree .= $form->getHidden($this->id . '_' . $id_filed, $this->id . '[field_set][' . $id_filed . ']', $status);
     }
     // first print already ordered fields
     foreach ($arr_fields_normal as $id_filed => $field) {
     }
     $tree .= $form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('next1_assignfield' . $this->id, $this->id . '[save_assignfield]', $this->lang->def('_SAVE')) . $form->getButton($this->_getCancelId(), $this->_getCancelId(), $this->lang->def('_UNDO')) . $form->closeButtonSpace();
     return $tree;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:24,代码来源:tree.org_chart.php


注:本文中的FieldList::getAllFields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。