コード例 #1
0
ファイル: formuser.php プロジェクト: kostastzo/openeclass
    if ($am_required) {
        $am_text = $langCompulsory;
    } else {
        $am_text = $langOptional;
    }
    if ($prof) {
        $langUserData = $langInfoProfReq;
        $phone_star = $langCompulsory;
    } else {
        $langUserData = $langInfoStudReq;
        $phone_star = $langOptional;
    }
    $tool_content .= "<div class='alert alert-info'>{$langUserData}</div>";
    $tool_content .= "<div class='form-wrapper'>\n        <form class='form-horizontal' role='form' action='{$_SERVER['SCRIPT_NAME']}' method='post'>\n        <input type='hidden' name='p' value='{$prof}'>\n        <fieldset>          \n        <div class='form-group'>\n            <label for='Name' class='col-sm-2 control-label'>{$langName}:</label>\n            <div class='col-sm-10'>                       \n                <input type='text' name='givenname' value='" . q($givenname) . "' size='30' maxlength='60' placeholder='{$langName}'></td>\n            </div>\n        </div>\n        <div class='form-group'>\n            <label for='SurName' class='col-sm-2 control-label'>{$langSurname}:</label>\n            <div class='col-sm-10'>  \n                <input type='text' name='surname' value='" . q($surname) . "' size='30' maxlength='60' placeholder='{$langSurname}'>\n            </div>\n        </div>\n        <div class='form-group'>\n            <label for='UserPhone' class='col-sm-2 control-label'>{$langPhone}:</label>\n            <div class='col-sm-10'>\n                <input type='text' name='userphone' value='" . q($userphone) . "' size='20' maxlength='20' placeholder='{$phone_star}'>\n            </div>\n        </div>\n        <div class='form-group'>\n            <label for='UserName' class='col-sm-2 control-label'>{$langUsername}:</label>            \n            <div class='col-sm-10'>\n                <input type='text' name='username' size='30' maxlength='50' value='" . q($username) . "' placeholder='{$langUserNotice}'>\n            </div>\n        </div>\n        <div class='form-group'>\n            <label for='ProfEmail' class='col-sm-2 control-label'>{$langProfEmail}:</label>\n            <div class='col-sm-10'>\n                <input type='text' name='usermail' value='" . q($usermail) . "' size='30' maxlength='100' placeholder='{$langCompulsory}'>\n            </div>\n        </div>";
    if (!$prof) {
        $tool_content .= "<div class='form-group'>\n                <label for='ProfEmail' class='col-sm-2 control-label'>{$langAm}:</label>\n                <div class='col-sm-10'>\n                    <input type='text' name='am' value='" . q($am) . "' size='20' maxlength='20' placeholder='{$am_text}'>\n                </div>\n            </div>";
    }
    $tool_content .= "<div class='form-group'>\n            <label for='ProfComments' class='col-sm-2 control-label'>{$langComments}:</label>\n                <div class='col-sm-10'>\n                    <textarea name='usercomment' cols='30' rows='4' placeholder='{$profreason}'>" . q($usercomment) . "</textarea>\n                </div>\n            </div>\n            <div class='form-group'>\n                <label for='ProfComments' class='col-sm-2 control-label'>{$langFaculty}:</label>\n            <div class='col-sm-10'>";
    list($js, $html) = $tree->buildNodePicker(array('params' => 'name="department"', 'defaults' => $department, 'tree' => null, 'useKey' => 'id', 'where' => "AND node.allow_user = true", 'multiple' => false));
    $head_content .= $js;
    $tool_content .= $html;
    $tool_content .= "</div></div>";
    $tool_content .= "<div class='form-group'>\n              <label for='UserLang' class='col-sm-2 control-label'>{$langLanguage}:</label>\n              <div class='col-sm-10'>";
    $tool_content .= lang_select_options('localize', "class='form-control'");
    $tool_content .= "</div></div>";
    if (get_config("display_captcha")) {
        $tool_content .= "<div class='form-group'>                    \n                      <div class='col-sm-offset-2 col-sm-10'><img id='captcha' src='{$urlAppend}include/securimage/securimage_show.php' alt='CAPTCHA Image' /></div><br>\n                      <label for='Captcha' class='col-sm-2 control-label'>{$langCaptcha}:</label>\n                      <div class='col-sm-10'><input type='text' name='captcha_code' maxlength='6'/></div>\n                    </div>";
    }
    $tool_content .= "<div class='col-sm-offset-2 col-sm-10'>\n                    <input class='btn btn-primary' type='submit' name='submit' value='" . q($langSubmitNew) . "' />\n                    </div>\n        </fieldset>\n      </form>\n      </div>";
}
draw($tool_content, 0, null, $head_content);
コード例 #2
0
ファイル: searchcours.php プロジェクト: kostastzo/openeclass
            break;
        case "3":
            $typeSel[0] = "selected";
            break;
        default:
            $typeSel[-1] = "selected";
            break;
    }
}
$tool_content .= "<div class='form-group'>\n        <label for='formsearchtype' class='col-sm-2 control-label'>{$langCourseVis}:</label>\n        <div class='col-sm-10'>\n          <select class='form-control' name='formsearchtype'>\n           <option value='-1' " . @$typeSel[-1] . ">{$langAllTypes}</option>\n           <option value='2' " . @$typeSel[2] . ">{$langTypeOpen}</option>\n           <option value='1' " . @$typeSel[1] . ">{$langTypeRegistration}</option>\n           <option value='0' " . @$typeSel[0] . ">{$langTypeClosed}</option>\n           <option value='3' " . @$typeSel[3] . ">{$langCourseInactiveShort}</option>\n          </select>\n        </div>\n      </div>";
$reg_flag_data = array();
$reg_flag_data[1] = $langAfter;
$reg_flag_data[2] = $langBefore;
$tool_content .= "<div class='form-group'><label class='col-sm-2 control-label'>{$langCreationDate}:</label>";
$tool_content .= "<div class='col-sm-5'>" . selection($reg_flag_data, 'reg_flag', $reg_flag, 'class="form-control"') . "</div>";
$tool_content .= "<div class='col-sm-5'>";
$tool_content .= "<input class='form-control' id='id_date' name='date' type='text' value='{$date}' data-date-format='dd-mm-yyyy' placeholder='{$langCreationDate}'>                    \n                </div>";
$tool_content .= "</div>";
$tool_content .= "<div class='form-group'><label class='col-sm-2 control-label'>{$langFaculty}:</label>";
$tool_content .= "<div class='col-sm-10'>";
if (isDepartmentAdmin()) {
    list($js, $html) = $tree->buildNodePicker(array('params' => 'name="formsearchfaculte"', 'tree' => array('0' => $langAllFacultes), 'useKey' => "id", 'multiple' => false, 'allowables' => $user->getDepartmentIds($uid)));
} else {
    list($js, $html) = $tree->buildNodePicker(array('params' => 'name="formsearchfaculte"', 'tree' => array('0' => $langAllFacultes), 'useKey' => "id", 'multiple' => false));
}
$head_content .= $js;
$tool_content .= $html;
$tool_content .= "</div></div>";
$tool_content .= "<div class='form-group'>\n                    <div class='col-sm-10 col-sm-offset-2'>\n                        <input class='btn btn-primary' type='submit' name='search_submit' value='{$langSearch}'>\n                        <a href='index.php' class='btn btn-default'>{$langCancel}</a>        \n                    </div>\n      </div>";
$tool_content .= "</fieldset></form></div>";
draw($tool_content, 3, null, $head_content);
コード例 #3
0
ファイル: search_user.php プロジェクト: nikosv/openeclass
//Preparing form data
$usertype_data = array(
    0 => $langAllUsers,
    USER_TEACHER => $langTeacher,
    USER_STUDENT => $langStudent,
    USER_GUEST => $langGuest);
