Exemple #1
0
function dirTree($dir)
{
    $r = opendir($dir);
    while ($str = readdir($r)) {
        if ($str == "." or $str == "..") {
            continue;
        }
        if (is_dir($dir . "/" . $str)) {
            echo "<b>" . $str . "</b>";
            echo "<blockquote>";
            echo dirTree($dir . "/" . $str);
            echo "<blockquote>";
        } else {
            //echo "<blockquote><a href='".$dir."/".$str"'>$str</a></blockquote>";
            echo "<blockquote>{$str}</blockquote>";
        }
    }
    closedir($r);
}
Exemple #2
0
 */
$testers_dataAr = MultiPort::getDataForTesterActivityReport();
$table = AdminModuleHtmlLib::getTestersActivityReport($testers_dataAr);
$label = translateFN("Home dell'amministratore");
$help = translateFN("Report sintetico dell'attivit&agrave; dei tester");
$menu_dataAr = array(array('href' => 'add_tester.php', 'text' => translateFN('Aggiungi provider')), array('href' => 'add_service.php', 'text' => translateFN('Aggiungi servizio')), array('href' => 'add_user.php', 'text' => translateFN('Aggiungi utente')), array('href' => 'import_language.php', 'text' => translateFN('Import Language')));
/**
 * giorgio 12/ago/2013
 * 
 * add content editing to menu only if it's a multiprovider environment
 */
