Example #1
0
function upgradeDB()
{
    global $xoopsModule, $dbupdater;
    $xoopsDB =& Database::getInstance();
    //1. Determine previous release
    //   *** Update this in sql/mysql.sql for each release **
    if (!smartmedia_TableExists('smartmedia_meta')) {
        $ver = '0.75';
    } else {
        if (!($ver = smartmedia_GetMeta('version'))) {
            exit(_AM_SMEDIA_DB_VERSION_ERR);
        }
    }
    $mid = $xoopsModule->getVar('mid');
    xoops_cp_header();
    smartmedia_adminMenu(-1, _AM_SMEDIA_DB_UPDATE_DB);
    echo "<h2>" . _AM_SMEDIA_DB_UPDATE_DB . "</h2>";
    $ret = true;
    //2. Do All Upgrades necessary to make current
    //   Break statements are omitted on purpose
    switch ($ver) {
        case '0.75':
            set_time_limit(60);
            printf("<h3>" . _AM_SMEDIA_DB_UPDATE_TO . "</h3>", '0.85');
            echo "<ul>";
            // Create table smartmedia_meta
            $table = new SmartmediaTable('smartmedia_meta');
            $table->setStructure("CREATE TABLE %s (\r\n        \t\t\t\t\t\tmetakey varchar(50) NOT NULL default '', \r\n        \t\t\t\t\t\tmetavalue varchar(255) NOT NULL default '', \r\n        \t\t\t\t\t\tPRIMARY KEY (metakey)) \r\n        \t\t\t\t\t\tENGINE=MyISAM;");
            $table->setData(sprintf("'version', %s", $xoopsDB->quoteString($ver)));
            $ret = $ret && $dbupdater->updateTable($table);
            unset($table);
            // Add fields in smartmedia_clips
            $table = new SmartmediaTable('smartmedia_clips');
            $table->addAlteredField('statusid', "INT( 11 ) DEFAULT '1' NOT NULL");
            $table->addAlteredField('created_date', "INT( 11 ) DEFAULT '0' NOT NULL");
            $table->addAlteredField('created_uid', "INT( 11 ) DEFAULT '0' NOT NULL");
            $table->addAlteredField('modified_uid', "INT( 11 ) DEFAULT '0' NOT NULL");
            $table->addAlteredField('modified_date', "INT( 11 ) DEFAULT '0' NOT NULL");
            $table->addAlteredField('width', "INT( 11 ) DEFAULT '0' NOT NULL");
            $table->addAlteredField('height', "INT( 11 ) DEFAULT '0' NOT NULL");
            $table->addAlteredField('autostart', "INT( 11 ) DEFAULT '0' NOT NULL");
            $table->addAlteredField('counter', "INT( 11 ) DEFAULT '0' NOT NULL");
            // Drop fields in smartmedia_clips
            $table->addDropedField('resolutionid');
            $ret = $dbupdater->updateTable($table) && $ret;
            unset($table);
            // Add counter in smartmedia_folders
            $table = new SmartmediaTable('smartmedia_folders');
            $table->addAlteredField('counter', "INT( 11 ) DEFAULT '0' NOT NULL");
            $ret = $dbupdater->updateTable($table) && $ret;
            unset($table);
            //Drop table smartmedia_resolutions
            $table = new SmartmediaTable('smartmedia_resolutions');
            $table->setFlagForDrop();
            $ret = $dbupdater->updateTable($table) && $ret;
            unset($table);
            // Drop table smartmedia_languages
            $table = new SmartmediaTable('smartmedia_languages');
            $table->setFlagForDrop();
            $ret = $dbupdater->updateTable($table) && $ret;
            unset($table);
            // Drop table smartmedia_formats
            $table = new SmartmediaTable('smartmedia_formats');
            $table->setFlagForDrop();
            $ret = $dbupdater->updateTable($table) && $ret;
            unset($table);
            // Create table format
            $table = new SmartmediaTable('smartmedia_formats');
            $table->setStructure("CREATE TABLE %s (\r\n  \t\t\t\t\t\t\t\t`formatid` int(11) NOT NULL auto_increment,\r\n  \t\t\t\t\t\t\t\t`template` text NOT NULL,\r\n  \t\t\t\t\t\t\t\t`format` varchar(50) NOT NULL default '',\r\n  \t\t\t\t\t\t\t\t`ext` char(3) NOT NULL default '',\r\n  \t\t\t\t\t\t\t\tPRIMARY KEY  (`formatid`)\r\n\t\t\t\t\t\t\t\t) ENGINE=MyISAM AUTO_INCREMENT=8 ;");
            $table->setData('1, \'<object id="MediaPlayer" width="{CLIP_WIDTH}" height="{CLIP_HEIGHT}" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject">\\r\\n	<param name="FileName" value="{CLIP_URL}" valuetype="ref" ref />\\r\\n	<param name="AudioStream" value="1" />\\r\\n	<param name="AutoSize" value="0" />\\r\\n	<param name="AutoStart" value="{CLIP_AUTOSTART}" />\\r\\n	<param name="AnimationAtStart" value="0" />\\r\\n	<param name="AllowScan" value="-1" />\\r\\n	<param name="AllowChangeDisplaySize" value="-1" />\\r\\n	<param name="AutoRewind" value="0" />\\r\\n	<param name="Balance" value="0" />\\r\\n	<param name="BaseURL" value />\\r\\n	<param name="BufferingTime" value="5" />\\r\\n	<param name="CaptioningID" value />\\r\\n	<param name="ClickToPlay" value="-1" />\\r\\n	<param name="CursorType" value="0" />\\r\\n	<param name="CurrentPosition" value="-1" />\\r\\n	<param name="CurrentMarker" value="0" />\\r\\n	<param name="DefaultFrame" value />\\r\\n	<param name="DisplayBackColor" value="0" />\\r\\n	<param name="DisplayForeColor" value="16777215" />\\r\\n	<param name="DisplayMode" value="1" />\\r\\n	<param name="DisplaySize" value="2" />\\r\\n	<param name="Enabled" value="-1" />\\r\\n	<param name="EnableContextMenu" value="-1" />\\r\\n	<param name="EnablePositionControls" value="-1" />\\r\\n	<param name="EnableFullScreenControls" value="-1" />\\r\\n	<param name="EnableTracker" value="-1" />\\r\\n	<param name="InvokeURLs" value="-1" />\\r\\n	<param name="Language" value="-1" />\\r\\n	<param name="Mute" value="0" />\\r\\n	<param name="PlayCount" value="1" />\\r\\n	<param name="PreviewMode" value="0" />\\r\\n	<param name="Rate" value="1" />\\r\\n	<param name="SAMILang" value />\\r\\n	<param name="SAMIStyle" value />\\r\\n	<param name="SAMIFileName" value />\\r\\n	<param name="SelectionStart" value="-1" />\\r\\n	<param name="SelectionEnd" value="-1" />\\r\\n	<param name="SendOpenStateChangeEvents" value="-1" />\\r\\n	<param name="SendWarningEvents" value="-1" />\\r\\n	<param name="SendErrorEvents" value="-1" />\\r\\n	<param name="SendKeyboardEvents" value="0" />\\r\\n	<param name="SendMouseClickEvents" value="0" />\\r\\n	<param name="SendMouseMoveEvents" value="0" />\\r\\n	<param name="SendPlayStateChangeEvents" value="-1" />\\r\\n	<param name="ShowCaptioning" value="0" />\\r\\n	<param name="ShowControls" value="-1" />\\r\\n	<param name="ShowAudioControls" value="-1" />\\r\\n	<param name="ShowDisplay" value="-1" />\\r\\n	<param name="ShowGotoBar" value="0" />\\r\\n	<param name="ShowPositionControls" value="0" />\\r\\n	<param name="ShowStatusBar" value="-1" />\\r\\n	<param name="ShowTracker" value="-1" />\\r\\n	<param name="TransparentAtStart" value="0" />\\r\\n	<param name="VideoBorderWidth" value="5" />\\r\\n	<param name="VideoBorderColor" value="333333" />\\r\\n	<param name="VideoBorder3D" value="-1" />\\r\\n	<param name="Volume" value="-1" />\\r\\n	<param name="WindowlessVideo" value="-1" />\\r\\n	<embed \\r\\n		type="application/x-mplayer2" \\r\\n		pluginspage="http://www.microsoft.com/windows/mediaplayer/" \\r\\n		width="{CLIP_WIDTH}" \\r\\n		height="{CLIP_HEIGHT}" \\r\\n		src="{CLIP_URL}" \\r\\n		name="player" \\r\\n		autostart="{CLIP_AUTOSTART}" \\r\\n		showcontrols="1" \\r\\n		showstatusbar="1" \\r\\n		showdisplay="1">\\r\\n	</embed>\\r\\n</object>\', \'Windows Media Player Movie\', \'wmv\'');
            $table->setData('2, \'<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"\\r\\n    WIDTH="{CLIP_WIDTH}"\\r\\n    HEIGHT="{CLIP_HEIGHT}"\\r\\n    CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">\\r\\n  	<PARAM name="SRC" VALUE="{CLIP_URL}" />\\r\\n	<PARAM name="AUTOPLAY" VALUE="false" />\\r\\n	<PARAM name="CONTROLLER" VALUE="true" />\\r\\n  	<EMBED SRC="{CLIP_URL}"\\r\\n 		WIDTH="{CLIP_WIDTH}"\\r\\n		HEIGHT="{CLIP_HEIGHT}"\\r\\n		AUTOPLAY="{CLIP_AUTOPLAY}"\\r\\n		CONTROLLER="true"\\r\\n		PLUGINSPAGE="http://www.apple.com/quicktime/download/">\\r\\n	</EMBED>\\r\\n</OBJECT>\', \'QuickTime Movie\', \'mov\'');
            $table->setData('3, \'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" height="{CLIP_HEIGHT}" width="{CLIP_WIDTH}">\\r\\n	<param name="movie" value="{CLIP_URL}" />\\r\\n	<param name="quality" value="best" />\\r\\n	<param name="play" value="{CLIP_AUTOPLAY}" />\\r\\n	<embed \\r\\n		height="{CLIP_HEIGHT}" \\r\\n		pluginspage="http://www.macromedia.com/go/getflashplayer" \\r\\n		src="{CLIP_URL}" \\r\\n		type="application/x-shockwave-flash" \\r\\n		width="{CLIP_WIDTH}" \\r\\n		quality="best" \\r\\n		play="{CLIP_URL}" />\\r\\n	</embed>\\r\\n</object>\', \'Flash\', \'swf\'');
            $table->setData('4, \'<object id="MediaPlayer1" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab# Version=5,1,52,701" standby="Loading Microsoft Windows® Media Player components..." type="application/x-oleobject" width="{CLIP_WIDTH}" height="{CLIP_HEIGHT}">\\r\\n	<param name="fileName" value="{CLIP_URL}" />\\r\\n	<param name="animationatStart" value="true" />\\r\\n	<param name="transparentatStart" value="true" />\\r\\n	<param name="autoStart" value="{CLIP_AUTOSTART}" />\\r\\n	<param name="showControls" value="true" />\\r\\n	<param name="Volume" value="-300" />\\r\\n	<embed \\r\\n		type="application/x-mplayer2" \\r\\n		pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" \\r\\n		src="{CLIP_URL}" \\r\\n		name="MediaPlayer1" \\r\\n		width="{CLIP_WIDTH}" \\r\\n		height="{CLIP_HEIGHT}" \\r\\n		autostart="{CLIP_AUTOSTART}" \\r\\n		showcontrols="1" volume="-300">\\r\\n	</embed>\\r\\n</object>\', \'Windows Media Player Audio\', \'wma\'');
            $table->setData('5, \'<object id="RVOCX" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="{CLIP_WIDTH}" height="{CLIP_HEIGHT}">\\r\\n	<param name="src" value="{CLIP_URL}" />\\r\\n	<param name="autostart" value="{CLIP_AUTOSTART}" />\\r\\n	<param name="controls" value="all" />\\r\\n	<param name="console" value="audio" />\\r\\n	<embed \\r\\n		type="audio/x-pn-realaudio-plugin" \\r\\n		src="{CLIP_URL}" \\r\\n		width="{CLIP_WIDTH}" \\r\\n		height="{CLIP_HEIGHT}" \\r\\n		autostart="{CLIP_AUTOSTART}" \\r\\n		controls="all" \\r\\n		console="audio">\\r\\n	</embed>\\r\\n</object>\', \'Real Player Audio\', \'rm\'');
            $table->setData('6, \'<object id="RVOCX" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="{CLIP_WIDTH}" height="{CLIP_HEIGHT}">\\r\\n	<param name="src" value="{CLIP_URL}" />\\r\\n	<param name="autostart" value="{CLIP_AUTOSTART}" />\\r\\n	<param name="controls" value="imagewindow,all" />\\r\\n	<param name="console" value="video" />\\r\\n	<embed \\r\\n		type="audio/x-pn-realaudio-plugin" \\r\\n		src="{CLIP_URL}" \\r\\n		width="{CLIP_WIDTH}" \\r\\n		height="{CLIP_HEIGHT}" \\r\\n		autostart="{CLIP_AUTOSTART}" \\r\\n		controls="imagewindow,all" \\r\\n		console="video">\\r\\n	</embed>\\r\\n</object>\', \'Real Player Video\', \'rm\'');
            $table->setData('7, \'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="{CLIP_WIDTH}" height="{CLIP_HEIGHT}"  codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0">\\\\r\\n	<param name="type" value="{CLIP_URL}" />\\r\\n	<param name="autoplay" value="{CLIP_AUTOPLAY}" />\\r\\n	<param name="target" value="myself" />\\r\\n	<param name="src" value="{CLIP_URL}" />\\r\\n	<param name="href" value="{CLIP_URL}" />\\r\\n	<param name="pluginspage" value="http://www.apple.com/quicktime/download/indext.html" />\\r\\n	<param name="ShowControls" value="1" />\\r\\n	<param name="ShowStatusBar" value="1" />\\r\\n	<param name="showdisplay" value="0" />\\r\\n	<embed \\r\\n		width="{CLIP_WIDTH}" \\r\\n		height="{CLIP_HEIGHT}" \\r\\n		src="{CLIP_URL}" \\r\\n		href="{CLIP_URL}" \\r\\n		type="video/quicktime" \\r\\n		target="myself" \\r\\n		border="0" \\r\\n		showcontrols="1" \\r\\n		showdisplay="0" \\r\\n		showstatusbar="1" \\r\\n		autoplay="{CLIP_AUTOPLAY}" \\r\\n		pluginspage="http://www.apple.com/quicktime/download/indext.html">\\r\\n	</embed>\\r\\n</object>\', \'QuickTime Audio\', \'mov\'');
            $ret = $dbupdater->updateTable($table) && $ret;
            unset($table);
            // Set the current date for created_date and modified_date and uid to admin
            $time = time();
            $table = new SmartmediaTable('smartmedia_clips');
            $table->addUpdatedField('created_date', $time);
            $table->addUpdatedField('created_uid', '1');
            $table->addUpdatedField('modified_date', $time);
            $table->addUpdatedField('modified_uid', '1');
            $ret = $dbupdater->updateTable($table) && $ret;
            unset($table);
            //set good format
            $clip_handler =& smartmedia_gethandler('clip');
            $clip_handler->updateAll('formatid', 2);
            echo "</ul>";
    }
    $newversion = round($xoopsModule->getVar('version') / 100, 2);
    //if successful, update smartmedia_meta table with new ver
    if ($ret) {
        printf(_AM_SMEDIA_DB_UPDATE_OK, $newversion);
        $ret = smartmedia_SetMeta('version', $newversion);
    } else {
        printf(_AM_SMEDIA_DB_UPDATE_ERR, $newversion);
    }
    smartmedia_modFooter();
    xoops_cp_footer();
}
Example #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);
}
Example #3
0
    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>";
}
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
global $smartmedia_category_handler, $smartmedia_item_handler;
xoops_cp_header();
global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $itemid;
smartmedia_adminMenu(0, _AM_SMEDIA_INDEX);
// Total categories
$totalcategories = $smartmedia_category_handler->getCategoriesCount(-1);
// Total Folders
$totalfolders = $smartmedia_folder_handler->getFoldersCount();
// Total Clips
$totalclips = $smartmedia_clip_handler->getClipsCount();
// Check Path Configuration
if (smartmedia_admin_getPathStatus('root', true) < 0 || smartmedia_admin_getPathStatus('images', true) < 0 || smartmedia_admin_getPathStatus('images/category', true) < 0 || smartmedia_admin_getPathStatus('images/folder', true) < 0 || smartmedia_admin_getPathStatus('images/clip', true) < 0) {
    pathConfiguration();
}
// -- //
smartmedia_collapsableBar('toptable', 'toptableicon');
echo "<img id='toptableicon' name='toptableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SMEDIA_INVENTORY . "</h3>";
echo "<div id='toptable'>";
echo "<br />";
Example #4
0
    echo "</div>";
}
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>";
}
if (!empty($_POST['submit'])) {
    include_once "mygroupperm.php";
    redirect_header(XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/admin/myblocksadmin.php", 1, _MD_AM_DBUPDATED);
}
xoops_cp_header();
if (file_exists('./mymenu.php')) {
    include './mymenu.php';
}
smartmedia_adminMenu(5, _AM_SMEDIA_BLOCKSANDGROUPS);
list_blocks();
list_groups();
xoops_cp_footer();
Example #5
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>";
}
Example #6
0
     echo "<br />";
     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);