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


PHP DialogBox::form方法代码示例

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


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

示例1: list

         $dialogBox->error(get_lang('This tool can not be uninstalled.'));
     } else {
         list($backlog, $success) = uninstall_module($module_id, $deleteModuleDatabase);
         $details = $backlog->output();
         if ($success) {
             $summary = get_lang('Module uninstallation succeeded');
             $dialogBox->success(Backlog_Reporter::report($summary, $details));
         } else {
             $summary = get_lang('Module uninstallation failed');
             $dialogBox->error(Backlog_Reporter::report($summary, $details));
         }
     }
     break;
 case 'rqUninstall':
     $moduleInfo = get_module_info($module_id);
     $dialogBox->form('<p>' . get_lang('Are you sure you want to delete module %module% ?', array('%module%' => $moduleInfo['module_name'])) . '</p>' . '<form enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . '<input type="hidden" name="module_id" value="' . $module_id . '" />' . '<input name="cmd" type="hidden" value="exUninstall" />' . "\n" . '<input name="deleteModuleDatabase" id="deleteModuleDatabase" type="checkbox" checked="checked" />' . '<label for="deleteModuleDatabase">' . get_lang('Also delete module main database') . '</label>' . '<br />' . "\n" . '<br />' . "\n" . '<input value="' . get_lang('Continue') . '" type="submit" onclick="return confirmation(\'' . $moduleInfo['module_name'] . '\');" />' . '&nbsp;' . "\n" . claro_html_button($_SERVER['PHP_SELF'], get_lang('Cancel')) . '</form>' . "\n");
     break;
 case 'exInstall':
     // call by rqInstall
     //1 GET THE FILE
     //2 UNZIP IF ZIPPED
     //3 INSTALL
     $moduleInstallable = false;
     //include needed librabries for treatment
     //1 GET THE FILE
     // File can be an uploaded package file
     // or a local package file
     // or a local unpackaged file
     // later: an url to a package file)
     // later: a local repository of many packages
     // Actually interface display two input, and only one must be filed. If the user give both , the uploaded package win.
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:module_list.php

示例2: jQuery

 if (is_null($date)) {
     $CssLoader = CssLoader::getInstance();
     $CssLoader->load('ui.datepicker');
     $JsLoader = JavascriptLoader::getInstance();
     $JsLoader->load('jquery');
     $JsLoader->load('ui.datepicker');
     $javascript = '
         <script type="text/javascript" charset="utf-8">
             jQuery(function($){
                 $("#dateinput").datepicker({dateFormat: \'dd/mm/yy\'});
             });
         </script>';
     $claroline->display->header->addHtmlHeader($javascript);
     $disp = get_lang('Choose a date') . ' :<br />' . '<form action="' . $_SERVER['PHP_SELF'] . '?cmd=rqOlderThan" method="post">' . '<input type="text" name="date" value="' . date('d/m/Y') . '" id="dateinput" /> ' . get_lang('(jj/mm/aaaa)') . '<br />' . '<input type="submit" value="' . get_lang('Delete') . '" />' . '</form>';
     $dialogBox = new DialogBox();
     $dialogBox->form($disp);
     $content .= $dialogBox->render();
 } else {
     $javascriptDelete = '
         <script type="text/javascript">
         if (confirm("' . get_lang('Are you sure to delete all messages older than %date?', array('%date' => $date)) . "\n\n" . get_lang('There is no way to restore deleted messages.') . '"));
         {
             window.location=\'' . $_SERVER['PHP_SELF'] . '?cmd=exOlderThan&amp;date=' . urlencode($date) . '\';
         }
         else
         {
             window.location=\'admin.php\';
         }
         </script>';
     $claroline->display->header->addHtmlHeader($javascriptDelete);
     $dialogBox = new DialogBox();
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:admin_delete.php

示例3: array

 */
if (isset($_REQUEST['registration'])) {
    //RECHECK if subscribe is aivailable
    if (claro_is_course_member() && !claro_is_group_member() && $is_allowedToSelfRegInGroup) {
        if (isset($_REQUEST['doReg'])) {
            //RECHECK if subscribe is aivailable
            if (claro_is_course_member() && !claro_is_group_member() && $is_allowedToSelfRegInGroup) {
                $sql = "INSERT INTO `" . $tbl_group_rel_team_user . "`\n                SET `user` = " . (int) claro_get_current_user_id() . ",\n                    `team` = " . (int) claro_get_current_group_id();
                if (claro_sql_query($sql)) {
                    // REFRESH THE SCRIPT TO COMPUTE NEW PERMISSIONS ON THE BASSIS OF THIS CHANGE
                    claro_redirect($_SERVER['PHP_SELF'] . '?gidReset=1&gidReq=' . claro_get_current_group_id() . '&regDone=1');
                    exit;
                }
            }
        } else {
            $dialogBox->form(get_lang('Confirm your subscription to the group &quot;<b>%group_name</b>&quot;', array('%group_name' => claro_get_current_group_data('name'))) . "\n" . '<form action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="registration" value="1" />' . "\n" . '<input type="hidden" name="doReg" value="1" />' . "\n" . '<br />' . "\n" . '<input type="submit" value="' . get_lang("Ok") . '" />' . "\n" . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'])), get_lang("Cancel")) . "\n" . '</form>' . "\n");
        }
    }
}
if (isset($_REQUEST['regDone'])) {
    $dialogBox->success(get_lang("You are now a member of this group."));
}
if (isset($_REQUEST['unregistration'])) {
    //RECHECK if subscribe is aivailable
    if (claro_is_course_member() && claro_is_group_member() && $is_allowedToSelfUnregInGroup) {
        if (isset($_REQUEST['doUnreg'])) {
            //RECHECK if subscribe is aivailable
            if (claro_is_course_member() && claro_is_group_member() && $is_allowedToSelfUnregInGroup) {
                $sql = "DELETE FROM `" . $tbl_group_rel_team_user . "`\n                WHERE `user` = " . (int) claro_get_current_user_id() . "\n                AND    `team` = " . (int) claro_get_current_group_id();
                if (claro_sql_query($sql)) {
                    // REFRESH THE SCRIPT TO COMPUTE NEW PERMISSIONS ON THE BASSIS OF THIS CHANGE
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:group_space.php

示例4: uniqid

         $dialogBox->error(get_lang('Error : Can not delete all classes'));
     }
     break;
     // Empty all classes
 // Empty all classes
 case 'exEmptyAll':
     if (empty_all_class()) {
         $dialogBox->success(get_lang('All classes emptied'));
     } else {
         $dialogBox->error(get_lang('Error : Can not empty all classes'));
     }
     break;
     // Display form to create a new class
 // Display form to create a new class
 case 'rqAdd':
     $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '" method="post" >' . "\n" . '<input type="hidden" name="cmd" value="exAdd" />' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . '<table>' . "\n" . '<tr>' . "\n" . '<td>' . get_lang('New Class name') . ' : ' . '</td>' . "\n" . '<td>' . "\n" . '<input type="text" name="class_name" />' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '<tr>' . "\n" . '<td>' . get_lang('Location') . ' :' . '</td>' . "\n" . '<td>' . "\n" . displaySelectBox() . '<input type="submit" value=" Ok " />' . "\n" . '</td>' . "\n" . '</tr>' . "\n" . '</table>' . "\n" . '</form>' . "\n ");
     break;
     // Create a new class
 // Create a new class
 case 'exAdd':
     if (empty($form_data['class_name'])) {
         $dialogBox->warning(get_lang('You cannot give a blank name to a class'));
     } else {
         if (class_create($form_data['class_name'], $form_data['class_parent_id'])) {
             $dialogBox->success(get_lang('The new class has been created'));
         }
     }
     break;
     // Edit class properties with posted form
 // Edit class properties with posted form
 case 'exEdit':
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:admin_class.php

示例5: claro_html_msg_list

/**
* Display list of messages in substyled boxes in a message_box
*
* In most of cases  function message_box() is enough.
*
* @param array $msgArrBody of array of blocs containing array of messages
* @author Christophe Gesche <moosh@claroline.net>
* @version 1.0
* @see  message_box()
*
*  code for using this    in your    tools:
*  $msgArrBody["nameOfCssClass"][]="foo";
*  css    class can be defined in    script but try to use
*  class from    generic    css    ()
*  error success warning
*  ...
*
* @todo this must be a message object where code add messages with a priority,
* and the rendering is set by by priority
*
*/
function claro_html_msg_list($msgArrBody, $return = true)
{
    $msgBox = '';
    if (is_array($msgArrBody) && count($msgArrBody) > 0) {
        foreach ($msgArrBody as $classMsg => $thisMsgArr) {
            if (is_array($thisMsgArr)) {
                $msgBox .= '<div class="' . $classMsg . '">';
                foreach ($thisMsgArr as $anotherThis) {
                    $msgBox .= '<div class="msgLine" >' . $anotherThis . '</div>';
                }
                $msgBox .= '</div>';
            } else {
                $msgBox .= '<div class="' . $classMsg . '">';
                $msgBox .= '<div class="msgLine" >' . $thisMsgArr . '</div>';
                $msgBox .= '</div>';
            }
        }
    }
    $dialogBox = new DialogBox();
    if ($msgBox) {
        $dialogBox->form($msgBox);
    }
    if ($return) {
        return $dialogBox->render();
    } else {
        echo $dialogBox->render();
    }
    return true;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:50,代码来源:html.lib.php

示例6: elseif

}
if ('show' != $cmd) {
    if ('default' == $anonymityStatus) {
        $info = '<tr valign="top">' . "\n" . '<td>&nbsp;</td>' . '<td><strong>' . get_lang('Contributions to this forum are anonymous by default!<br/>') . get_lang('If you want to sign your post all the same, uncheck the checkbox above the "OK" button') . '</strong></td>' . '</tr>' . '<tr style="height:1px;"><td colspan="2">&nbsp;</td></tr>';
    } elseif ('allowed' == $anonymityStatus) {
        $info = '<tr valign="top">' . "\n" . '<td>&nbsp;</td>' . '<td><strong>' . get_lang('This forum allows anonymous contributions!<br/>') . get_lang('If you do not want to sign your post, check the checkbox above the "OK" button') . '</strong></td>' . '</tr>' . '<tr style="height:1px;"><td colspan="2">&nbsp;</td></tr>';
    }
    if (!empty($info)) {
        $dialogBox->info($info);
    }
}
$out .= $dialogBox->render();
//display edit form if any
if (isset($form)) {
    $formBox = new DialogBox();
    $formBox->form($form->render());
    $out .= $formBox->render() . '<hr />';
}
//display topic review if any
if ($topicSettingList) {
    // get post and use pager
    if (!$viewall) {
        $postLister = new postLister($topicId, $start, get_conf('posts_per_page'));
    } else {
        $postLister = new postLister($topicId, $start, get_total_posts($topicId, 'topic'));
        $incrementViewCount = false;
    }
    // get post and use pager
    $postList = $postLister->get_post_list();
    $totalPosts = $postLister->sqlPager->get_total_item_count();
    $pagerUrl = claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?topic=' . $topicId));
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:viewtopic.php

示例7: MAX

                // determine the default order of this Learning path
                $result = claro_sql_query("SELECT MAX(`rank`)\n                                               FROM `" . $TABLELEARNPATH . "`");
                list($orderMax) = mysql_fetch_row($result);
                $order = $orderMax + 1;
                // create new learning path
                $sql = "INSERT\n                              INTO `" . $TABLELEARNPATH . "`\n                                     (`name`, `comment`, `rank`)\n                              VALUES ('" . claro_sql_escape($_POST['newPathName']) . "','" . claro_sql_escape(trim($_POST['newComment'])) . "'," . (int) $order . ")";
                //echo $sql;
                $lp_id = claro_sql_query_insert_id($sql);
                // notify the creation to eventmanager
                $eventNotifier->notifyCourseEvent("learningpath_created", claro_get_current_course_id(), claro_get_current_tool_id(), $lp_id, claro_get_current_group_id(), "0");
            } else {
                // display error message
                $dialogBox->error(get_lang('Error : Name already exists in the learning path or in the module pool'));
            }
        } else {
            $dialogBox->form("\n\n" . '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<fieldset>' . claro_form_relay_context() . '<h4>' . get_lang('Create a new learning path') . '</h4>' . "\n" . '<dl>' . '<dt><label for="newPathName">' . get_lang('Title') . '</label></dt>' . "\n" . '<dd><input type="text" name="newPathName" id="newPathName" maxlength="255" /></dd>' . "\n" . '<dt><label for="newComment">' . get_lang('Comment') . '</label></dt>' . "\n" . '<dd>' . claro_html_textarea_editor('newComment', '', 15, 55) . '</dd>' . '</dl>' . "\n" . '</fieldset>' . "\n" . '<input type="hidden" name="cmd" value="create" />' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp;' . "\n" . claro_html_button('learningPathList.php', get_lang('Cancel')) . '</form>' . "\n");
        }
        break;
}
// IF ORDER COMMAND RECEIVED
// CHANGE ORDER
if (isset($sortDirection) && $sortDirection) {
    $sql = "SELECT `learnPath_id`, `rank`\n            FROM `" . $TABLELEARNPATH . "`\n            ORDER BY `rank` {$sortDirection}";
    $result = claro_sql_query($sql);
    // LP = learningPath
    while (list($LPId, $LPOrder) = mysql_fetch_row($result)) {
        // STEP 2 : FOUND THE NEXT ANNOUNCEMENT ID AND ORDER.
        //          COMMIT ORDER SWAP ON THE DB
        if (isset($thisLPOrderFound) && $thisLPOrderFound == true) {
            $nextLPId = $LPId;
            $nextLPOrder = $LPOrder;
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:learningPathList.php

示例8: uniqid

         /*--------------------------------------------------------------------
            IN CASE OF HTML FILE, LOOKS FOR IMAGE NEEDING TO BE UPLOADED TOO
           --------------------------------------------------------------------*/
         if (preg_match('/.htm$/i', $_FILES['userFile']['name']) || preg_match('/.html$/i', $_FILES['userFile']['name'])) {
             $imgFilePath = search_img_from_html($baseWorkDir . $cwd . '/' . $uploadedFileName);
             /*
              * Generate Form for image upload
              */
             if (sizeof($imgFilePath) > 0) {
                 $dialogBox->warning(get_lang("Missing images detected"));
                 $form = '<form method="post" action="' . claro_htmlspecialchars($_SERVER['PHP_SELF']) . '" ' . 'enctype="multipart/form-data">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . '<input type="hidden" name="cmd" value="submitImage" />' . "\n" . '<input type="hidden" name="relatedFile" ' . ' value="' . $cwd . '/' . $uploadedFileName . '" />' . "\n" . '<table border="0">' . "\n";
                 foreach ($imgFilePath as $thisImgKey => $thisImgFilePath) {
                     $form .= '<tr>' . "\n" . '<td>' . "\n" . '<label for="' . $thisImgKey . '">' . basename($thisImgFilePath) . ' : </label>' . "\n" . '</td>' . "\n" . '<td>' . '<input type="file"  id="' . $thisImgKey . '" name="imgFile[]" />' . "\n" . '<input type="hidden" name="imgFilePath[]"  value="' . $thisImgFilePath . '" />' . '</td>' . "\n" . '</tr>' . "\n";
                 }
                 $form .= '<tr>' . "\n" . '<td>&nbsp;</td>' . "\n" . '<td>' . "\n" . '<input type="submit" name="submitImage" value="' . get_lang("Ok") . '" />&nbsp;' . "\n" . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChDir&file=' . base64_encode($cwd))), get_lang("Cancel")) . '</td>' . "\n" . '</tr>' . "\n\n" . '</table>' . "\n" . '</form>' . "\n";
                 $dialogBox->form($form);
             }
             // end if ($imgFileNb > 0)
         }
         // end if (strrchr($fileName) == "htm"
     }
     // end if is_uploaded_file
 }
 // end if ($cmd == 'exUpload')
 if ($cmd == 'rqUpload') {
     /*
      * Prepare dialog box display
      */
     $spaceAlreadyOccupied = dir_total_space($baseWorkDir);
     $remainingDiskSpace = $maxFilledSpace - $spaceAlreadyOccupied;
     $maxUploadSize = get_max_upload_size($maxFilledSpace, $baseWorkDir);
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:document.php

示例9: unenroll

          Display user courses in order to unenroll (default display)
          ---------------------------------------------------------------------*/
    /*---------------------------------------------------------------------
      Display user courses in order to unenroll (default display)
      ---------------------------------------------------------------------*/
    case DISPLAY_USER_COURSES:
        $out .= claro_html_tool_title(array('mainTitle' => get_lang('User\'s course') . ' : ' . $userInfo['firstname'] . ' ' . $userInfo['lastname'], 'subTitle' => get_lang('Remove course from your personal course list'))) . $dialogBox->render() . $courseListView->render();
        break;
    case DISPLAY_REGISTRATION_KEY_FORM:
        $courseData = claro_get_course_data($_REQUEST['course']);
        $courseName = $courseData['name'];
        $out .= claro_html_tool_title(array('mainTitle' => get_lang('User\'s course') . ' : ' . $userInfo['firstname'] . ' ' . $userInfo['lastname'], 'subTitle' => get_lang('Enrol to %course', array('%course' => $courseName))));
        $template = new CoreTemplate('course_registration_key_form.tpl.php');
        $template->assign('formAction', Url::Contextualize($_SERVER['PHP_SELF']));
        $template->assign('courseCode', $courseCode);
        $dialogBox->form($template->render());
        $out .= $dialogBox->render();
        break;
    case DISPLAY_REGISTRATION_DISABLED_FORM:
        if (empty($courseData['email'])) {
            $courseData['email'] = get_conf('administrator_email');
        }
        if (empty($courseData['titular'])) {
            $courseData['titular'] = get_conf('administrator_name');
        }
        $out .= $dialogBox->render();
        break;
}
// end of switch ($displayMode)
if ($newLink != '') {
    $out .= $newLink;
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:courses.php

示例10: elseif

        $manager = new $ctr(claro_get_current_course_id());
        $manager->deleteAll();
    }
    $dialogBox->success(get_lang('Course statistics are now empty'));
    Console::log("In course " . claro_get_current_course_id() . " : all tracking events deleted by user " . claro_get_current_user_id(), 'COURSE_RESET_ALL_TRACKING');
    $display = DISP_FLUSH_RESULT;
}
/*
 * Prepare output
 */
$nameTools = get_lang('Delete all course statistics');
/*
 * Output
 */
$html = '';
$html .= claro_html_tool_title($nameTools);
if (DISP_FLUSH_RESULT == $display) {
    // display confirm msg and back link
    $dialogBox->info('<small>' . '<a href="courseReport.php">' . '&lt;&lt;&nbsp;' . get_lang('Back') . '</a>' . '</small>' . "\n");
} elseif (DISP_FORM == $display) {
    $dialogBox->warning(get_lang('Delete is definitive.  There is no way to get your data back after delete.'));
    $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '">' . "\n" . claro_form_relay_context() . '<input type="hidden" name="cmd" value="exDelete" />' . "\n" . '<input type="radio" name="scope" id="scope_all" value="ALL" />' . "\n" . '<label for="scope_all">' . get_lang('All') . '</label>' . "\n" . '<br />' . "\n" . '<input type="radio" name="scope" id="scope_before" value="BEFORE" checked="checked" />' . "\n" . '<label for="scope_before" >' . get_lang('Before') . '</label> ' . "\n" . claro_html_date_form('beforeDate[day]', 'beforeDate[month]', 'beforeDate[year]', time(), 'short') . '<br /><br />' . "\n" . '<input type="submit" name="action" value="' . get_lang('Ok') . '" />&nbsp; ' . claro_html_button('courseReport.php', get_lang('Cancel')) . '</form>' . "\n");
}
// end else if $delete
$html .= $dialogBox->render();
/*
 * Output rendering
 */
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Statistics'), 'courseReport.php');
$claroline->display->body->setContent($html);
echo $claroline->display->render();
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:delete_course_stats.php

示例11: DialogBox

// Instanciate dialog box
$dialogBox = new DialogBox();
// Build the breadcrumb
ClaroBreadCrumbs::getInstance()->prepend(get_lang('Administration'), get_path('rootAdminWeb'));
$nameTools = get_lang('Categories');
// Get the cmd and id arguments
$cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : null;
$id = isset($_REQUEST['categoryId']) ? $_REQUEST['categoryId'] : null;
// Javascript confirm pop up declaration for header
JavascriptLanguage::getInstance()->addLangVar('Are you sure to delete %name ?');
JavascriptLoader::getInstance()->load('admin');
switch ($cmd) {
    // Display form to create a new category
    case 'rqAdd':
        $category = new claroCategory();
        $dialogBox->form($category->displayForm());
        break;
        // Create a new category
    // Create a new category
    case 'exAdd':
        $category = new claroCategory();
        $category->handleForm();
        if ($category->validate()) {
            $category->save();
            $dialogBox->success(get_lang('Category created'));
        } else {
            if (claro_failure::get_last_failure() == 'category_duplicate_code') {
                $dialogBox->error(get_lang('This code already exists'));
            } elseif (claro_failure::get_last_failure() == 'category_missing_field') {
                $dialogBox->error(get_lang('Some fields are missing'));
            }
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:admin_category.php

示例12: disp_search_box

function disp_search_box()
{
    if (isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'rqSearch') {
        $dialogBox = new DialogBox();
        $dialogBox->form('<form action="' . claro_htmlspecialchars(get_module_url('CLFRM') . '/viewsearch.php') . '" method="post">' . claro_form_relay_context() . get_lang('Search') . ' : <br />' . '<input type="text" name="searchPattern" /><br />' . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp; ' . claro_html_button(claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'])), get_lang('Cancel')) . '</form>');
        return $dialogBox->render();
    } else {
        return '';
    }
}
开发者ID:rhertzog,项目名称:lcs,代码行数:10,代码来源:forum.lib.php

示例13: display_my_documents

/**
 * This function is used to display the list of document available in the course
 * It also displays the form used to add selected document in the learning path
 *
 * @param string $dialogBox Error or confirmation text
 * @return nothing
 * @author Piraux S�bastien <pir@cerdecam.be>
 * @author Lederer Guillaume <led@cerdecam.be>
 */
function display_my_documents($dialogBox)
{
    global $is_allowedToEdit;
    global $curDirName;
    global $curDirPath;
    global $parentDir;
    global $fileList;
    /**
     * DISPLAY
     */
    $out = '';
    $out .= '<!-- display_my_documents output -->' . "\n";
    $dspCurDirName = claro_htmlspecialchars($curDirName);
    $cmdCurDirPath = rawurlencode($curDirPath);
    $cmdParentDir = rawurlencode($parentDir);
    $out .= '<br />' . '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">';
    /*--------------------------------------
      DIALOG BOX SECTION
      --------------------------------------*/
    $colspan = 4;
    if (!empty($dialogBox)) {
        $_dialogBox = new DialogBox();
        $_dialogBox->form($dialogBox);
        $out .= $_dialogBox->render();
    }
    /*--------------------------------------
      CURRENT DIRECTORY LINE
      --------------------------------------*/
    /* GO TO PARENT DIRECTORY */
    if ($curDirName) {
        $out .= '<a href="' . $_SERVER['PHP_SELF'] . '?cmd=exChDir&amp;file=' . $cmdParentDir . '">' . "\n" . '<img src="' . get_icon_url('parent') . '" hspace="5" alt="" /> ' . "\n" . '<small>' . get_lang('Up') . '</small>' . "\n" . '</a>' . "\n";
    }
    /* CURRENT DIRECTORY */
    $out .= '<table class="claroTable emphaseLine">' . '<thead>';
    // If the $curDirName is empty, we're in the root point
    // and there is'nt a dir name to display
    if ($curDirName) {
        $out .= '<!-- current dir name -->' . "\n" . '<tr>' . "\n" . '<th class="superHeader" colspan="' . $colspan . '" align="left">' . "\n" . '<img src="' . get_icon_url('opendir') . '" vspace=2 hspace=5 alt="" /> ' . "\n" . $dspCurDirName . "\n" . '</td>' . "\n" . '</tr>' . "\n";
    }
    $out .= '<tr align="center" valign="top">' . "\n" . '<th width="10%">' . get_lang('Add module(s)') . '</th>' . "\n" . '<th>' . get_lang('Name') . '</th>' . "\n" . '<th>' . get_lang('Size') . '</th>' . "\n" . '<th>' . get_lang('Date') . '</th>' . "\n" . '</tr>' . '</thead>' . '<tbody>' . "\n";
    /*--------------------------------------
      DISPLAY FILE LIST
      --------------------------------------*/
    if ($fileList) {
        $iterator = 0;
        while (list($fileKey, $fileName) = each($fileList['name'])) {
            $dspFileName = claro_htmlspecialchars($fileName);
            $cmdFileName = str_replace("%2F", "/", rawurlencode($curDirPath . "/" . $fileName));
            if ($fileList['visibility'][$fileKey] == "i") {
                if ($is_allowedToEdit) {
                    $style = ' class="invisible"';
                } else {
                    $style = "";
                    continue;
                    // skip the display of this file
                }
            } else {
                $style = "";
            }
            if ($fileList['type'][$fileKey] == A_FILE) {
                $image = choose_image($fileName);
                $size = format_file_size($fileList['size'][$fileKey]);
                $date = format_date($fileList['date'][$fileKey]);
                if ($GLOBALS['is_Apache'] && get_conf('secureDocumentDownload')) {
                    // slash argument method - only compatible with Apache
                    $doc_url = $cmdFileName;
                } else {
                    // question mark argument method, for IIS ...
                    $doc_url = '?url=' . $cmdFileName;
                }
                $urlFileName = get_path('clarolineRepositoryWeb') . 'backends/download.php' . $doc_url;
            } elseif ($fileList['type'][$fileKey] == A_DIRECTORY) {
                $image = 'folder';
                $size = '&nbsp;';
                $date = '&nbsp;';
                $urlFileName = $_SERVER['PHP_SELF'] . '?openDir=' . $cmdFileName;
            }
            $out .= '<tr ' . $style . '>' . "\n";
            if ($fileList['type'][$fileKey] == A_FILE) {
                $iterator++;
                $out .= '<td style="vertical-align:top; text-align: center;">' . '<input type="checkbox" name="insertDocument_' . $iterator . '" id="insertDocument_' . $iterator . '" value="' . $curDirPath . "/" . $fileName . '" />' . '</td>' . "\n";
            } else {
                $out .= '<td>&nbsp;</td>';
            }
            $out .= '<td>' . '<a href="' . $urlFileName . '" ' . $style . '>' . '<img src="' . get_icon_url($image) . '" hspace="5" alt="" /> ' . $dspFileName . '</a>';
            // Comments
            if ($fileList['comment'][$fileKey] != "") {
                $fileList['comment'][$fileKey] = claro_htmlspecialchars($fileList['comment'][$fileKey]);
                $fileList['comment'][$fileKey] = claro_parse_user_text($fileList['comment'][$fileKey]);
                $out .= '<div class="comment">' . $fileList['comment'][$fileKey] . '</div>' . "\n";
            }
//.........这里部分代码省略.........
开发者ID:rhertzog,项目名称:lcs,代码行数:101,代码来源:learnPath.lib.inc.php

示例14: password

                $dialogBox->success(get_lang('Your password has been emailed to') . ' : ' . $emailTo);
            } else {
                $dialogBox->error(get_lang('The system is unable to send you an e-mail.') . '<br />' . get_lang('Please contact') . ' : ' . '<a href="mailto:' . get_conf('administrator_email') . '?BODY=' . $emailTo . '">' . get_lang('Platform administrator') . '</a>');
            }
        }
    } else {
        $dialogBox->error(get_lang('There is no user account with this email address.'));
    }
    if ($extAuthPasswordCount > 0) {
        if ($extAuthPasswordCount == count($userList)) {
            $dialogBox->warning(get_lang('Your password(s) is (are) recorded in an external authentication system outside the platform.'));
        } else {
            $dialogBox->warning(get_lang('Passwords of some of your user account(s) are recorded an in external authentication system outside the platform.'));
        }
        $dialogBox->info(get_lang('For more information take contact with the platform administrator.'));
    }
}
////////////////////////////////////////////////////
// display section
$out = '';
// display title
$out .= claro_html_tool_title($nameTools);
// display message box
if (!$passwordFound) {
    $dialogBox->title(get_lang('Enter your email so we can send you your password.'));
    $dialogBox->form('<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . '<input type="hidden" name="searchPassword" value="1" />' . '<label for="Femail">' . get_lang('Email') . ' : </label>' . '<br />' . '<input type="text" name="Femail" id="Femail" size="50" maxlength="100" value="' . claro_htmlspecialchars($emailTo) . '" />' . '<br /><br />' . '<input type="submit" name="retrieve" value="' . get_lang('Ok') . '" />&nbsp; ' . claro_html_button(get_conf('urlAppend') . '/index.php', get_lang('Cancel')) . '</form>');
}
$out .= $dialogBox->render();
// display form
$claroline->display->body->appendContent($out);
echo $claroline->display->render();
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:lostPassword.php

示例15: header

    } else {
        header("Location: " . Url::Contextualize("./learningPathList.php"));
    }
    exit;
}
// select details of learning path to display
$sql = "SELECT lp.`learnPath_id`,\n        lp.`name`,\n        lp.`comment`,\n        lp.`lock`,\n        lp.`visibility`,\n        lp.`rank`\n        FROM `" . $TABLELEARNPATH . "` AS lp\n        WHERE lp.`learnPath_id` = " . (int) $_SESSION['path_id'];
$query = claro_sql_query($sql);
$LPDetails = mysql_fetch_array($query);
// parse commands
$cmd = isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : '';
switch ($cmd) {
    // REQUEST EDIT
    case "rqEdit":
        if (isset($_SESSION['path_id'])) {
            $dialogBox->form("\n\n" . '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n" . '<fieldset>' . "\n" . claro_form_relay_context() . '<h4>' . get_lang('Edit this learning path') . '</h4>' . "\n" . '<dl>' . "\n" . '<dt><label for="newName">' . get_lang('Title') . '</label></dt>' . "\n" . '<dd>' . "\n" . '<input type="text" name="newName" id="newName" size="50" maxlength="255" value="' . claro_htmlspecialchars(claro_utf8_decode($LPDetails['name'], get_conf('charset'))) . '" />' . "\n" . '</dd>' . "\n" . '<dt><label for="newComment">' . get_lang('Comment') . '</label></dt>' . "\n" . '<dd>' . "\n" . claro_html_textarea_editor('newComment', $LPDetails['comment'], 15, 55) . '</dd>' . "\n" . '</dl>' . "\n" . '</fieldset>' . "\n" . '<input type="hidden" name="cmd" value="exEdit" />' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp;' . "\n" . claro_html_button(Url::Contextualize($_SERVER['PHP_SELF']), get_lang('Cancel')) . '</form>' . "\n");
        } else {
            $dialogBox->error(get_lang('Wrong operation'));
        }
        break;
        // EXECUTE EDIT
    // EXECUTE EDIT
    case "exEdit":
        // Name must be unique
        $sql = "SELECT COUNT(`name`)\n                             FROM `" . $TABLELEARNPATH . "`\n                            WHERE `name` = '" . claro_sql_escape($_POST['newName']) . "'\n                              AND !(`learnPath_id` = " . (int) $_SESSION['path_id'] . ")";
        $num = claro_sql_query_get_single_value($sql);
        if ($num == 0) {
            $sql = "UPDATE `" . $TABLELEARNPATH . "`\n                    SET `name` = '" . claro_sql_escape($_POST['newName']) . "',\n                        `comment` = '" . claro_sql_escape($_POST['newComment']) . "'\n                    WHERE `learnPath_id` = " . (int) $_SESSION['path_id'];
            if (claro_sql_query($sql)) {
                $dialogBox->success(get_lang('Learning path updated'));
            }
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:learningPathAdmin.php


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