// grab available content types for editing and build menu items
// $availableTypes = ;
// if (MULTIPROVIDER)
// {
foreach (dirTree(ROOT_DIR . '/docs') as $aType) {
    /**
     * if is singleprovider, admin cannot edit news content
     * It will not be shown anyway
     */
    if (!MULTIPROVIDER && $aType == 'news') {
        continue;
    }
    array_push($menu_dataAr, array('href' => 'edit_content.php?type=' . $aType, 'text' => 'Edit ' . $aType . ' content'));
}
// }
$actions_menu = AdminModuleHtmlLib::createActionsMenu($menu_dataAr);
$content_dataAr = array('user_name' => $user_name, 'user_type' => $user_type, 'status' => $status, 'actions_menu' => $actions_menu->getHtml(), 'label' => $label, 'help' => $help, 'data' => $table->getHtml(), 'module' => $label, 'messages' => $user_messages->getHtml());
/**
 * Sends data to the rendering engine
 */
 function form_editcourse($file_action, $file_back, $course, $authors, $id)
 {
     // inizializzazione variabili
     $root_dir = $GLOBALS['root_dir'];
     $str = "";
     $n_authors = count($authors);
     $sel_author_id = $course['id_autore'];
     // nome
     $fields["add"][] = "course[nome]";
     $names["add"][] = "Nome";
     $edittypes["add"][] = "text";
     $necessary["add"][] = "true";
     $values["add"][] = $course['nome'];
     $options["add"][] = "";
     $maxsize["add"][] = 32;
     // titolo
     $fields["add"][] = "course[titolo]";
     $names["add"][] = "Titolo";
     $edittypes["add"][] = "text";
     $necessary["add"][] = "true";
     $values["add"][] = $course['titolo'];
     $options["add"][] = "";
     $maxsize["add"][] = 128;
     /*   mod steve 22/04/09
           *  we don't want to let admin modify the author of the course!
          // id_autore
          $labels_sel = "";
          $val_sel = "";
          $max = count($authors) ;
          for ($i=0; $i<$max; $i++){
              $labels_sel .= ":". $authors[$i][1] ." ". $authors[$i][2] ." ";
              if($i != ($max-1)){
                  $val_sel .= $authors[$i][0] .":" ;
              }else{
                  $val_sel .= $authors[$i][0] ;
              }
          }
          $fields["add"][]="course[id_autore]";
          $names["add"][]="Autore $labels_sel";
          $edittypes["add"][]="select";
          $necessary["add"][]="true";
          $values["add"][]=$sel_author_id ;
          $options["add"][]="$val_sel";
          $maxsize["add"][]="";
          */
     // so we draw a "noinput" field for the name and an hidden field for the id
     //
     $label = "";
     $val = "";
     $max = count($authors);
     for ($i = 0; $i < $max; $i++) {
         if ($authors[$i][0] == $sel_author_id) {
             $label = $authors[$i][1] . " " . $authors[$i][2];
             $val = $authors[$i][0];
         }
     }
     // author's id: it is necessary !
     $fields["add"][] = "course[id_autore]";
     $names["add"][] = "Autore";
     $edittypes["add"][] = "hidden";
     $values["add"][] = "{$val}";
     // author's name
     $fields["add"][] = "nome_autore";
     $names["add"][] = "Autore";
     $edittypes["add"][] = "noinput";
     $values["add"][] = "{$label}";
     /* end mod */
     // descrizione
     $fields["add"][] = "course[descr]";
     $names["add"][] = "descrizione";
     $edittypes["add"][] = "textarea";
     $necessary["add"][] = "";
     $values["add"][] = $course['descr'];
     $options["add"][] = "";
     $maxsize["add"][] = "";
     // data pubblicazione
     $fields["add"][] = "course[d_create]";
     $names["add"][] = "data creazione (GG/MM/AAAA)";
     $edittypes["add"][] = "text";
     $necessary["add"][] = "";
     $values["add"][] = $course['d_create'];
     $options["add"][] = "";
     $maxsize["add"][] = 12;
     // data pubblicazione
     $fields["add"][] = "course[d_publish]";
     $names["add"][] = "data pubblicazione (GG/MM/AAAA)";
     $edittypes["add"][] = "text";
     $necessary["add"][] = "";
     $values["add"][] = $course['d_publish'];
     $options["add"][] = "";
     $maxsize["add"][] = 12;
     // media path
     $fields["add"][] = "course[media_path]";
     $names["add"][] = "media path";
     $edittypes["add"][] = "text";
     $necessary["add"][] = "";
     $values["add"][] = $course['media_path'];
     $options["add"][] = "";
     $maxsize["add"][] = 50;
     $temp_dir_base = $root_dir . "/templates/main";
     $layout_OK = dirTree($temp_dir_base);
     // $val_sel = "";
     $max = count($layout_OK);
     for ($i = 0; $i < $max; $i++) {
         if ($i != $max - 1) {
             $val_sel .= $layout_OK[$i] . ":";
         } else {
             $val_sel .= $layout_OK[$i];
         }
     }
     // $layout_OK [] = "";
     $fields["add"][] = "course[id_layout]";
     $names["add"][] = "Layout: {$val_sel}";
     $edittypes["add"][] = "select";
     $necessary["add"][] = "";
     $values["add"][] = $course['id_layout'];
     $options["add"][] = $val_sel;
     $maxsize["add"][] = 20;
     // id
     $fields["add"][] = "id";
     $names["add"][] = "id";
     $edittypes["add"][] = "hidden";
     $necessary["add"][] = "";
     $values["add"][] = "{$id}";
     $options["add"][] = "";
     $maxsize["add"][] = "";
     // creazione del form
     $str = MakeForm($fields, $names, $edittypes, $necessary, $values, $options, $maxsize, $file_action, "add", false, true);
     // scrittura stringa back
     $str .= $this->go_file_back($file_back, translateFN("Indietro"));
     return $str;
 }
Exemple #4
0
 * Performs basic controls before entering this module
 */
$neededObjAr = array(AMA_TYPE_SWITCHER => array('layout'));
require_once ROOT_DIR . '/include/module_init.inc.php';
$self = whoami();
// = admin!
include_once 'include/admin_functions.inc.php';
/*
 * YOUR CODE HERE
 */
require_once ROOT_DIR . '/include/Forms/CourseModelForm.inc.php';
$options = '';
$languages = Translator::getSupportedLanguages();
// @author giorgio 08/mag/2013
// extract available types from docs subdirectories
$availableTypes = dirTree(ROOT_DIR . '/docs');
// @author giorgio 08/mag/2013
// get requested type from querystring
$reqType = isset($_REQUEST['type']) ? trim($_REQUEST['type']) : '';
// set 'news' as default type if passed is invalid or not set
if (!in_array($reqType, $availableTypes)) {
    $reqType = 'news';
}
/**
 * giorgio 12/ago/2013
 * sets files path if it's switcher or admin
 */
if (!MULTIPROVIDER && $userObj->getType() == AMA_TYPE_SWITCHER) {
    $testers = $userObj->getTesters();
    $filePath = '/clients/' . $testers[0];
} else {