$verified_mail_data = array(
    EMAIL_VERIFICATION_REQUIRED => $m['pending'],
    EMAIL_VERIFIED => $m['yes'],
    EMAIL_UNVERIFIED => $m['no'],
    3 => $langAllUsers);
$authtype_data = $auth_ids;
$authtype_data[0] = $langAllAuthTypes;

$tree = new Hierarchy();
list($js, $html) = $tree->buildNodePicker($depts_defaults);
$head_content .= $js;

// display the search form
$tool_content .= "
<div class='form-wrapper'>
<form class='form-horizontal' role='form' action='listusers.php' method='get' name='user_search'>
<fieldset>
    <div class='form-group'>
        <label for='uname' class='col-sm-2 control-label'>$langUsername:</label>
        <div class='col-sm-10'>
            <input class='form-control' type='text' name='uname' id='uname' value='" . q($uname) . "'>
        </div>
    </div>
    <div class='form-group'>
        <label for='fname' class='col-sm-2 control-label'>$langName:</label>
コード例 #4
0
ファイル: hierarchy.php プロジェクト: kostastzo/openeclass
            $tree->addNode($name, intval($_POST['nodelft']), $code, $allow_course, $allow_user, $order_priority);
            $tool_content .= "<div class='alert alert-success'>" . $langAddSuccess . "</div>";
        }
    } else {
        // Display form for new node information
        $tool_content .= "<div class='form-wrapper'>\n            <form role='form' class='form-horizontal' method=\"post\" action=\"" . $_SERVER['SCRIPT_NAME'] . "?action=add\" onsubmit=\"return validateNodePickerForm();\">\n            <fieldset>\n            <div class='form-group'>\n                <label class='col-sm-3 control-label'>{$langNodeCode1}:</label>\n                <div class='col-sm-9'>\n                    <input type='text' name='code' placeholder='{$langCodeFaculte2}'>\n                </div>\n            </div>";
        $i = 0;
        foreach ($session->active_ui_languages as $key => $langcode) {
            $tool_content .= "<div class='form-group'>\n                        <label class='col-sm-3 control-label'>{$langNodeName}:</label>";
            $tdpre = $i >= 0 ? "<div class='col-sm-9'>" : '';
            $placeholder = "{$langFaculte2} (" . $langNameOfLang[langcode_to_name($langcode)] . ")";
            $tool_content .= $tdpre . "<input type='text' name='name-" . $langcode . "' placeholder='{$placeholder}'></div></div>";
            $i++;
        }
        $tool_content .= "<div class='form-group'>\n                        <label class='col-sm-3 control-label'>{$langNodeParent}:</label>\n                        <div class='col-sm-9'>";
        list($js, $html) = $tree->buildNodePicker(array('params' => 'name="nodelft"', 'tree' => array('0' => 'Top'), 'useKey' => 'lft', 'multiple' => false, 'defaults' => $user->getDepartmentIds($uid), 'allow_only_defaults' => !$is_admin));
        $head_content .= $js;
        $tool_content .= $html;
        $tool_content .= "<span class='help-block'><small>{$langNodeParent2}</small></span>\n        </div></div>\n        <div class='form-group'>\n          <label class='col-sm-3 control-label'>{$langNodeAllowCourse}:</label>\n            <div class='col-sm-9'>\n                  <input type='checkbox' name='allow_course' value='1' checked='checked'><span class='help-block'><small>{$langNodeAllowCourse2}</small></span>\n          </div>\n        </div>\n        <div class='form-group'>\n        <label class='col-sm-3 control-label'>{$langNodeAllowUser}</label>\n          <div class='col-sm-9'>\n              <input type='checkbox' name='allow_user' value='1' checked='checked'><span class='help-block'><small>{$langNodeAllowUser2}</small></span>\n          </div>\n        </div>\n        <div class='form-group'>\n        <label class='col-sm-3 control-label'>{$langNodeOrderPriority}</label>      \n          <div class='col-sm-9'>\n              <input type='text' name='order_priority'><span class='help-block'><small>{$langNodeOrderPriority2}</small></span>\n          </div>\n        </div>\n        <div class='form-group'>\n          <div class='col-sm-10 col-sm-offset-2'>\n              <input class='btn btn-primary' type='submit' name='add' value='" . $langAdd . "' />\n          </div>\n        </div>\n        </fieldset>\n        </form>\n        </div>";
    }
} elseif (isset($_GET['action']) and $_GET['action'] == 'delete') {
    $id = intval($_GET['id']);
    validateNode($id, isDepartmentAdmin());
    // locate the lft and rgt of the node we want to delete
    $node = Database::get()->querySingle("SELECT lft, rgt from hierarchy WHERE id = ?d", $id);
    if ($node !== false) {
        // locate the subtree of the node we want to delete. the subtree contains the node itself
        $subres = Database::get()->queryArray("SELECT id FROM hierarchy WHERE lft BETWEEN ?d AND ?d", intval($node->lft), intval($node->rgt));
        $c = 0;
        // for each subtree node, check if it has belonging children (courses, users)
        foreach ($subres as $subnode) {
コード例 #5
0
ファイル: newuseradmin.php プロジェクト: kostastzo/openeclass
     $title = $langInsertUserInfo;
 } else {
     $pageName = $langProfReg;
     $title = $langNewProf;
 }
 $tool_content .= "<div class='form-wrapper'>\n        <form class='form-horizontal' role='form' action='{$_SERVER['SCRIPT_NAME']}' method='post' onsubmit='return validateNodePickerForm();'>\n        <fieldset>\n        <div class='form-group'>\n        <label for='Name' class='col-sm-2 control-label'>{$langName}:</label>\n            <div class='col-sm-10'>\n              <input class='form-control' id='Name' type='text' name='givenname_form' value='" . q($pn) . "' placeholder='{$langName}'>\n            </div>\n        </div>\n        <div class='form-group'>\n        <label for='Sur' class='col-sm-2 control-label'>{$langSurname}:</label>\n            <div class='col-sm-10'>\n              <input class='form-control' id='Sur' type='text' name='surname_form' value='" . q($ps) . "' placeholder='{$langSurname}'>\n            </div>\n        </div>\n        <div class='form-group'>\n        <label for='Username' class='col-sm-2 control-label'>{$langUsername}:</label>\n            <div class='col-sm-10'>\n                <input class='form-control' id='Username' type='text' name='uname' value='" . q($pu) . "' autocomplete='off' placeholder='{$langUsername}'>\n            </div>\n        </div>\n        <div class='form-group'>\n        <label for='passsword' class='col-sm-2 control-label'>{$langPass}:</label>\n            <div class='col-sm-10'>\n              <input class='form-control' type='text' name='password' value='" . genPass() . "' id='password' autocomplete='off'  placeholder='{$langPass}'/><span id='result'></span>\n            </div>\n        </div>\n        <div class='form-group'>\n        <label for='email' class='col-sm-2 control-label'>{$langEmail}:</label>\n            <div class='col-sm-10'>\n              <input class='form-control' id='email' type='text' name='email_form' value='" . q($pe) . "' palceholder='{$langEmail}'>\n            </div>\n        </div>\n        <div class='form-group'>\n          <label for='emailverified' class='col-sm-2 control-label'>{$langEmailVerified}:</label>\n            <div class='col-sm-10'>";
 $verified_mail_data = array(0 => $m['pending'], 1 => $m['yes'], 2 => $m['no']);
 if (isset($pv)) {
     $tool_content .= selection($verified_mail_data, "verified_mail_form", $pv, "class='form-control'");
 } else {
     $tool_content .= selection($verified_mail_data, "verified_mail_form", '', "class='form-control'");
 }
 $tool_content .= "</div></div>\n        <div class='form-group'>\n        <label for='phone' class='col-sm-2 control-label'>{$langPhone}:</label>\n            <div class='col-sm-10'>            \n                <input class='form-control' id='phone' type='text' name='phone' value='" . q($pphone) . "' placeholder='{$langPhone}'>\n            </div>\n        </div>\n        <div class='form-group'>\n        <label for='faculty' class='col-sm-2 control-label'>{$langFaculty}:</label>\n            <div class='col-sm-10'>";
 $depid = isset($pt) ? $pt : null;
 if (isDepartmentAdmin()) {
     list($js, $html) = $tree->buildNodePicker(array('params' => 'name="department"', 'defaults' => $depid, 'tree' => null, 'useKey' => 'id', 'where' => "AND node.allow_user = true", 'multiple' => false, 'allowables' => $user->getDepartmentIds($uid)));
 } else {
     list($js, $html) = $tree->buildNodePicker(array('params' => 'name="department"', 'defaults' => $depid, 'tree' => null, 'useKey' => 'id', 'where' => "AND node.allow_user = true", 'multiple' => false));
 }
 $head_content .= $js;
 $tool_content .= $html;
 $tool_content .= "</div></div>\n        <div class='form-group'>\n        <label for='am' class='col-sm-2 control-label'>{$langAm}:</label>\n           <div class='col-sm-10'>\n               <input class='form-control' id='am' type='text' name='am' value='" . q($pam) . "' placeholder='{$langOptional}'>\n           </div>\n        </div>\n        <div class='form-group'>\n        <label for='lang' class='col-sm-2 control-label'>{$langLanguage}:</label>\n        <div class='col-sm-10'>";
 $tool_content .= lang_select_options('language', "class='form-control'", $language);
 $tool_content .= "</div></div>";
 if (isset($_GET['id'])) {
     @($tool_content .= "<div class='form-group'><label for='comments' class='col-sm-2 control-label'>{$langComments}</label>\n                                <div class='col-sm-10'>" . q($pcom) . "</div>\n                            </div>\n                            <div class='form-group'><label for='date' class='col-sm-2 control-label'>{$langDate}</label>\n                                <div class='col-sm-10'>" . q($pdate) . "</div></div>");
     $tool_content .= "<input type='hidden' name='rid' value='{$id}' />";
 }
 $tool_content .= "<div class='col-sm-offset-2 col-sm-10'>                   \n                            <input class='btn btn-primary' type='submit' name='submit' value='{$langRegistration}'>\n                        </div>              \n        <input type='hidden' name='pstatus' value='{$pstatus}' />\n        <input type='hidden' name='auth' value='1' />\n        </fieldset>\n        </form>\n        </div>";
 if ($pstatus == 5) {
     $reqtype = '?type=user';
コード例 #6
0
ファイル: hierarchy.php プロジェクト: nikosv/openeclass
                </div>
            </div>";
            $i = 0;
            foreach ($session->active_ui_languages as $key => $langcode) {
                $tool_content .= "<div class='form-group'>
                        <label class='col-sm-3 control-label'>$langNodeName:</label>";
                $tdpre = ($i >= 0) ? "<div class='col-sm-9'>" : '';
                $placeholder = "$langFaculte2 (" . $langNameOfLang[langcode_to_name($langcode)] . ")";
                $tool_content .= $tdpre . "<input class='form-control' type='text' name='name-" . $langcode . "' placeholder='$placeholder'></div></div>";
                $i++;
            }

        $tool_content .= "<div class='form-group'>
                        <label class='col-sm-3 control-label'>$langNodeParent:</label>
                        <div class='col-sm-9'>";
        list($js, $html) = $tree->buildNodePicker(array('params' => 'name="parentid"', 'tree' => array('0' => 'Top'), 'multiple' => false, 'defaults' => $user->getDepartmentIds($uid), 'allow_only_defaults' => (!$is_admin)));
        $head_content .= $js;
        $tool_content .= $html;
        $tool_content .= "<span class='help-block'><small>$langNodeParent2</small></span>
        </div></div>
        <div class='form-group'>
          <label class='col-sm-3 control-label'>$langNodeAllowCourse:</label>
            <div class='col-sm-9'>
                  <input class='form-control' type='checkbox' name='allow_course' value='1' checked='checked'><span class='help-block'><small>$langNodeAllowCourse2</small></span>
          </div>
        </div>
        <div class='form-group'>
        <label class='col-sm-3 control-label'>$langNodeAllowUser</label>
          <div class='col-sm-9'>
              <input class='form-control' type='checkbox' name='allow_user' value='1' checked='checked'><span class='help-block'><small>$langNodeAllowUser2</small></span>
          </div>
コード例 #7
0
ファイル: newuseradmin.php プロジェクト: nikosv/openeclass
$active_auth_methods = get_auth_active_methods();
$eclass_method_unique = count($active_auth_methods) == 1 && $active_auth_methods[0] == 1;

$verified_mail_data = array(0 => $m['pending'], 1 => $m['yes'], 2 => $m['no']);

$nodePickerParams = array(
    'params' => 'name="department"',
    'defaults' => $depid,
    'tree' => null,
    'where' => "AND node.allow_user = true",
    'multiple' => false);
if (isDepartmentAdmin()) {
    $nodePickerParams['allowables'] = $user->getDepartmentIds($uid);
}
list($tree_js, $tree_html) = $tree->buildNodePicker($nodePickerParams);
$head_content .= $tree_js;

if ($eclass_method_unique) {
    $tool_content .= "<input type='hidden' name='auth_form' value='1'>";
} else {
    $auth_m = array();
    foreach ($active_auth_methods as $m) {
        $auth_m[$m] = get_auth_info($m);
    }
    formGroup('auth_selection', $langEditAuthMethod,
        selection($auth_m, 'auth_form', '', "id='auth_selection' class='form-control'"));
}

formGroup('passsword_form', $langPass,
    "<input class='form-control' type='text' name='password'" .