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


PHP Form::getInputCheckbox方法代码示例

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


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

示例1: mod

 public function mod()
 {
     $id_trans = Get::req('id_trans', DOTY_INT, 0);
     if (isset($_POST['undo'])) {
         Util::jump_to('index.php?r=alms/transaction/show');
     }
     if (isset($_POST['save']) || isset($_POST['not_paid'])) {
         $product_to_activate = Get::req('product', DOTY_MIXED, array());
         $id_user = Get::req('id_user', DOTY_MIXED, 0);
         if ($this->model->saveTransaction($product_to_activate, $id_trans, $id_user)) {
             $this->model->controlActivation($id_trans, isset($_POST['not_paid']));
             Util::jump_to('index.php?r=alms/transaction/show&res=ok');
         }
         Util::jump_to('index.php?r=alms/transaction/show&res=err');
     }
     $transaction_info = $this->model->getTransactionInfo($id_trans);
     $user_info = $this->acl_man->getUser($transaction_info['id_user'], false);
     $user_info[ACL_INFO_USERID] = $this->acl_man->relativeId($user_info[ACL_INFO_USERID]);
     require_once _base_ . '/lib/lib.table.php';
     $tb = new Table(false, Lang::t('_DETAILS', 'transaction'), Lang::t('_DETAILS', 'transaction'));
     $ts = array('', '', 'min-cell', 'image');
     $th = array(Lang::t('_CODE', 'transaction'), Lang::t('_NAME', 'transaction'), Lang::t('_PRICE', 'transaction'), Lang::t('_MARK_AS_PAID', 'transaction'));
     $tb->setColsStyle($ts);
     $tb->addHead($th);
     foreach ($transaction_info['product'] as $product_info) {
         $tb->addBody(array($product_info['code'], $product_info['name'], $product_info['price'], Form::getInputCheckbox('product_' . $product_info['id_course'] . '_' . $product_info['id_date'] . '_' . $product_info['id_edition'], 'product[' . $product_info['id_course'] . '_' . $product_info['id_date'] . '_' . $product_info['id_edition'] . ']', 1, $product_info['activated'], $product_info['activated'] ? ' disabled="disabled"' : '')));
     }
     $this->render('mod', array('transaction_info' => $transaction_info, 'user_info' => $user_info, 'tb' => $tb, 'id_trans' => $id_trans));
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:29,代码来源:TransactionAlmsController.php

示例2: 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

示例3: array

<br />

<?php 
$title = array('index.php?r=' . $base_link_course . '/show' => Lang::t('_COURSE', 'course'), 'index.php?r=' . $base_link_edition . '/show&id_course=' . $model->getIdCourse() => Lang::t('_EDITIONS', 'course'), Lang::t('_ADD', 'course'));
echo getTitleArea($title);
?>

<div class="std_block">

<?php 
echo Form::openForm('add_edition_form', 'index.php?r=' . $base_link_edition . '/add&amp;id_course=' . $model->getIdCourse()) . Form::openElementSpace() . Form::getTextfield(Lang::t('_CODE', 'course'), 'code', 'code', 255, $course_info['code']) . Form::getTextfield(Lang::t('_NAME', 'course'), 'name', 'name', 255, $course_info['name']) . Form::getTextarea(Lang::t('_DESCRIPTION', 'course'), 'description', 'description', $course_info['description']) . Form::getDropdown(Lang::t('_STATUS', 'course'), 'status', 'status', $model->getStatusForDropdown()) . Form::getTextfield(Lang::t('_MAX_NUM_SUBSCRIBE', 'course'), 'max_par', 'max_par', 255) . Form::getTextfield(Lang::t('_MIN_NUM_SUBSCRIBE', 'course'), 'min_par', 'min_par', 255) . Form::getTextfield(Lang::t('_COURSE_PRIZE', 'course'), 'price', 'price', 255) . Form::getDatefield(Lang::t('_DATE_BEGIN', 'course'), 'date_begin', 'date_begin') . Form::getDatefield(Lang::t('_DATE_END', 'course'), 'date_end', 'date_end') . '<div class="form_line_l">' . '<p><label for="overbooking" class="floating">' . Lang::t('_ALLOW_OVERBOOKING', 'course') . '</label></p>' . Form::getInputCheckbox('overbooking', 'overbooking', 1, false, false) . '</div>' . '<div class="form_line_l">' . '<p><label for="overbooking" class="floating">' . Lang::t('_SUBSCRIPTION_OPEN', 'course') . '</label></p>' . Form::getInputCheckbox('can_subscribe', 'can_subscribe', 1, false, false) . '</div>' . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_BEGIN', 'course'), 'sub_date_begin', 'sub_date_begin') . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_END', 'course'), 'sub_date_end', 'sub_date_end') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('ins', 'ins', Lang::t('_SAVE', 'course')) . Form::getButton('undo', 'undo', Lang::t('_UNDO', 'course')) . Form::closeButtonSpace() . Form::closeForm();
?>

</div>
开发者ID:abhinay100,项目名称:forma_app,代码行数:14,代码来源:add.php

示例4: modTransaction

