示例#1
0
 /**
  * function getAuthorMediaManager, used to manage the properties of each author's media already uploaded.
  * It is possible for the user to set some properties and save them on DB.
  *
  * @param int    $id_course
  * @param string $fckeditorInstance
  * @return string
  */
 public static function getAuthorMediaManager()
 {
     $form = CDOMElement::create('form', 'id:properties_media, class:editor_form');
     /*
        $form = CDOMElement::create('form',"id:uploadfile, name:uploadfileform, enctype:multipart/form-data,
           action:$php_file_uploader, method:post");
        $form->setAttribute('onclick','enterUploadFileState();');
     *
     */
     $textarea_div = CDOMElement::create('div', 'id:jstextarea_media_div');
     // Title
     $title_label = CDOMElement::create('DIV');
     $title_label->setAttribute('class', 'label_extended');
     $title_label->addChild(new CText(translateFN('title')));
     $span_title_area = CDOMElement::create('div', 'id:title_media,class:editor_input');
     $title_area = CDOMElement::create('text', 'id:jsdata_titlesarea, name:titolo');
     $title_area->setAttribute('value', translateFN('Scrivi il titolo'));
     $span_title_area->addChild($title_area);
     // preview
     //        $title_label = CDOMElement::create('DIV');
     //        $title_label->setAttribute('class', 'label_extended');
     //        $title_label->addChild(new CText(translateFN('title')));
     $span_preview_area = CDOMElement::create('div', 'id:preview_media,class:media_preview');
     // Description
     $description_label = CDOMElement::create('DIV');
     $description_label->setAttribute('class', 'label_extended');
     $description_label->addChild(new CText(translateFN('description')));
     $span_description_area = CDOMElement::create('div', 'id:description_media,class:editor_input');
     $description_area = CDOMElement::create('textarea', 'id:jsdata_descriptionarea, name:descrizione');
     $description_area->addChild(new CText(translateFN('Scrivi la descrizione')));
     //        $description_area->setAttribute('value', translateFN('Scrivi la descrizione'));
     $span_description_area->addChild($description_area);
     // keywords
     $keywords_label = CDOMElement::create('DIV');
     $keywords_label->setAttribute('class', 'label_extended');
     $keywords_label->addChild(new CText(translateFN('keywords')));
     $span_keywords_area = CDOMElement::create('div', 'id:keywords,class:editor_input');
     $keywords_area = CDOMElement::create('text', 'id:jsdata_keywordsarea, name:keywords');
     $keywords_area->setAttribute('value', translateFN('Scrivi le keywords'));
     $span_keywords_area->addChild($keywords_area);
     // pubblicato
     //        $keywords_label = CDOMElement::create('DIV');
     //        $keywords_label->setAttribute('class', 'label_extended');
     //        $keywords_label->addChild(new CText(translateFN('keywords')));
     $span_published_area = CDOMElement::create('div', 'id:published,class:editor_input');
     $span_published_area->addChild(new CText(translateFN('published')));
     $published_check = CDOMElement::create('checkbox', 'id:jsdata_published, name:published');
     $published_check->setAttribute('checked', 'true');
     $span_published_area->addChild($published_check);
     // language
     Translator::loadSupportedLanguagesInSession();
     $supported_languages = Translator::getSupportedLanguages();
     $select = CDOMElement::create('select', 'id:p_selected_language, name:lingua');
     foreach ($supported_languages as $language) {
         $option = CDOMElement::create('option', "value:{$language['id_lingua']}");
         if (isset($login_page_language_code) && $language['codice_lingua'] == $login_page_language_code) {
             $option->setAttribute('selected', 'selected');
         }
         $option->addChild(new CText($language['nome_lingua']));
         $select->addChild($option);
     }
     // extended media type
     $select_extended_media_type = CDOMElement::create('select', 'id:p_selected_media_extended_type, name:tipo');
     $option_media_type = CDOMElement::create('option', "value:'0'");
     $option_media_type->addChild(new CText(translateFN('inserisci tipo media')));
     $select_extended_media_type->addChild($option_media_type);
     $hidden_input_id_risorsa_ext = CDOMElement::create('hidden', 'name:id_risorsa_ext', 'value:0');
     $hidden_copy = CDOMElement::create('hidden', 'name:copyright', 'value:1');
     $textarea_div->addChild($title_label);
     $textarea_div->addChild($span_title_area);
     $textarea_div->addChild($span_preview_area);
     $textarea_div->addChild($keywords_label);
     $textarea_div->addChild($span_keywords_area);
     $textarea_div->addChild($description_label);
     $textarea_div->addChild($span_description_area);
     $textarea_div->addChild($span_published_area);
     $textarea_div->addChild($select);
     $textarea_div->addChild($select_extended_media_type);
     $textarea_div->addChild($hidden_input_id_risorsa_ext);
     $textarea_div->addChild($hidden_copy);
     /*
     
             $span_select = CDOMElement::create('div','id:span_properties_media, class:editor_input');
             $key_label =
             $keywords = CDOMElement::create('select','id:jsid_properties_files, size:10');
             foreach ( $author_media as $media ) {
                 $ada_filetype = Utilities::getFileHintFromADAFileType($media['tipo']);
                 $value = "{$media['tipo']}|{$media['nome_file']}";
                 $option = CDOMElement::create('option');
                 $option->setAttribute('value', $value);
                 $option->addChild(new CText("$ada_filetype {$media['nome_file']}"));
                 $select->addChild($option);
             }
             $span_select->addChild($select);
     */
     $author_id = $_SESSION['sess_id_user'];
     $span_button_media_properties = CDOMElement::create('div', 'id:span_properties_media_button, class:editor_input');
     $input_button = CDOMElement::create('input_button');
     $input_button->setAttribute('onclick', "saveMultimediaProperties(getFileDataFromSelect('jsid_select_files'),{$author_id});");
     $input_button->setAttribute('value', translateFN("Salva proprietà media"));
     $span_button_media_properties->addChild($input_button);
     $input_button_media_properties = CDOMElement::create('input_button');
     $input_button_media_properties->setAttribute('onclick', "toggleVisibility('jsid_div_media_properties');");
     $input_button_media_properties->setAttribute('value', translateFN("Chiudi"));
     $span_button_media_properties->addChild($input_button_media_properties);
     $form->addChild($textarea_div);
     //        $form->addChild($span_button);
     $form->addChild($span_button_media_properties);
     return $form;
 }
