Ejemplo n.º 1
0
function pathConfiguration()
{
    global $xoopsModule;
    // Upload and Images Folders
    smartmedia_collapsableBar('configtable', 'configtableicon');
    echo "<img id='configtableicon' name='configtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SMEDIA_PATHCONFIGURATION . "</h3>";
    echo "<div id='configtable'>";
    echo "<br />";
    echo "<table width='100%' class='outer' cellspacing='1' cellpadding='3' border='0' ><tr>";
    echo "<td class='bg3'><b>" . _AM_SMEDIA_PATH_ITEM . "</b></td>";
    echo "<td class='bg3'><b>" . _AM_SMEDIA_PATH . "</b></td>";
    echo "<td class='bg3' align='center'><b>" . _AM_SMEDIA_STATUS . "</b></td></tr>";
    echo "<tr><td class='odd'>" . _AM_SMEDIA_PATH_FILES . "</td>";
    $upload_path = smartmedia_getUploadDir();
    echo "<td class='odd'>" . $upload_path . "</td>";
    echo "<td class='even' style='text-align: center;'>" . smartmedia_admin_getPathStatus('root') . "</td></tr>";
    echo "<tr><td class='odd'>" . _AM_SMEDIA_PATH_IMAGES . "</td>";
    $image_path = smartmedia_getImageDir();
    echo "<td class='odd'>" . $image_path . "</td>";
    echo "<td class='even' style='text-align: center;'>" . smartmedia_admin_getPathStatus('images') . "</td></tr>";
    echo "<tr><td class='odd'>" . _AM_SMEDIA_PATH_IMAGES_CATEGORY . "</td>";
    $image_path = smartmedia_getImageDir('category');
    echo "<td class='odd'>" . $image_path . "</td>";
    echo "<td class='even' style='text-align: center;'>" . smartmedia_admin_getPathStatus('images/category') . "</td></tr>";
    echo "<tr><td class='odd'>" . _AM_SMEDIA_PATH_IMAGES_FOLDER . "</td>";
    $image_path = smartmedia_getImageDir('folder');
    echo "<td class='odd'>" . $image_path . "</td>";
    echo "<td class='even' style='text-align: center;'>" . smartmedia_admin_getPathStatus('images/folder') . "</td></tr>";
    echo "<tr><td class='odd'>" . _AM_SMEDIA_PATH_IMAGES_CLIP . "</td>";
    $image_path = smartmedia_getImageDir('clip');
    echo "<td class='odd'>" . $image_path . "</td>";
    echo "<td class='even' style='text-align: center;'>" . smartmedia_admin_getPathStatus('images/clip') . "</td></tr>";
    echo "</table>";
    echo "<br />";
    echo "</div>";
}
Ejemplo n.º 2
0
function editfolder_text($showmenu = false, $folderid, $languageid)
{
    global $xoopsDB, $smartmedia_folder_handler, $xoopsUser, $myts, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    echo "<script type=\"text/javascript\" src=\"funcs.js\"></script>";
    echo "<style>";
    echo "<!-- ";
    echo "select { width: 130px; }";
    echo "-->";
    echo "</style>";
    $cat_sel = '';
    $folderObj = $smartmedia_folder_handler->get($folderid, $languageid);
    if ($languageid == 'new') {
        $bread_lang = _AM_SMEDIA_CREATE;
    } else {
        $bread_lang = ucfirst($languageid);
    }
    if ($showmenu) {
        smartmedia_adminMenu(2, _AM_SMEDIA_FOLDERS . " > " . _AM_SMEDIA_LANGUAGE_INFO . " > " . $bread_lang);
    }
    echo "<br />\n";
    smartmedia_collapsableBar('bottomtable', 'bottomtableicon');
    echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SMEDIA_FOLDER_LANGUAGE_INFO_EDITING . "</h3>";
    echo "<div id='bottomtable'>";
    echo "<span style=\"color: #567; margin: 3px 0 18px 0; font-size: small; display: block; \">" . _AM_SMEDIA_FOLDER_LANGUAGE_INFO_EDITING_INFO . "</span>";
    // Start folder form
    $sform = new XoopsThemeForm(_AM_SMEDIA_FOLDER, "op", xoops_getenv('PHP_SELF'));
    $sform->setExtra('enctype="multipart/form-data"');
    $sform->addElement(new XoopsFormHidden('folderid', $folderid));
    // Language
    $languageOptions = array();
    $languageList = XoopsLists::getLangList();
    $createdLanguages = $folderObj->getCreatedLanguages();
    foreach ($languageList as $language) {
        if ($languageid != 'new' || !in_array($language, $createdLanguages)) {
            $languageOptions[$language] = $language;
        }
    }
    $language_select = new XoopsFormSelect(_AM_SMEDIA_LANGUAGE_ITEM, 'languageid', $languageid);
    $language_select->addOptionArray($languageOptions);
    $language_select->setDescription(_AM_SMEDIA_LANGUAGE_ITEM_DSC);
    if ($languageid != 'new') {
        $language_select->setExtra(smartmedia_make_control_disabled());
        $sform->addElement(new XoopsFormHidden('languageid', $languageid));
    }
    $sform->addElement($language_select, true);
    // title
    $sform->addElement(new XoopsFormText(_AM_SMEDIA_FOLDER_TITLE, 'title', 50, 255, $folderObj->title()), true);
    // title
    $sform->addElement(new XoopsFormText(_AM_SMEDIA_FOLDER_TITLE_REQ, 'title', 50, 255, $folderObj->title()), true);
    // short_title
    //$sform->addElement(new XoopsFormText(_AM_SMEDIA_FOLDER_SHORT_TITLE, 'short_title', 50, 255, $folderObj->short_title()));
    // summary
    $summary = new XoopsFormTextArea(_AM_SMEDIA_FOLDER_SUMMARY, 'summary', $folderObj->summary('e'), 3, 60);
    $summary->setDescription(_AM_SMEDIA_FOLDER_SUMMARYDSC);
    $sform->addElement($summary);
    // Description
    $description_text = new XoopsFormTextArea(_AM_SMEDIA_FOLDER_DESCRIPTION, 'description', $folderObj->description('e'), 7, 60);
    $description_text->setDescription(_AM_SMEDIA_FOLDER_DESCRIPTIONDSC);
    $sform->addElement($description_text);
    // Meta-Description
    $meta = new XoopsFormTextArea(_AM_SMEDIA_FOLDER_META_DESCRIPTION, 'meta_description', $folderObj->meta_description('e'), 7, 60);
    $meta->setDescription(_AM_SMEDIA_CLIP_META_DESCRIPTIONDSC);
    $sform->addElement($meta);
    $sform->addElement(new XoopsFormHidden('itemType', 'item_text'));
    // Action buttons tray
    $button_tray = new XoopsFormElementTray('', '');
    $hidden = new XoopsFormHidden('op', 'addfolder_text');
    $button_tray->addElement($hidden);
    if ($languageid == 'new') {
        // We are creating a new folder language info
        $butt_create = new XoopsFormButton('', '', _AM_SMEDIA_CREATE, 'submit');
        $butt_create->setExtra('onclick="this.form.elements.op.value=\'addfolder_text\'"');
        $button_tray->addElement($butt_create);
        $butt_clear = new XoopsFormButton('', '', _AM_SMEDIA_CLEAR, 'reset');
        $button_tray->addElement($butt_clear);
        $butt_cancel = new XoopsFormButton('', '', _AM_SMEDIA_CANCEL, 'button');
        $butt_cancel->setExtra('onclick="history.go(-1)"');
        $button_tray->addElement($butt_cancel);
    } else {
        // We are editing a folder language info
        $butt_create = new XoopsFormButton('', '', _AM_SMEDIA_MODIFY, 'submit');
        $butt_create->setExtra('onclick="this.form.elements.op.value=\'addfolder_text\'"');
        $button_tray->addElement($butt_create);
        $butt_cancel = new XoopsFormButton('', '', _AM_SMEDIA_CANCEL, 'button');
        $butt_cancel->setExtra('onclick="history.go(-1)"');
        $button_tray->addElement($butt_cancel);
    }
    $sform->addElement($button_tray);
    $sform->display();
    echo "</div>";
    unset($hidden);
}
Ejemplo n.º 3
0
function editformat($showmenu = false, $id = 0)
{
    global $smartmedia_format_handler, $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    // If there is a parameter, and the id exists, retrieve data: we're editing a format
    if ($id != 0) {
        // Creating the format object
        $formatObj = new SmartmediaFormat($id);
        if (!$formatObj) {
            redirect_header("format.php", 1, _AM_SMEDIA_FORMAT_NOT_SELECTED);
            exit;
        }
        $breadcrumb_action1 = _AM_SMEDIA_FORMATS;
        $breadcrumb_action2 = _AM_SMEDIA_EDITING;
        $page_title = _AM_SMEDIA_FORMAT_EDITING;
        $page_info = _AM_SMEDIA_FORMAT_EDITING_INFO;
        $button_caption = _AM_SMEDIA_MODIFY;
        if ($showmenu) {
            smartmedia_adminMenu(4, $breadcrumb_action1 . " > " . $breadcrumb_action2);
        }
        echo "<br />\n";
    } else {
        // there's no parameter, so we're adding a format
        $formatObj =& $smartmedia_format_handler->create();
        $breadcrumb_action1 = _AM_SMEDIA_FORMATS;
        $breadcrumb_action2 = _AM_SMEDIA_CREATE;
        $button_caption = _AM_SMEDIA_CREATE;
        $page_title = _AM_SMEDIA_FORMAT_CREATING;
        $page_info = _AM_SMEDIA_FORMAT_CREATING_INFO;
        if ($showmenu) {
            smartmedia_adminMenu(4, $breadcrumb_action1 . " > " . $breadcrumb_action2);
        }
    }
    smartmedia_collapsableBar('bottomtable', 'bottomtableicon');
    echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . $page_title . "</h3>";
    echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $page_info . "</span>";
    echo "<div id='bottomtable'>";
    // FORMAT FORM
    $sform = new XoopsThemeForm(_AM_SMEDIA_FORMAT, "op", xoops_getenv('PHP_SELF'));
    $sform->setExtra('enctype="multipart/form-data"');
    // FORMAT
    $format_text = new XoopsFormText(_AM_SMEDIA_FORMAT, 'format', 50, 255, $formatObj->format('e'));
    $format_text->setDescription(_AM_SMEDIA_FORMAT_DSC);
    $sform->addElement($format_text, true);
    // EXT
    $ext_text = new XoopsFormText(_AM_SMEDIA_FORMAT_EXT, 'ext', 5, 10, $formatObj->ext());
    $ext_text->setDescription(_AM_SMEDIA_FORMAT_EXT_DSC);
    $sform->addElement($ext_text, true);
    // TEMPLATE
    $template_text = new XoopsFormTextArea(_AM_SMEDIA_FORMAT_TEMPLATE, 'template', $formatObj->template('e'), 15, 60);
    $template_text->setDescription(_AM_SMEDIA_FORMAT_TEMPLATE_DSC);
    $sform->addElement($template_text, true);
    // FORMAT ID
    $sform->addElement(new XoopsFormHidden('formatid', $formatObj->formatid()));
    $button_tray = new XoopsFormElementTray('', '');
    $hidden = new XoopsFormHidden('op', 'addformat');
    $button_tray->addElement($hidden);
    $butt_create = new XoopsFormButton('', '', $button_caption, 'submit');
    $butt_create->setExtra('onclick="this.form.elements.op.value=\'addformat\'"');
    $button_tray->addElement($butt_create);
    $butt_cancel = new XoopsFormButton('', '', _AM_SMEDIA_CANCEL, 'button');
    $butt_cancel->setExtra('onclick="location=\'format.php\'"');
    $button_tray->addElement($butt_cancel);
    $sform->addElement($button_tray);
    $sform->display();
    unset($hidden);
    echo "</div>";
}
Ejemplo n.º 4
0
function list_groups()
{
    global $xoopsModule, $block_arr;
    smartmedia_collapsableBar('bottomtable', 'bottomtableicon');
    foreach (array_keys($block_arr) as $i) {
        $item_list[$block_arr[$i]->getVar("bid")] = $block_arr[$i]->getVar("title");
    }
    $form = new MyXoopsGroupPermForm('', 1, 'block_read', "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SMEDIA_GROUPS . "</h3><div id='bottomtable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">" . _AM_SMEDIA_GROUPSINFO . "</span>");
    $form->addAppendix('module_admin', $xoopsModule->mid(), $xoopsModule->name() . ' ' . _AM_ACTIVERIGHTS);
    $form->addAppendix('module_read', $xoopsModule->mid(), $xoopsModule->name() . ' ' . _AM_ACCESSRIGHTS);
    //mis en commentaire pcq $item_list == NULL
    /*foreach( $item_list as $item_id => $item_name) {
      $form->addItem( $item_id , $item_name ) ;
      }*/
    echo $form->render();
    echo "</div>";
}
Ejemplo n.º 5
0
     if ($error == true) {
         $endMsg = _AM_SMEDIA_IMPORT_ERROR;
     } else {
         $endMsg = _AM_SMEDIA_IMPORT_SUCCESS;
     }
     echo $endMsg;
     echo "<br /><br />";
     echo "<a href='import.php'>" . _AM_SMEDIA_IMPORT_BACK . "</a>";
     echo "<br /><br />";
     break;
 case "default":
 default:
     $importfile = 'xoops_qa';
     xoops_cp_header();
     smartmedia_adminMenu(-1, _AM_SMEDIA_IMPORT);
     smartmedia_collapsableBar('bottomtable', 'bottomtableicon');
     echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SMEDIA_IMPORT_TITLE . "</h3>";
     echo "<div id='bottomtable'>";
     echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_SMEDIA_IMPORT_INFO . "</span>";
     global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts;
     include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     // If there is a parameter, and the id exists, retrieve data: we're editing a request
     $ssorm = new XoopsThemeForm(_AM_SMEDIA_IMPORT_SELECTION, "op", xoops_getenv('PHP_SELF'));
     $sform->setExtra('enctype="multipart/form-data"');
     // Q&A set to import
     $importfile_select_array = array("xoops_qa" => _AM_SMEDIA_XOOPS_QA);
     $importfile_select = new XoopsFormSelect('', 'importfile', $importfile);
     $importfile_select->addOptionArray($importfile_select_array);
     $importfile_tray = new XoopsFormElementTray(_AM_SMEDIA_IMPORT_SELECT_FILE, '&nbsp;');
     $importfile_tray->addElement($importfile_select);
     $sform->addElement($importfile_tray);