예제 #1
0
/**
 * Prints default edit form fields and buttons
 *
 * @param string $format Edit form format (html, creole...)
 * @param integer $version Version number. A negative number means no versioning.
 */
function wiki_print_edit_form_default_fields($format, $pageid, $version = -1, $upload = false, $deleteuploads = array())
{
    global $CFG, $PAGE, $OUTPUT;
    echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
    if ($version >= 0) {
        echo '<input type="hidden" name="version" value="' . $version . '" />';
    }
    echo '<input type="hidden" name="format" value="' . $format . '"/>';
    //attachments
    require_once $CFG->dirroot . '/lib/form/filemanager.php';
    $filemanager = new MoodleQuickForm_filemanager('attachments', get_string('wikiattachments', 'wiki'), array('id' => 'attachments'), array('subdirs' => false, 'maxfiles' => 99, 'maxbytes' => $CFG->maxbytes));
    $value = file_get_submitted_draft_itemid('attachments');
    if (!empty($value) && !$upload) {
        $filemanager->setValue($value);
    }
    echo "<fieldset class=\"wiki-upload-section clearfix\"><legend class=\"ftoggler\">" . get_string("uploadtitle", 'wiki') . "</legend>";
    echo $OUTPUT->container_start('mdl-align wiki-form-center aaaaa');
    print $filemanager->toHtml();
    echo $OUTPUT->container_end();
    $cm = $PAGE->cm;
    $context = get_context_instance(CONTEXT_MODULE, $cm->id);
    echo $OUTPUT->container_start('mdl-align wiki-form-center wiki-upload-table');
    wiki_print_upload_table($context, 'wiki_upload', $pageid, $deleteuploads);
    echo $OUTPUT->container_end();
    echo "</fieldset>";
    echo '<input class="wiki_button" type="submit" name="editoption" value="' . get_string('save', 'wiki') . '"/>';
    echo '<input class="wiki_button" type="submit" name="editoption" value="' . get_string('upload', 'wiki') . '"/>';
    echo '<input class="wiki_button" type="submit" name="editoption" value="' . get_string('preview') . '"/>';
    echo '<input class="wiki_button" type="submit" name="editoption" value="' . get_string('cancel') . '" />';
}
예제 #2
0
 /**
  * Construct a alfresco_filemanager.
  *
  * @param string $elementName Element's name
  * @param mixed $elementLabel Label(s) for an element
  * @param array $options Options to control the element's display
  * @param mixed $attributes Either a typical HTML attribute string or an associative array
  */
 public function alfresco_filemanager($elementName=null, $elementLabel=null, $attributes=null, $options=null) {
     parent::__construct($elementName, $elementLabel, $attributes, $options);
 }