示例#2
0
文件: kiosk.php 项目: eguicciardi/ada
require_once realpath(dirname(__FILE__)) . '/config_path.inc.php';
/**
 * Clear node and layout variable in $_SESSION
 * $_SESSION was destroyed, so we do not need to clear data in session.
 */
$allowedUsersAr = array(AMA_TYPE_VISITOR, AMA_TYPE_STUDENT, AMA_TYPE_TUTOR, AMA_TYPE_AUTHOR, AMA_TYPE_ADMIN);
/**
 * Performs basic controls before entering this module
 */
require_once ROOT_DIR . '/include/module_init.inc.php';
$self = index;
include_once 'include/' . $self . '_functions.inc.php';
/**
 * Negotiate login page language
 */
Translator::loadSupportedLanguagesInSession();
$supported_languages = Translator::getSupportedLanguages();
$login_page_language_code = Translator::negotiateLoginPageLanguage();
$_SESSION['sess_user_language'] = $login_page_language_code;
/**
 * Track kiosk accesses
 */
$_SESSION['ada_access_from'] = ADA_KIOSK_ACCESS;
$_SESSION['ada_remote_address'] = $_SERVER['REMOTE_ADDR'];
/*
 * Load news file
 */
$newsfile = 'news_' . $login_page_language_code . '.txt';
$infofile = 'info_' . $login_page_language_code . '.txt';
$helpfile = 'help_' . $login_page_language_code . '.txt';
/*