function modTransaction()
{
    require_once _base_ . '/lib/lib.table.php';
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.dialog.php';
    require_once _lms_ . '/lib/lib.course.php';
    require_once _lms_ . '/lib/lib.date.php';
    $lang =& DoceboLanguage::createInstance('transaction');
    $acl_man = Docebo::user()->getAclManager();
    $man_transaction = new Man_Transaction();
    $course_man = new Man_Course();
    $date_man = new DateManager();
    $id_transaction = Get::req('id', DOTY_INT, 0);
    $transaction_info = $man_transaction->getTransactionInfo($id_transaction);
    if (isset($_POST['update'])) {
        $payment_status = Get::req('payment_status', DOTY_INT, 0);
        $course_status = Get::req('course_status', DOTY_INT, 0);
        $note = Get::req('note', DOTY_MIXED, '');
        if ($man_transaction->updateTransaction($id_transaction, $payment_status, $course_status, $note)) {
            if (isset($_POST['confirm'])) {
                $activations = array();
                foreach ($_POST['confirm'] as $id => $n) {
                    list($id_course, $id_date) = explode('_', $id);
                    if ($id_date != 0) {
                        $activations[$id_course]['dates'][$id_date] = $id_date;
                    } else {
                        $activations[$id_course] = $id_course;
                    }
                }
                if ($man_transaction->activateCourses($id_transaction, $transaction_info['id_user'], $activations)) {
                    Util::jump_to('index.php?modname=transaction&op=transaction&res=ok');
                }
            } else {
                Util::jump_to('index.php?modname=transaction&op=transaction&res=ok');
            }
        }
        Util::jump_to('index.php?modname=transaction&op=transaction&res=err_up');
    }
    $array_title = array('index.php?modname=transaction&amp;op=transaction' => $lang->def('_TRANSACTION'), $lang->def('_MOD_TRANSACTION'));
    //Status info & note
    $array_payment_status = array('-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_WAITING_PAYMENT'), '1' => $lang->def('_PARTIAL_PAID'), '2' => $lang->def('_PAID'));
    $array_course_status = array('-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_NO_COURSE_ACTIVATED'), '1' => $lang->def('_SOME_COURSE_ACTIVATED'), '2' => $lang->def('_ALL_COURSE_ACTIVATED'));
    cout(getTitleArea($array_title) . '<div class="std_block">' . Form::openForm('transaction_info', 'index.php?modname=transaction&amp;op=mod&amp;id=' . $id_transaction) . Form::openElementSpace() . Form::getDropdown($lang->def('_PAYMENT_STATUS_FILTER'), 'payment_status', 'payment_status', $array_payment_status, $transaction_info['payment_status']) . Form::getDropdown($lang->def('_COURSE_STATUS_FILTER'), 'course_status', 'course_status', $array_course_status, $transaction_info['course_status']) . Form::getSimpleTextarea($lang->def('_NOTES'), 'note', 'note', $transaction_info['note']) . Form::closeElementSpace());
    //User info
    $user_info = $acl_man->getUser($transaction_info['id_user'], false);
    $tb_user = new Table(0, $lang->def('_USER_INFO'), $lang->def('_USER_INFO'));
    $cont_h = array($lang->def('_USERNAME'), $lang->def('_FIRSTNAME'), $lang->def('_LASTNAME'), $lang->def('_EMAIL'));
    $type_h = array('', '', '', '');
    $tb_user->setColsStyle($type_h);
    $tb_user->addHead($cont_h);
    $tb_user->addBody(array($acl_man->relativeId($user_info[ACL_INFO_USERID]), $user_info[ACL_INFO_FIRSTNAME], $user_info[ACL_INFO_LASTNAME], $user_info[ACL_INFO_EMAIL]));
    cout('<br />' . $tb_user->getTable());
    //Payment info if we need it
    //Product info
    $tb_product = new Table(0, $lang->def('_PRODUCT_INFO'), $lang->def('_PRODUCT_INFO'));
    $cont_h = array($lang->def('_CODE'), $lang->def('_NAME'), $lang->def('_DATE_BEGIN'), $lang->def('_DATE_END'), $lang->def('_COURSE_PRIZE'), $lang->def('_CONFIRM_COURSE'));
    $type_h = array('', '', '', '', '', '');
    $tb_product->setColsStyle($type_h);
    $tb_product->addHead($cont_h);
    $transaction_course = $man_transaction->getTransactionCourses($id_transaction);
    foreach ($transaction_course as $id_course => $details) {
        if (is_array($details)) {
            foreach ($details['dates'] as $id_date) {
                $date_info = $date_man->getDateInfo($id_date);
                $checked = false;
                $other = '';
                if ($man_transaction->controlActivation($id_transaction, $id_course, $id_date)) {
                    $checked = true;
                    $other = 'disabled="disabled"';
                }
                $tb_product->addBody(array($date_info['code'], $date_info['name'], Format::date($date_info['date_begin']), Format::date($date_info['date_end']), $date_info['price'], Form::getInputCheckbox($id_course . '_' . $id_date, 'confirm[' . $id_course . '_' . $id_date . ']', 1, $checked, $other)));
            }
        } else {
            $course_info = $course_man->getCourseInfo($id_course);
            $checked = false;
            $other = '';
            if ($man_transaction->controlActivation($id_transaction, $id_course)) {
                $checked = true;
                $other = 'disabled="disabled"';
            }
            $tb_product->addBody(array($course_info['code'], $course_info['name'], $course_info['date_begin'] !== '0000-00-00' ? Format::date($course_info['date_begin'], 'date') . ($course_info['hour_begin'] !== '-1' ? $course_info['hour_begin'] : '') : '', $course_info['date_end'] !== '0000-00-00' ? Format::date($course_info['date_end'], 'date') . ($course_info['hour_end'] !== '-1' ? $course_info['hour_end'] : '') : '', $course_info['prize'] == '' ? '0' : $course_info['prize'], Form::getInputCheckbox($id_course . '_0', 'confirm[' . $id_course . '_0]', 1, $checked, $other)));
        }
    }
    cout('<br />' . $tb_product->getTable() . Form::openButtonSpace() . Form::getButton('update', 'update', $lang->def('_UPDATE')) . Form::getButton('back_mod', 'back_mod', $lang->def('_BACK')) . Form::closeButtonSpace() . Form::closeForm());
    cout('</div>');
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:86,代码来源:transaction.php

示例5: getCheckboxSet

 /**
  * @param string 	$label_name 	text contained into the label
  * @param string 	$id 			the id of the element
  * @param string 	$name 			the name of the element
  * @param string 	$value 			value for the input field
  * @param boolean 	$is_checked
  *
  * @return string with the html code for the input type="checkbox" element
  */
 public static function getCheckboxSet($group_name, $id, $name, $all_value, $selected = false, $other_after = '', $other_before = '')
 {
     if ($selected == false) {
         $selected = array();
     }
     $count = 0;
     $out = '<div class="form_line_l">' . $other_before . '<p><span class="label_effect">' . $group_name . '</span></p>' . '<div class="grouping">';
     foreach ($all_value as $val_item => $label_item) {
         $out .= '<p>' . Form::getInputCheckbox($id . '_' . $val_item, $name . '[' . $val_item . ']', 1, isset($selected[$val_item]), '') . ' <label class="label_padded" for="' . $id . '_' . $val_item . '">' . $label_item . '</label>' . '</p>';
         $count++;
     }
     $out .= '</div>' . $other_after . '</div>';
     return $out;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:23,代码来源:lib.form.php

示例6: array

echo Form::getInputTextfield("search_t", "filter_text", "filter_text", $filter_text, '', 255, '');
echo Form::getButton("filter_set", "filter_set", Lang::t('_SEARCH', 'standard'), "search_b");
echo Form::getButton("filter_reset", "filter_reset", Lang::t('_RESET', 'standard'), "reset_b");
?>
		</div>
		<a id="advanced_search" class="advanced_search" href="javascript:;"><?php 
echo Lang::t("_ADVANCED_SEARCH", 'standard');
?>
</a>
		<div id="advanced_search_options" class="advanced_search_options" style="display: <?php 
echo $is_active_advanced_filter ? 'block' : 'none';
?>
">
			<?php 
//filter inputs
$orgchart_after = '<br />' . Form::getInputCheckbox('filter_descendants', 'filter_descendants', 1, $filter_descendants ? true : false, "") . '&nbsp;<label for="filter_descendants">' . Lang::t('_ORG_CHART_INHERIT', 'organization_chart') . '</label>';
echo Form::getDropdown(Lang::t('_DIRECTORY_MEMBERTYPETREE', 'admin_directory'), 'filter_orgchart', 'filter_orgchart', $orgchart_list, (int) $filter_orgchart, $orgchart_after);
echo Form::getDropdown(Lang::t('_GROUPS', 'standard'), 'filter_groups', 'filter_groups', $groups_list, (int) $filter_groups);
//buttons
echo Form::openButtonSpace();
echo Form::getButton('set_advanced_filter', false, Lang::t('_SEARCH', 'standard'));
echo Form::getButton('reset_advanced_filter', false, Lang::t('_UNDO', 'standard'));
echo Form::closeButtonSpace();
?>
		</div>
	</div>
</div>
<?php 
$columns = array(array('key' => 'userid', 'label' => Lang::t('_USERNAME', 'standard'), 'sortable' => true, 'formatter' => 'CourseStats.useridFormatter', 'className' => 'min-cell'), array('key' => 'fullname', 'label' => Lang::t('_NAME', 'standard'), 'sortable' => true, 'formatter' => 'CourseStats.fullnameFormatter', 'className' => 'min-cell'), array('key' => 'level', 'label' => Lang::t('_LEVEL', 'standard'), 'sortable' => true, 'className' => 'min-cell'), array('key' => 'status', 'label' => Lang::t('_STATUS', 'standard'), 'sortable' => true, 'className' => 'min-cell', 'editor' => 'CourseStats.statusEditor'));
foreach ($lo_list as $lo) {
    $icon = '(' . $lo->type . ')';
开发者ID:abhinay100,项目名称:forma_app,代码行数:31,代码来源:show.php

示例7: printPageWithElement

 public function printPageWithElement($id, $idst)
 {
     $adm_old_perm = $this->preference->getAdminPerm($idst);
     $array_image = array('add_category' => 'ico-sprite subs_view', 'mod_category' => 'ico-sprite subs_view', 'del_category' => 'ico-sprite subs_view', 'view' => 'ico-sprite subs_view', 'add' => 'ico-sprite subs_add', 'mod' => 'ico-sprite subs_mod', 'del' => 'ico-sprite subs_del', 'associate_user' => 'ico-sprite subs_users', 'approve_waiting_user' => 'ico-sprite subs_user', 'subscribe' => 'ico-sprite subs_users', 'moderate' => 'ico-sprite subs_user');
     switch ($id) {
         case 'framework':
             require_once _base_ . '/lib/lib.table.php';
             $query = "SELECT idMenu, name, collapse" . " FROM %adm_menu" . " ORDER BY sequence";
             $result = sql_query($query);
             while (list($id_menu, $name, $collapse) = sql_fetch_row($result)) {
                 $query = "SELECT module_name, default_name, class_file, class_name, mvc_path" . " FROM %adm_menu_under" . " WHERE idMenu = '" . $id_menu . "'";
                 $result_under = sql_query($query);
                 if (sql_num_rows($result_under) > 0) {
                     $tb = new Table(NULL);
                     $th = array(Lang::t($name, 'menu'));
                     $ts = array('');
                     $total_perm = array();
                     $module_perm = array();
                     while (list($module_name, $default_name, $class_file, $class_name, $mvc_path) = sql_fetch_row($result_under)) {
                         if ($mvc_path !== '') {
                             $tmp = explode('/', $mvc_path);
                             $mvc_name = ucwords($tmp[1]);
                             $perm_path = '/framework/admin/' . strtolower($mvc_name) . '/';
                             require_once _adm_ . '/models/' . $mvc_name . 'Adm.php';
                             $class_name = $mvc_name . 'Adm';
                             $tmp_class = new $class_name();
                             $perm = $tmp_class->getPerm();
                             if (!empty($perm)) {
                                 foreach ($perm as $perm_name => $img) {
                                     if (array_search($perm_name, array_keys($total_perm)) == false) {
                                         $total_perm[$perm_name] = $img;
                                         if ($collapse === 'true') {
                                             $th = array(Lang::t($default_name, 'menu'));
                                         }
                                     }
                                     list($perm_idst) = sql_fetch_row(sql_query("SELECT idst FROM %adm_role WHERE roleid = '" . $perm_path . $perm_name . "'"));
                                     $module_perm[$mvc_name][$perm_name] = $perm_idst;
                                 }
                             }
                         } else {
                             require_once _adm_ . '/class.module/' . $class_file;
                             $tmp_class = new $class_name();
                             $perm_path = '/framework/admin/' . strtolower($module_name) . '/';
                             $perm = $tmp_class->getAllToken('lang');
                             if (!empty($perm)) {
                                 foreach ($perm as $perm_name => $info) {
                                     if (array_search($perm_name, array_keys($total_perm)) == false) {
                                         $total_perm[$perm_name] = $info['image'];
                                         if ($collapse === 'true') {
                                             $th = array(Lang::t($default_name, 'menu'));
                                         }
                                     }
                                     list($perm_idst) = sql_fetch_row(sql_query("SELECT idst FROM %adm_role WHERE roleid = '" . $perm_path . $perm_name . "'"));
                                     $module_perm[$class_name][$perm_name] = $perm_idst;
                                 }
                             }
                         }
                     }
                     //End while 1
                     if (!empty($total_perm)) {
                         foreach ($total_perm as $perm => $img) {
                             $classname = isset($array_image[$perm]) ? $array_image[$perm] : "ico-sprite";
                             $th[] = '<span class="' . $classname . '" title="' . Lang::t('_' . strtoupper($perm), 'menu') . '"><span>' . Lang::t('_' . strtoupper($perm), 'menu') . '</span></span>';
                             $ts[] = 'image';
                         }
                         $tb->addHead($th);
                         $tb->setColsStyle($ts);
                         $result_under = sql_query($query);
                         while (list($module_name, $default_name, $class_file, $class_name, $mvc_path) = sql_fetch_row($result_under)) {
                             if ($mvc_path !== '') {
                                 $tmp = explode('/', $mvc_path);
                                 $mvc_name = ucwords($tmp[1]);
                                 $content = array(Lang::t($default_name, 'menu'));
                                 foreach ($total_perm as $perm => $img) {
                                     if (isset($module_perm[$mvc_name][$perm])) {
                                         $content[] = Form::getInputCheckbox('adm_perm_' . $module_perm[$mvc_name][$perm], 'adm_perm[' . $module_perm[$mvc_name][$perm] . ']', '1', isset($adm_old_perm[$module_perm[$mvc_name][$perm]]), '');
                                     } else {
                                         $content[] = '';
                                     }
                                 }
                                 reset($total_perm);
                                 $tb->addBody($content);
                             } else {
                                 $content = array(Lang::t($default_name, 'menu'));
                                 foreach ($total_perm as $perm => $img) {
                                     if (isset($module_perm[$class_name][$perm])) {
                                         $content[] = Form::getInputCheckbox('adm_perm_' . $module_perm[$class_name][$perm], 'adm_perm[' . $module_perm[$class_name][$perm] . ']', '1', isset($adm_old_perm[$module_perm[$class_name][$perm]]), '');
                                     } else {
                                         $content[] = '';
                                     }
                                 }
                                 reset($total_perm);
                                 $tb->addBody($content);
                             }
                         }
                         //End while 2
                         echo $tb->getTable() . '<br/><br/>';
                     }
                 }
             }
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:AdminrulesAdm.php

示例8: _get_games_query


//.........这里部分代码省略.........
     if ($start_date != '' && $end_date != '') {
         if ($start_date > $end_date) {
             //invalid time period
             $start_date = '';
             $end_date = '';
         }
     }
     //other checkings and validations
     if (!$sel_all && count($selection) <= 0) {
         cout('<p>' . $_ERR_NOUSER . '</p>');
         return;
     }
     $acl_man = new DoceboACLManager();
     $acl_man->include_suspended = true;
     //extract user idst from selection
     if ($sel_all) {
         $arr_selected_users = $acl_man->getAllUsersIdst();
     } else {
         $arr_selected_users = $acl_man->getAllUsersFromIdst($arr_selected_users);
     }
     if ($comp_all) {
         $query = "SELECT id_game FROM %lms_games";
         $res = $this->db->query($query);
         $arr_selected_comp = array();
         while (list($id_game) = $this->db->fetch_row($res)) {
             $arr_selected_comp[] = $id_game;
         }
     }
     //admin users filter
     $userlevelid = Docebo::user()->getUserLevelId();
     if ($userlevelid != ADMIN_GROUP_GODADMIN && !Docebo::user()->isAnonymous()) {
         require_once _base_ . '/lib/lib.preference.php';
         $adminManager = new AdminPreference();
         $admin_tree = $adminManager->getAdminTree(Docebo::user()->getIdST());
         $admin_users = $acl_man->getAllUsersFromIdst($admin_tree);
         $admin_users = array_unique($admin_users);
         //filter users selection by admin visible users
         $arr_selected_users = array_intersect($arr_selected_users, $admin_users);
         //free some memory
         unset($admin_tree);
         unset($admin_users);
         unset($adminManager);
     }
     //check selected users ...
     if (count($arr_selected_users) <= 0) {
         //message: no users selected
         cout('<p>' . $_ERR_NOUSER . '</p>');
         return;
     }
     //check selected communications ...
     if (count($arr_selected_comp) <= 0) {
         //message: no communications selected
         cout('<p>' . $_ERR_NOCOMP . '</p>');
         return;
     }
     //set table properties and buffer
     $head = array(Lang::t('_GAMES_TITLE', 'report'), Lang::t('_GAMES_TYPE', 'report'), Lang::t('_FROM', 'report'), Lang::t('_TO', 'report'), Lang::t('_USER', 'report'), Lang::t('_GAMES_ATTEMPTED', 'report'), Lang::t('_GAMES_ATTEMPT_DATE', 'report'), Lang::t('_GAMES_FIRST_ATTEMPT_DATE', 'report'), Lang::t('_GAMES_CURRENT_SCORE', 'report'), Lang::t('_GAMES_MAX_SCORE', 'report'), Lang::t('_GAMES_NUM_ATTEMPTS', 'report'));
     if ($this->use_mail) {
         $head[] = array('style' => 'img-cell', 'value' => $this->_loadEmailIcon());
     }
     $buffer = new ReportTablePrinter();
     $buffer->openTable('', '');
     $buffer->openHeader();
     $buffer->addHeader($head);
     $buffer->closeHeader();
     $buffer->openBody();
     //rows cycle
     //which selected communication has been seen by selected users?
     $_YES = Lang::t('_YES', 'standard');
     $_NO = Lang::t('_NO', 'standard');
     $arr_viewed = array();
     $query = "SELECT ct.idReference, c.title, c.type_of, c.start_date, c.end_date, ct.status, " . " ct.dateAttempt, ct.firstAttempt, ct.idUser, u.userid, u.firstname, u.lastname, " . " ct.current_score, ct.max_score, ct.num_attempts " . " FROM (%lms_games_track as ct " . " JOIN %lms_games as c ON (ct.idReference=c.id_game)) " . " JOIN %adm_user as u ON (ct.idUser=u.idst) " . " WHERE ct.idUser IN (" . implode(",", $arr_selected_users) . ") " . " AND c.id_game IN (" . implode(",", $arr_selected_comp) . ") " . ($start_date != '' ? " AND ct.dateAttempt >= '" . $start_date . "' " : "") . ($end_date != '' ? " AND ct.dateAttempt <= '" . $end_date . "' " : "") . " ORDER BY c.title, u.userid";
     $res = $this->db->query($query);
     if ($this->db->num_rows($res) <= 0) {
         cout('<p>' . $_ERR_NODATA . '</p>');
         return;
     }
     while ($obj = $this->db->fetch_obj($res)) {
         $line = array();
         $line[] = $obj->title;
         $line[] = isset($lang_type[$obj->type_of]) ? $lang_type[$obj->type_of] : '';
         $line[] = Format::date($obj->start_date, "date");
         $line[] = Format::date($obj->end_date, "date");
         $line[] = $acl_man->relativeId($obj->userid);
         $line[] = $obj->status == 'completed' || $obj->status == 'passed' ? $_YES : $_NO;
         $line[] = Format::date($obj->dateAttempt, "datetime");
         $line[] = Format::date($obj->firstAttempt, "datetime");
         $line[] = $obj->current_score;
         $line[] = $obj->max_score;
         $line[] = $obj->num_attempts;
         if ($this->use_mail) {
             $line[] = '<div class="align_center">' . Form::getInputCheckbox('mail_' . $obj->idUser, 'mail_recipients[]', $obj->idUser, isset($_POST['select_all']), '') . '</div>';
         }
         $buffer->addLine($line);
     }
     $buffer->closeBody();
     $buffer->closeTable();
     cout($buffer->get());
     $this->_loadEmailActions();
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:class.report_user.php

示例9: getUIMap

 /**
  * This method create an HTML UI for create the map of fields from
  * source to destination
  **/
 function getUIMap()
 {
     require_once _base_ . '/lib/lib.table.php';
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('organization_chart', 'framework');
     $form = new Form();
     $table = new Table(Get::sett('visuItem'), $lang->def('_IMPORT_MAP'), $lang->def('_IMPORT_MAP'));
     $src_cols = $this->source->get_cols_descripor();
     $dst_cols = $this->destination->get_cols_descripor();
     $combo_elements = array();
     foreach ($dst_cols as $col) {
         if (isset($col[DOCEBOIMPORT_COLID])) {
             $combo_elements[$col[DOCEBOIMPORT_COLID]] = $col[DOCEBOIMPORT_COLNAME];
         } else {
             $combo_elements[$col[DOCEBOIMPORT_COLNAME]] = $col[DOCEBOIMPORT_COLNAME];
         }
     }
     $combo_elements[DOCEBOIMPORT_IGNORE] = $lang->def('_IMPORT_IGNORE');
     $table_dst_labels = array();
     $table_src_labels = array();
     $table_src_labels_type = array();
     $count = 0;
     foreach ($src_cols as $col) {
         $pk = '0';
         $map = '';
         if (isset($this->import_map[$count])) {
             $pk = isset($this->import_map[$count]['pk']) ? $this->import_map[$count]['pk'] : "0";
             $map = isset($this->import_map[$count]['map']) ? $this->import_map[$count]['map'] : "";
         }
         $table_src_labels[] = $col[DOCEBOIMPORT_COLNAME] . $form->getInputCheckbox("import_map_" . $count . "_pk", "import_map[" . $count . "][pk]", "1", $pk == '1', '');
         $table_src_labels_type[] = '';
         $table_dst_labels[] = $form->getInputDropdown("dropdown_nowh", "import_map_" . $count . "_map", "import_map[" . $count . "][map]", $combo_elements, $map, "");
         $count++;
     }
     $table->setColsStyle($table_src_labels_type);
     $table->addHead($table_dst_labels);
     $table->addHead($table_src_labels);
     $count = 0;
     $row = $this->source->get_first_row();
     while ($row !== FALSE && $count < 10) {
         $table->addBody($row);
         $row = $this->source->get_next_row();
         $count++;
     }
     return $table->getTable();
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:50,代码来源:lib.iotask.php

示例10: getTitleArea

<?php

echo getTitleArea(array(Lang::t('_COMMUNICATIONS', 'communication')));
?>
<div class="std_block">
<?php 
//--- SEARCH FILTER -------
$this->widget('tablefilter', array('id' => 'communication', 'filter_text' => $filter_text, 'js_callback_set' => 'Communications.setFilter', 'js_callback_reset' => 'Communications.resetFilter', 'auxiliary_filter' => Form::getInputCheckbox('show_descendants', 'show_descendants', '1', $show_descendants ? true : false, '') . ' <label class="label_normal" for="show_descendants">' . Lang::t('_DIRECTORY_FILTER_FLATMODE', 'admin_directory') . '</label>'));
?>
<div class="panel_left_small">
<span class="title"><?php 
echo Lang::t('_ALL_CATEGORIES', 'communication');
?>
</span>
<?php 
//--- TREEVIEW -------
//Categories tree
$languages = array('_ROOT' => Lang::t('_COMMUNICATIONS', 'communication'), '_NEW_FOLDER_NAME' => Lang::t('_NEW_CATEGORY', 'course'), '_MOD' => Lang::t('_MOD', 'course'), '_AREYOUSURE' => Lang::t('_AREYOUSURE', 'standard'), '_NAME' => Lang::t('_NAME', 'standardt'), '_MOD' => Lang::t('_MOD', 'standard'), '_DEL' => Lang::t('_DEL', 'standard'), '_SAVE' => Lang::t('_SAVE', 'standard'), '_CONFIRM' => Lang::t('_CONFIRM', 'standard'), '_UNDO' => Lang::t('_UNDO', 'standard'), '_ADD' => Lang::t('_ADD', 'standard'), '_YES' => Lang::t('_YES', 'standard'), '_NO' => Lang::t('_NO', 'standard'), '_INHERIT' => Lang::t('_ORG_CHART_INHERIT', 'organization_chart'), '_NEW_FOLDER' => Lang::t('_NEW_FOLDER', 'organization_chart'), '_RENAMEFOLDER' => Lang::t('_MOD', 'standard'), '_DELETEFOLDER' => Lang::t('_DEL', 'standard'), '_AJAX_FAILURE' => Lang::t('_CONNECTION_ERROR', 'standard'));
$_tree_params = array('id' => 'category_tree', 'ajaxUrl' => 'ajax.adm_server.php?r=alms/communication/gettreedata', 'treeClass' => 'CommunicationsFolderTree', 'treeFile' => Get::rel_path('lms') . '/admin/views/communication/communicationfoldertree.js', 'languages' => $languages, 'initialSelectedNode' => $selected_category, 'dragDrop' => true, 'show' => 'tree');
if ($permissions['add_category']) {
    $rel_title = Lang::t('_NEW_CATEGORY', 'course');
    $rel_url = 'ajax.adm_server.php?r=alms/communication/add_category&id=' . $selected_category;
    $rel_action = '<a class="ico-wt-sprite subs_add" id="add_category" href="' . $rel_url . '" ' . ' title="' . $rel_title . '"><span>' . $rel_title . '</span></a>';
    $_tree_params['rel_action'] = $rel_action;
    //Add category dialog
    $this->widget('dialog', array('id' => 'add_category_dialog', 'dynamicContent' => true, 'ajaxUrl' => 'this.href', 'dynamicAjaxUrl' => true, 'callback' => 'Communications.addCategoryCallback', 'renderEvent' => 'Communications.dialogRenderEvent', 'callEvents' => array(array('caller' => 'add_category', 'event' => 'click'))));
}
$this->widget('tree', $_tree_params);
?>
</div>
开发者ID:abhinay100,项目名称:forma_app,代码行数:30,代码来源:show.php

示例11: subscribedel

function subscribedel()
{
    checkPerm('subscribe', false, 'course');
    require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.table.php';
    $id_course = importVar('id_course', true, 0);
    $course_to_save = Man_Course::saveCourseStatus();
    $edition_id = getCourseEditionId();
    $out =& $GLOBALS['page'];
    $lang =& DoceboLanguage::CreateInstance('subscribe', 'lms');
    $acl_man =& Docebo::user()->getAclManager();
    $levels = CourseLevel::getLevels();
    $user_alredy_subscribed = getSubscribed($id_course, false, false, true, $edition_id);
    $user_levels = getSubscribedLevel($id_course, false, false, $edition_id);
    require_once $GLOBALS['where_framework'] . '/lib/lib.adminmanager.php';
    $adminManager = new AdminManager();
    $acl_manager = new DoceboACLManager();
    $idst_associated = $adminManager->getAdminTree(getLogUserId());
    $array_user_associated =& $acl_manager->getAllUsersFromIdst($idst_associated);
    $user_level = Docebo::user()->getUserLevelId();
    if ($user_level != ADMIN_GROUP_GODADMIN) {
        $user_alredy_subscribed = array_intersect($user_alredy_subscribed, $array_user_associated);
    }
    $user_selected_info =& $acl_man->getUsers($user_alredy_subscribed);
    $GLOBALS['page']->add(getTitleArea($lang->def('_SUBSCRIBE'), 'subscribe') . '<div class="std_block">' . Form::openForm('levelselection', 'index.php?modname=subscribe&amp;op=subscriberemove') . Form::getHidden('id_course', 'id_course', $id_course) . Form::getHidden('edition_id', 'edition_id', $edition_id), 'content');
    $tb = new Table(0, $lang->def('_CAPTION_SELECT_LEVELS'), $lang->def('_SUMMARY_SELECT_LEVEL'));
    $type_h = array('', '', '', 'image');
    $content_h = array($lang->def('_USERNAME'), $lang->def('_FULLNAME'), $lang->def('_LEVEL'), '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '">');
    $tb->addHead($content_h, $type_h);
    $num_user_sel = 0;
    if (is_array($user_selected_info)) {
        reset($user_selected_info);
        while (list($id_user, $user_info) = each($user_selected_info)) {
            // if the user isn't alredy subscribed to the course
            $content = array(substr($user_info[ACL_INFO_USERID], 1), $user_info[ACL_INFO_LASTNAME] . ' ' . $user_info[ACL_INFO_FIRSTNAME], $levels[$user_levels[$id_user]], $content[] = Form::getInputCheckbox('user_to_remove' . $id_user, 'user_to_remove[' . $id_user . ']', $id_user, false, '') . '<label class="access-only" for="user_to_remove' . $id_user . '">' . $user_info[ACL_INFO_USERID] . '</label>');
            $tb->addBody($content);
        }
        $GLOBALS['page']->add($tb->getTable(), 'content');
    }
    $GLOBALS['page']->add(Form::openButtonSpace() . '<br />' . Form::getButton('subscribe', 'subscribe', $lang->def('_DEL')) . Form::getButton('cancelselector', 'cancelselector', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm(), 'content');
    $GLOBALS['page']->add('</div>', 'content');
}
开发者ID:abhinay100,项目名称:forma_app,代码行数:43,代码来源:subscribe.php

示例12: group

 function group()
 {
     checkPerm('view');
     require_once _base_ . '/lib/lib.form.php';
     require_once _base_ . '/lib/lib.navbar.php';
     require_once _base_ . '/lib/lib.table.php';
     $lang =& DoceboLanguage::createInstance('standard', 'lms');
     $field_search = importVar('field_search');
     $search = isset($_POST['search']) && $_POST['search'] != '' ? $_POST['search'] : false;
     if (isset($_POST['clear'])) {
         $search = false;
     }
     $acl_man =& Docebo::user()->getAclManager();
     $acl =& Docebo::user()->getAcl();
     $groups =& $acl_man->getAllGroupsId(array('free', 'moderate', 'private'), $search);
     $user_group_wait =& $acl_man->getPendingGroupOfUser(getLogUserId());
     $hidden_group = array();
     if (!isset($_POST['working'])) {
         $user_group = $acl->getSTGroupsST(getLogUserId());
         $user_group = array_flip($user_group);
     } else {
         if (isset($_POST['group_sel'])) {
             $user_group = $_POST['group_sel'];
             $hidden_group = array_diff($user_group, $groups);
         } else {
             $user_group = array();
         }
     }
     $GLOBALS['page']->add(getTitleArea($lang->def('_MYGROUP'), 'mygroup') . '<div class="std_block">' . Form::openForm('group_subscription', 'index.php?modname=mygroup&amp;op=group') . Form::getHidden('working', 'working', 1) . Form::getOpenFieldset($lang->def('_FILTER')) . Form::getTextfield($lang->def('_SEARCH_ARG'), 'search', 'search', '255', isset($_POST['search']) && !isset($_POST['clear']) ? $_POST['search'] : '') . Form::openButtonSpace() . Form::getButton('search_button', 'search_button', $lang->def('_SEARCH')) . ($search ? Form::getButton('clear', 'clear', $lang->def('_CLEAR')) : '') . Form::closeButtonSpace() . Form::getCloseFieldset() . Form::closeForm(), 'content');
     if (is_array($hidden_group)) {
         while (list(, $id) = each($hidden_group)) {
             $GLOBALS['page']->add(Form::getHidden('group_sel_' . $id, 'group_sel[' . $id . ']', $id), 'content');
         }
     }
     if (!empty($groups)) {
         $tb = new Table(0, $lang->def('_MYGROUP_CAPTION'), $lang->def('_MYGROUP_SUMMARY'));
         $type_h = array('image', 'nowrap', '');
         $cont_h = array('<span class="access-only">' . $lang->def('_SUBSCRIBE') . '</span>', $lang->def('_NAME'), $lang->def('_DESCRIPTION'));
         $tb->setColsStyle($type_h);
         $tb->addHead($cont_h);
         while (list($id, $info) = each($groups)) {
             echo $id;
             $cont = array();
             if (isset($user_group[$id])) {
                 $cont[] = Form::getInputCheckbox('group_sel_' . $id, 'group_sel[' . $id . ']', $id, isset($user_group[$id]), '');
                 $cont[] = $info['type_ico'] . ' ' . $info['groupid'] . '</label>';
                 $cont[] = $info['description'];
             } elseif (isset($user_group_wait[$id])) {
                 $cont[] = '<img src="' . getPathImage() . 'standard/userwait.gif" alt="' . $lang->def('_WAITING') . '" />';
                 $cont[] = '<label for="group_sel_' . $id . '">' . $info['type_ico'] . ' ' . $info['groupid'] . '</label>';
                 $cont[] = $info['description'];
             } elseif ($info['type'] != 'private' && $info['type'] != 'invisible') {
                 $cont[] = Form::getInputCheckbox('group_sel_' . $id, 'group_sel[' . $id . ']', $id, isset($user_group[$id]), '');
                 $cont[] = '<label for="group_sel_' . $id . '">' . $info['type_ico'] . ' ' . $info['groupid'] . '</label>';
                 $cont[] = $info['description'];
             }
             $tb->addBody($cont);
         }
         $GLOBALS['page']->add(Form::openForm('group_subscription_sec', 'index.php?modname=mygroup&amp;op=savesel') . Form::getHidden('search_hidden', 'search', '255', $search) . $tb->getTable() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm(), 'content');
     }
     $GLOBALS['page']->add('</div>', 'content');
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:62,代码来源:mygroup.php

示例13: loadCourseSelector

 function loadCourseSelector($noprint = false, $with_assesment = false)
 {
     require_once _base_ . '/lib/lib.table.php';
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('course', 'lms');
     $output = '';
     $output .= $this->treeview->load();
     // Filter
     $this->filter['course_flat'] = isset($_POST['c_flatview']);
     //$this->filter['course_code'] = ( isset($_POST['c_filter_code']) ? $_POST['c_filter_code'] : '' );
     $this->filter['course_name'] = isset($_POST['c_filter_name']) ? $_POST['c_filter_name'] : '';
     if ($this->show_filter === true) {
         $output .= '<div class="quick_search_form">' . '<div class="common_options">' . Form::getInputCheckbox('c_flatview', 'c_flatview', '1', Get::req('c_flatview', DOTY_INT, '0') == '1' ? true : false, ' onclick="submit();" ') . ' <label class="label_normal" for="c_flatview">' . Lang::t('_DIRECTORY_FILTER_FLATMODE', 'admin_directory') . '</label>' . '&nbsp;&nbsp;&nbsp;&nbsp;' . '</div>' . '<div>' . Form::getInputTextfield("search_t", "c_filter_name", "c_filter_name", Get::req('c_filter_name', DOTY_ALPHANUM, ''), '', 255, '') . Form::getButton("c_filter_set", "c_filter_set", Lang::t('_SEARCH', 'standard'), "search_b") . '</div>' . '</div>';
     }
     // End Filter
     $tb = new Table(Get::sett('visu_course'), $lang->def('_COURSE_LIST'), $lang->def('_COURSE_LIST_SUMMARY'));
     $tb->initNavBar('ini', 'button');
     $ini = $tb->getSelectedElement();
     $category_selected = $this->treeview->getSelectedFolderId();
     if ($this->filter['course_flat']) {
         $id_categories = $this->treeDB->getDescendantsId($this->treeDB->getFolderById($category_selected));
         $id_categories[] = $category_selected;
     }
     $select = "\r\n\t\tSELECT c.idCourse, c.code, c.name, c.description, c.status, c.difficult,\r\n\t\t\tc.subscribe_method, c.permCloseLo, c.show_rules, c.max_num_subscribe ";
     $query_course = "\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_course AS c\r\n\t\tWHERE " . ($with_assesment ? '1' : "c.course_type <> 'assessment'") . " AND c.idCategory IN ( " . (!$this->filter['course_flat'] ? $category_selected : implode(",", $id_categories)) . " )";
     if (Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) {
         $all_courses = false;
         require_once _base_ . '/lib/lib.preference.php';
         $adminManager = new AdminPreference();
         $admin_courses = $adminManager->getAdminCourse(Docebo::user()->getIdST());
         $all_courses = false;
         if (isset($admin_courses['course'][0])) {
             $all_courses = true;
         } elseif (isset($admin_courses['course'][-1])) {
             require_once _lms_ . '/lib/lib.catalogue.php';
             $cat_man = new Catalogue_Manager();
             $user_catalogue = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt());
             if (count($user_catalogue) > 0) {
                 $courses = array(0);
                 foreach ($user_catalogue as $id_cat) {
                     $catalogue_course =& $cat_man->getCatalogueCourse($id_cat, true);
                     $courses = array_merge($courses, $catalogue_course);
                 }
                 foreach ($courses as $id_course) {
                     if ($id_course != 0) {
                         $admin_courses['course'][$id_course] = $id_course;
                     }
                 }
             } elseif (Get::sett('on_catalogue_empty', 'off') == 'on') {
                 $all_courses = true;
             }
         } else {
             $array_courses = array();
             $array_courses = array_merge($array_courses, $admin_courses['course']);
             if (!empty($admin_courses['coursepath'])) {
                 require_once _lms_ . '/lib/lib.coursepath.php';
                 $path_man = new CoursePath_Manager();
                 $coursepath_course =& $path_man->getAllCourses($admin_courses['coursepath']);
                 $array_courses = array_merge($array_courses, $coursepath_course);
             }
             if (!empty($admin_courses['catalogue'])) {
                 require_once _lms_ . '/lib/lib.catalogue.php';
                 $cat_man = new Catalogue_Manager();
                 foreach ($admin_courses['catalogue'] as $id_cat) {
                     $catalogue_course =& $cat_man->getCatalogueCourse($id_cat, true);
                     $array_courses = array_merge($array_courses, $catalogue_course);
                 }
             }
             $admin_courses['course'] = array_merge($admin_courses['course'], $array_courses);
         }
         if (!$all_courses) {
             if (empty($admin_courses['course'])) {
                 $query_course .= " AND 0 ";
             } else {
                 $query_course .= " AND c.idCourse IN (" . implode(',', $admin_courses['course']) . ") ";
             }
         }
     }
     /*
     		if($this->filter['course_code'] != '') {
     			$query_course .= " AND c.code LIKE '%".$this->filter['course_code']."%'";
     		}*/
     if ($this->filter['course_name'] != '') {
         $query_course .= " AND ( c.code LIKE '%" . $this->filter['course_name'] . "%' OR c.name LIKE '%" . $this->filter['course_name'] . "%' ) ";
     }
     list($tot_course) = sql_fetch_row(sql_query("SELECT COUNT(*) " . $query_course));
     $query_course .= " ORDER BY c.name\r\n\t\t\t\t\t\t\tLIMIT " . $ini . "," . (int) Get::sett('visuItem', 25);
     $re_course = sql_query($select . $query_course);
     $type_h = array('image', '', '', '');
     $cont_h = array('<span class="access-only">' . $lang->def('_COURSE_SELECTION') . '</span>', $lang->def('_CODE'), $lang->def('_COURSE_NAME'), $lang->def('_STATUS'));
     $tb->setColsStyle($type_h);
     $tb->addHead($cont_h);
     $status_array = array(CST_PREPARATION => Lang::t('_CST_PREPARATION', 'course'), CST_AVAILABLE => Lang::t('_CST_AVAILABLE', 'course'), CST_EFFECTIVE => Lang::t('_CST_CONFIRMED', 'course'), CST_CONCLUDED => Lang::t('_CST_CONCLUDED', 'course'), CST_CANCELLED => Lang::t('_CST_CANCELLED', 'course'));
     while (list($id_course, $code, $name, $desc, $status, $difficult, $auto_sub, $end_mode, $show_rules, $max_user_sub) = sql_fetch_row($re_course)) {
         $tb_content = array(Form::getInputCheckbox('new_course_selected_' . $id_course, 'new_course_selected[' . $id_course . ']', $id_course, isset($this->current_selection[$id_course]), ''), '<label for="new_course_selected_' . $id_course . '">' . $code . '</label>', '<label for="new_course_selected_' . $id_course . '">' . $name . '</label>');
         $tb_content[] = $status_array[$status];
         $tb->addBody($tb_content);
         if (isset($this->current_selection[$id_course])) {
             unset($this->current_selection[$id_course]);
         }
//.........这里部分代码省略.........
开发者ID:abhinay100,项目名称:forma_app,代码行数:101,代码来源:lib.course.php

示例14: loadSimpleSelector

 function loadSimpleSelector($anonymous = true, $orgchart_button = false)
 {
     $res = "";
     require_once _base_ . '/lib/lib.table.php';
     require_once _base_ . "/lib/lib.form.php";
     $lang =& DoceboLanguage::createInstance('simplesel', 'framework');
     $form = new Form();
     $acl_manger = Docebo::user()->getAclManager();
     $anonymous_idst = $acl_manger->getAnonymousId();
     $res .= getBackUi($this->getLink("back"), $lang->def("_BACK"));
     if ($this->hasManualSelection()) {
         $msg = $lang->def('_MSG_HASMANUAL_1') . " \"" . $lang->def('_MANUAL_SEL') . "\" " . $lang->def('_MSG_HASMANUAL_2');
         $res .= getInfoUi($msg);
     }
     $url = $this->getLink("main");
     $res .= $form->openForm("simple_selector", $url);
     $vis_item = $GLOBALS["framework"]["visuItem"];
     $tab = new Table(2, $lang->def("_SIMPLESEL_TITLE"), $lang->def("_SIMPLESEL_TITLE"));
     $head_type = array('');
     $head = array($lang->def("_USERS"));
     foreach ($this->getPermList() as $key => $val) {
         $head_type[] = "image";
         $img = "<img src=\"" . $val["img"] . "\" alt=\"" . $val["alt"] . "\" ";
         $img .= "title=\"" . $val["alt"] . "\" />";
         $head[] = $img;
     }
     $tab->setColsStyle($head_type);
     $tab->addHead($head);
     $users_list = $this->getSimpleUserList();
     $saved_data = $this->getSavedData();
     if (!$anonymous) {
         unset($users_list[$anonymous_idst]);
     }
     foreach ($users_list as $idst => $label) {
         $rowcnt = array($label);
         foreach ($this->getPermList() as $key => $val) {
             $chk = false;
             if (isset($saved_data[$key]) && is_array($saved_data[$key])) {
                 if (in_array($idst, array_keys($saved_data[$key]))) {
                     $chk = true;
                 }
             }
             $check_box = $form->getLabel($key . "_" . $idst . "_", $lang->def("_VIEW") . " " . $label, "access-only");
             $check_box .= $form->getInputCheckbox($key . "_" . $idst . "_", $key . "[" . $idst . "]", 1, $chk, NULL);
             $rowcnt[] = $check_box;
         }
         $tab->addBody($rowcnt);
     }
     $res .= $tab->getTable();
     $res .= $form->getHidden("saved_data", "saved_data", urlencode(serialize($saved_data)));
     $res .= $form->openButtonSpace();
     if ($orgchart_button) {
         $res .= $form->getButton('orgchartselector', 'orgchartselector', $lang->def('_ORGCHART_SEL'), "transparent_aslink_button") . ' ';
     }
     $res .= $form->getButton('manualselector', 'manualselector', $lang->def('_MANUAL_SEL'), "transparent_aslink_button");
     $res .= $form->closeButtonSpace();
     $res .= $form->openButtonSpace();
     $res .= $form->getButton('okselector', 'okselector', $lang->def('_CONFIRM'));
     $res .= $form->getButton('cancelselector', 'cancelselector', $lang->def('_UNDO'));
     $res .= $form->closeButtonSpace();
     $res .= $form->closeForm();
     return $res;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:63,代码来源:lib.simplesel.php

示例15: 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


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