当前位置: 首页>>代码示例>>PHP>>正文


PHP XoopsThemeForm::display方法代码示例

本文整理汇总了PHP中XoopsThemeForm::display方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsThemeForm::display方法的具体用法?PHP XoopsThemeForm::display怎么用?PHP XoopsThemeForm::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XoopsThemeForm的用法示例。


在下文中一共展示了XoopsThemeForm::display方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display_edit_form

function display_edit_form($cat_array, $form_title, $action)
{
    global $cattree;
    $myts =& MyTextSanitizer::getInstance();
    extract($cat_array);
    // Beggining of XoopsForm
    $form = new XoopsThemeForm($form_title, 'MainForm', '');
    // Hidden
    $form->addElement(new XoopsFormHidden('action', $action));
    $form->addElement(new XoopsFormHidden('cid', $cid));
    // Title
    $form->addElement(new XoopsFormText(_AM_CAT_TH_TITLE, 'title', 30, 50, $myts->htmlSpecialChars($title)), true);
    // Image URL
    $form->addElement(new XoopsFormText(_AM_CAT_TH_IMGURL, 'imgurl', 50, 150, $myts->htmlSpecialChars($imgurl)));
    // Parent Category
    ob_start();
    $cattree->makeMySelBox("title", "title", $pid, 1, 'pid');
    $cat_selbox = ob_get_contents();
    ob_end_clean();
    $form->addElement(new XoopsFormLabel(_AM_CAT_TH_PARENT, $cat_selbox));
    // Buttons
    $button_tray = new XoopsFormElementTray('', ' ');
    $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
    $button_tray->addElement(new XoopsFormButton('', 'reset', _CANCEL, 'reset'));
    $form->addElement($button_tray);
    // End of XoopsForm
    $form->display();
}
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:28,代码来源:index.php

示例2: displayForm

 /**
  * XoopsfaqCategory::displayForm()
  *
  * @return
  */
 function displayForm()
 {
     include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     $caption = $this->isNew() ? _AM_XOOPSFAQ_CREATENEW : sprintf(_AM_XOOPSFAQ_MODIFYITEM, $this->getVar('category_title'));
     $form = new XoopsThemeForm($caption, 'content', xoops_getenv('PHP_SELF'));
     $form->addElement(new XoopsFormHiddenToken());
     $form->addElement(new xoopsFormHidden('op', 'save'));
     $form->addElement(new xoopsFormHidden('category_id', $this->getVar('category_id', 'e')));
     // title
     $category_title = new XoopsFormText(_AM_XOOPSFAQ_E_CATEGORY_TITLE, 'category_title', 50, 150, $this->getVar('category_title', 'e'));
     $category_title->setDescription(_AM_XOOPSFAQ_E_CATEGORY_TITLE_DSC);
     $form->addElement($category_title, true);
     // order
     $category_order = new XoopsFormText(_AM_XOOPSFAQ_E_CATEGORY_WEIGHT, 'category_order', 5, 5, $this->getVar('category_order', 'e'));
     $category_order->setDescription(_AM_XOOPSFAQ_E_CATEGORY_WEIGHT_DSC);
     $form->addElement($category_order, false);
     $btnTray = new XoopsFormElementTray('', '');
     $btnSubmit = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
     $btnTray->addElement($btnSubmit);
     $btnCancel = new XoopsFormButton('', '', _CANCEL, 'button');
     $btnCancel->setExtra('onclick="history.go(-1)"');
     $btnTray->addElement($btnCancel);
     $form->addElement($btnTray);
     $form->display();
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:30,代码来源:category.php

示例3: editcat

function editcat($catid = '')
{
    $name = '';
    $description = '';
    global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify;
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    if ($modify) {
        $result = $xoopsDB->query("SELECT name, description FROM " . $xoopsDB->prefix("faqcategories") . " WHERE catID = '{$catid}'");
        list($name, $description) = mysql_fetch_row($result);
        if (mysql_num_rows($result) == 0) {
            redirect_header("index.php", 1, _AM_NOCATTOEDIT);
            exit;
        }
        $sform = new XoopsThemeForm(_AM_MODIFYCAT, "op", xoops_getenv('PHP_SELF'));
    } else {
        $sform = new XoopsThemeForm(_AM_ADDCAT, "op", xoops_getenv('PHP_SELF'));
    }
    $sform->addElement(new XoopsFormText(_AM_CATNAME, 'name', 50, 80, $name), true);
    $sform->addElement(new XoopsFormDhtmlTextArea(_AM_CATDESCRIPT, 'description', $description, 15, 60));
    $sform->addElement(new XoopsFormHidden('catid', $catid));
    $sform->addElement(new XoopsFormHidden('modify', $modify));
    $button_tray = new XoopsFormElementTray('', '');
    $hidden = new XoopsFormHidden('op', 'addcat');
    $button_tray->addElement($hidden);
    if ($modify == '0') {
        $button_tray->addElement(new XoopsFormButton('', 'update', _AM_CREATE, 'submit'));
    } else {
        $button_tray->addElement(new XoopsFormButton('', 'update', _AM_MODIFY, 'submit'));
    }
    $sform->addElement($button_tray);
    $sform->display();
    unset($hidden);
}
开发者ID:amjadtbssm,项目名称:website,代码行数:33,代码来源:category.php

示例4: sel_sibblings_form

function sel_sibblings_form()
{
    $form = new XoopsThemeForm('Current Sibblings', "current", "", "post");
    $sibblingshandler = xoops_getmodulehandler('sibblings', 'genobio');
    $sibblings = $sibblingshandler->getObjects($criteria);
    $element = array();
    foreach ($sibblings as $key => $item) {
        $element[$key] = new XoopsFormElementTray('Item ' . $item->getVar('id') . ':');
        $element[$key]->addElement(new XoopsFormLabel('', '<a href="index.php?op=sibblings&fct=edit&id=' . $item->getVar('sibblings_id') . '">' . _EDIT . '</a>&nbsp;<a href="index.php?index.php?op=sibblings&fct=delete&id=' . $item->getVar('sibblings_id') . '">' . _DELETE . '</a>'));
        $element[$key]->addElement(new XoopsFormLabel(_GB_AM_NICKNAME, '' . $item->getVar('nickname') . ''));
        $form->addElement($element[$key]);
    }
    $form->display();
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:14,代码来源:sibblings.forms.php

示例5: sel_members_form

function sel_members_form()
{
    $form = new XoopsThemeForm('Current Members', "current", "", "post");
    $membershandler = xoops_getmodulehandler('members', 'genobio');
    $criteria = new Criteria('1', 1);
    $members = $membershandler->getObjects($criteria);
    $element = array();
    foreach ($members as $key => $item) {
        $element[$key] = new XoopsFormElementTray('Item ' . $item->getVar('member_id') . ':');
        $element[$key]->setDescription('<a href="' . urldecode($item->getVar('domain')) . '/modules/genobio/?op=profile&id=' . $item->getVar('member_id') . '">View Profile</a>');
        $element[$key]->addElement(new XoopsFormLabel('', '<a href="index.php?op=members&fct=edit&id=' . $item->getVar('member_id') . '">Edit</a>&nbsp;<a href="index.php?op=profiles&id=' . $item->getVar('member_id') . '">Bio Profile</a>&nbsp;<a href="index.php?op=members&fct=delete&id=' . $item->getVar('member_id') . '">Delete</a>'));
        $element[$key]->addElement(new XoopsFormLabel('Display Name:', '' . $item->getVar('display_name') . ''));
        $element[$key]->addElement(new XoopsFormLabel('Domain:', urldecode($item->getVar('domain'))));
        $form->addElement($element[$key]);
    }
    $form->display();
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:17,代码来源:members.forms.php

示例6: sel_categories_form

function sel_categories_form()
{
    $form = new XoopsThemeForm('Current categoriess', "current", "", "post");
    $categorieshandler = xoops_getmodulehandler('categories', 'genobio');
    $criteria = new Criteria('1', 1);
    $categories = $categorieshandler->getObjects($criteria);
    $element = array();
    foreach ($categories as $key => $item) {
        $element[$key] = new XoopsFormElementTray('Item ' . $item->getVar('id') . ':');
        $element[$key]->addElement(new XoopsFormLabel('', '<a href="index.php?op=categories&fct=edit&id=' . $item->getVar('category_id') . '">' . _EDIT . '</a>&nbsp;<a href="index.php?op=categories&fct=delete&id=' . $item->getVar('category_id') . '">' . _DELETE . '</a>'));
        //$element[$key]->addElement(new XoopsFormText('Weight:', 'weight['.$item->getVar('category_id').']', 4, 5, $item->getVar('category_weight')));
        $element[$key]->addElement(new XoopsFormText(_GB_AM_CATNAME, 'category_name[' . $item->getVar('category_id') . ']', 25, 128, $item->getVar('category_name')));
        $element[$key]->addElement(new XoopsFormHidden('id[' . $key . ']', $item->getVar('category_id')));
        $form->addElement($element[$key]);
    }
    $form->addElement(new XoopsFormHidden("op", "categories"));
    $form->addElement(new XoopsFormHidden("fct", "saveall"));
    $form->addElement(new XoopsFormButton('', 'contents_submit', _SUBMIT, "submit"));
    $form->display();
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:20,代码来源:categories.forms.php

示例7: transfer_email

function transfer_email(&$data)
{
	global $xoopsModule, $xoopsConfig, $xoopsUser, $xoopsModuleConfig;
	global $xoopsLogger, $xoopsOption, $xoopsTpl, $xoopsblock;

	$_config = require(dirname(__FILE__)."/config.php");
	
	include XOOPS_ROOT_PATH."/header.php";
	require_once(XOOPS_ROOT_PATH . "/class/xoopsformloader.php");
	$content  = str_replace("<br />", "\n", $data["content"]);
	$content  = str_replace("<br>", "\n", $content);
	$content  = forum_html2text($content);
	$content = $data["title"]."\n".$content."\n\n"._MORE."\n".$data["url"];
	$form_email = new XoopsThemeForm(_MD_TRANSFER_EMAIL, "formemail", XOOPS_URL."/modules/".$GLOBALS["xoopsModule"]->getVar("dirname")."/class/transfer/email/action.email.php");
	$form_email->addElement(new XoopsFormText(_MD_TRANSFER_EMAIL_ADDRESS, "email", 50, 100), true);
	$form_email->addElement(new XoopsFormText(_MD_TRANSFER_EMAIL_TITLE, "title", 50, 255, $data["title"]), true);
	$form_email->addElement(new XoopsFormTextArea(_MD_TRANSFER_EMAIL_CONTENT, "content", $content, 10, 60), true);
	$form_email->addElement(new XoopsFormButton("", "email_submit", _SUBMIT, "submit"));
	$form_email->display();
	$GLOBALS["xoopsOption"]['output_type'] = "plain";
	include XOOPS_ROOT_PATH."/footer.php";
	exit();
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:23,代码来源:index.php

示例8: XoopsPageNav

    $nav = new XoopsPageNav($usercount, $limit, $start, "start", $nav_extra);
    $user_select_nav = new XoopsFormLabel(sprintf(_MA_SEARCH_COUNT, $usercount), $nav->renderNav(4));
    $user_select_tray->addElement($user_select_nav);
    $add_button = new XoopsFormButton('', '', _ADD, 'button');
    $add_button->setExtra('onclick="addusers();"');
    $close_button = new XoopsFormButton('', '', _CLOSE, 'button');
    $close_button->setExtra('onclick="window.close()"');
    $button_tray = new XoopsFormElementTray("");
    $button_tray->addElement($add_button);
    $button_tray->addElement(new XoopsFormButton('', '', _CANCEL, 'reset'));
    $button_tray->addElement($close_button);
    $form_user->addElement($user_select_tray);
    if (!empty($_REQUEST["action"])) {
        $group_select = new XoopsFormSelect(_MA_SEARCH_GROUP, 'group', $_REQUEST['group']);
        $group_select->addOptionArray($groups);
        $rank_select = new XoopsFormSelect(_MA_SEARCH_RANK, 'rank', $_REQUEST['rank']);
        $rank_select->addOptionArray($ranks);
        $rank_select->setDescription(_MA_SEARCH_RANK_DESC);
        $form_user->addElement($group_select);
        $form_user->addElement($rank_select);
        $refresh_button = new XoopsFormButton('', '', _MA_SEARCH_REFRESH, 'submit');
        $button_tray->addElement($refresh_button);
    }
    $form_user->addElement(new XoopsFormHidden('action', $_REQUEST["action"]));
    $form_user->addElement(new XoopsFormHidden('target', $_REQUEST["target"]));
    $form_user->addElement(new XoopsFormHidden('multiple', $_REQUEST["multiple"]));
    $form_user->addElement($button_tray);
    $form_user->display();
}
$xoopsOption['output_type'] = "plain";
xoops_cp_footer();
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:31,代码来源:userselect.php

示例9: audienceForm

function audienceForm($id = 0)
{
    $id = intval($id);
    if ($id > 0) {
        global $xoopsModule;
        $audience_handler =& xoops_getmodulehandler('audience', 'AMS');
        $thisaudience =& $audience_handler->get($id);
        $audience = $thisaudience->getVar('audience');
        $gperm_handler =& xoops_gethandler('groupperm');
        $groups = $gperm_handler->getGroupIds("ams_audience", $id, $xoopsModule->getVar('mid'));
    } else {
        $audience = "";
        $groups = array();
    }
    include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
    $aform = new XoopsThemeForm(_AMS_AM_MANAGEAUDIENCES, "audienceform", 'index.php', 'post');
    if ($id > 0) {
        $aform->addElement(new XoopsFormHidden('aid', $id));
    }
    $aform->addElement(new XoopsFormHidden('op', 'audience'));
    $aform->addElement(new XoopsFormText(_AMS_AM_AUDIENCENAME, 'aname', 12, 20, $audience), true);
    $aform->addElement(new XoopsFormSelectGroup(_AMS_AM_ACCESSRIGHTS, 'groups', true, $groups, 5, true), true);
    $aform->addElement(new XoopsFormButton('', 'submitaud', _AMS_AM_SAVE, 'submit'));
    $aform->display();
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:25,代码来源:index.php

示例10: form_user


//.........这里部分代码省略.........
            $occ_value = $user->getVar('user_occ', 'E');
            $interest_value = $user->getVar('user_intrest', 'E');
            $sig_value = $user->getVar('user_sig', 'E');
            $sig_cbox_value = $user->getVar('attachsig') == 1 ? 1 : 0;
            $umode_value = $user->getVar('umode');
            $uorder_value = $user->getVar('uorder');
            // RMV-NOTIFY
            $notify_method_value = $user->getVar('notify_method');
            $notify_mode_value = $user->getVar('notify_mode');
            $bio_value = $user->getVar('bio', 'E');
            $rank_value = $user->rank(false);
            $mailok_value = $user->getVar('user_mailok', 'E');
            $form_title = _AM_SYSTEM_USERS_UPDATEUSER . ': ' . $user->getVar('uname');
            $form_isedit = true;
            $groups = array_values($user->getGroups());
        }
    }
    //Affichage du formulaire
    $form = new XoopsThemeForm($form_title, 'form_user', 'admin.php', 'post', true);
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_NICKNAME, 'username', 25, 25, $uname_value), true);
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_NAME, 'name', 30, 60, $name_value));
    $email_tray = new XoopsFormElementTray(_AM_SYSTEM_USERS_EMAIL, '<br>');
    $email_text = new XoopsFormText('', 'email', 30, 60, $email_value);
    $email_tray->addElement($email_text, true);
    $email_cbox = new XoopsFormCheckBox('', 'user_viewemail', $email_cbox_value);
    $email_cbox->addOption(1, _AM_SYSTEM_USERS_AOUTVTEAD);
    $email_tray->addElement($email_cbox);
    $form->addElement($email_tray, true);
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_URL, 'url', 30, 100, $url_value));
    $form->addElement(new XoopsFormSelectTimezone(_AM_SYSTEM_USERS_TIMEZONE, 'timezone_offset', $timezone_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_ICQ, 'user_icq', 15, 15, $icq_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_AIM, 'user_aim', 18, 18, $aim_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_YIM, 'user_yim', 25, 25, $yim_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_MSNM, 'user_msnm', 30, 100, $msnm_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_LOCATION, 'user_from', 30, 100, $location_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_OCCUPATION, 'user_occ', 30, 100, $occ_value));
    $form->addElement(new XoopsFormText(_AM_SYSTEM_USERS_INTEREST, 'user_intrest', 30, 150, $interest_value));
    $sig_tray = new XoopsFormElementTray(_AM_SYSTEM_USERS_SIGNATURE, '<br>');
    $sig_tarea = new XoopsFormTextArea('', 'user_sig', $sig_value);
    $sig_tray->addElement($sig_tarea);
    $sig_cbox = new XoopsFormCheckBox('', 'attachsig', $sig_cbox_value);
    $sig_cbox->addOption(1, _AM_SYSTEM_USERS_SHOWSIG);
    $sig_tray->addElement($sig_cbox);
    $form->addElement($sig_tray);
    $umode_select = new XoopsFormSelect(_AM_SYSTEM_USERS_CDISPLAYMODE, 'umode', $umode_value);
    $umode_select->addOptionArray(array('nest' => _NESTED, 'flat' => _FLAT, 'thread' => _THREADED));
    $form->addElement($umode_select);
    $uorder_select = new XoopsFormSelect(_AM_SYSTEM_USERS_CSORTORDER, 'uorder', $uorder_value);
    $uorder_select->addOptionArray(array('0' => _OLDESTFIRST, '1' => _NEWESTFIRST));
    $form->addElement($uorder_select);
    // RMV-NOTIFY
    $notify_method_select = new XoopsFormSelect(_NOT_NOTIFYMETHOD, 'notify_method', $notify_method_value);
    $notify_method_select->addOptionArray(array(XOOPS_NOTIFICATION_METHOD_DISABLE => _NOT_METHOD_DISABLE, XOOPS_NOTIFICATION_METHOD_PM => _NOT_METHOD_PM, XOOPS_NOTIFICATION_METHOD_EMAIL => _NOT_METHOD_EMAIL));
    $form->addElement($notify_method_select);
    $notify_mode_select = new XoopsFormSelect(_NOT_NOTIFYMODE, 'notify_mode', $notify_mode_value);
    $notify_mode_select->addOptionArray(array(XOOPS_NOTIFICATION_MODE_SENDALWAYS => _NOT_MODE_SENDALWAYS, XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE => _NOT_MODE_SENDONCE, XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT => _NOT_MODE_SENDONCEPERLOGIN));
    $form->addElement($notify_mode_select);
    $form->addElement(new XoopsFormTextArea(_AM_SYSTEM_USERS_EXTRAINFO, 'bio', $bio_value));
    $rank_select = new XoopsFormSelect(_AM_SYSTEM_USERS_RANK, 'rank', $rank_value);
    $ranklist = XoopsLists::getUserRankList();
    if (count($ranklist) > 0) {
        $rank_select->addOption(0, '--------------');
        $rank_select->addOptionArray($ranklist);
    } else {
        $rank_select->addOption(0, _AM_SYSTEM_USERS_NSRID);
    }
    $form->addElement($rank_select);
    // adding a new user requires password fields
    if (!$form_isedit) {
        $form->addElement(new XoopsFormPassword(_AM_SYSTEM_USERS_PASSWORD, 'password', 10, 32), true);
        $form->addElement(new XoopsFormPassword(_AM_SYSTEM_USERS_RETYPEPD, 'pass2', 10, 32), true);
    } else {
        $form->addElement(new XoopsFormPassword(_AM_SYSTEM_USERS_PASSWORD, 'password', 10, 32));
        $form->addElement(new XoopsFormPassword(_AM_SYSTEM_USERS_RETYPEPD, 'pass2', 10, 32));
    }
    $form->addElement(new XoopsFormRadioYN(_AM_SYSTEM_USERS_ACCEPT_EMAIL, 'user_mailok', $mailok_value));
    //Groups administration addition XOOPS 2.0.9: Mith
    $gperm_handler = xoops_getHandler('groupperm');
    //If user has admin rights on groups
    if ($gperm_handler->checkRight('system_admin', XOOPS_SYSTEM_GROUP, $xoopsUser->getGroups(), 1)) {
        //add group selection
        $group_select[] = new XoopsFormSelectGroup(_AM_SYSTEM_USERS_GROUPS, 'groups', false, $groups, 5, true);
    } else {
        //add each user groups
        foreach ($groups as $key => $group) {
            $group_select[] = new XoopsFormHidden('groups[' . $key . ']', $group);
        }
    }
    foreach ($group_select as $group) {
        $form->addElement($group);
        unset($group);
    }
    $form->addElement(new XoopsFormHidden('fct', 'users'));
    $form->addElement(new XoopsFormHidden('op', 'users_save'));
    $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
    if (!empty($uid_value)) {
        $form->addElement(new XoopsFormHidden('uid', $uid_value));
    }
    $form->display();
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:101,代码来源:users.php

示例11: publisher_editItem


//.........这里部分代码省略.........
                break;
            case _PUBLISHER_STATUS_OFFLINE:
                $breadcrumb_action1 = _CO_PUBLISHER_OFFLINE;
                $breadcrumb_action2 = _AM_PUBLISHER_EDITING;
                $page_title = _AM_PUBLISHER_OFFLINEEDITING;
                $page_info = _AM_PUBLISHER_OFFLINEEDITING_INFO;
                $button_caption = _AM_PUBLISHER_MODIFY;
                $new_status = _PUBLISHER_STATUS_OFFLINE;
                break;
            case _PUBLISHER_STATUS_REJECTED:
                $breadcrumb_action1 = _CO_PUBLISHER_REJECTED;
                $breadcrumb_action2 = _AM_PUBLISHER_REJECTED;
                $page_title = _AM_PUBLISHER_REJECTED_EDIT;
                $page_info = _AM_PUBLISHER_REJECTED_EDIT_INFO;
                $button_caption = _AM_PUBLISHER_MODIFY;
                $new_status = _PUBLISHER_STATUS_REJECTED;
                break;
            case _PUBLISHER_STATUS_NOTSET:
                // Then it's a clone...
                $breadcrumb_action1 = _AM_PUBLISHER_ITEMS;
                $breadcrumb_action2 = _AM_PUBLISHER_CLONE_NEW;
                $button_caption = _AM_PUBLISHER_CREATE;
                $new_status = _PUBLISHER_STATUS_PUBLISHED;
                $page_title = _AM_PUBLISHER_ITEM_DUPLICATING;
                $page_info = _AM_PUBLISHER_ITEM_DUPLICATING_DSC;
                break;
            case "default":
            default:
                $breadcrumb_action1 = _AM_PUBLISHER_ITEMS;
                $breadcrumb_action2 = _AM_PUBLISHER_EDITING;
                $page_title = _AM_PUBLISHER_PUBLISHEDEDITING;
                $page_info = _AM_PUBLISHER_PUBLISHEDEDITING_INFO;
                $button_caption = _AM_PUBLISHER_MODIFY;
                $new_status = _PUBLISHER_STATUS_PUBLISHED;
                break;
        }
        $categoryObj = $itemObj->category();
        if ($showmenu) {
            //publisher_adminMenu(2, $breadcrumb_action1 . " > " . $breadcrumb_action2);
        }
        echo "<br />\n";
        publisher_openCollapsableBar('edititemtable', 'edititemicon', $page_title, $page_info);
        if (!$clone) {
            echo "<form><div style=\"margin-bottom: 10px;\">";
            echo "<input type='button' name='button' onclick=\"location='item.php?op=clone&itemid=" . $itemObj->itemid() . "'\" value='" . _AM_PUBLISHER_CLONE_ITEM . "'>&nbsp;&nbsp;";
            echo "</div></form>";
        }
    } else {
        // there's no parameter, so we're adding an item
        $itemObj = $publisher->getHandler('item')->create();
        $itemObj->setVarsFromRequest();
        $categoryObj = $publisher->getHandler('category')->create();
        $breadcrumb_action1 = _AM_PUBLISHER_ITEMS;
        $breadcrumb_action2 = _AM_PUBLISHER_CREATINGNEW;
        $button_caption = _AM_PUBLISHER_CREATE;
        $new_status = _PUBLISHER_STATUS_PUBLISHED;
        if ($showmenu) {
            //publisher_adminMenu(2, $breadcrumb_action1 . " > " . $breadcrumb_action2);
        }
        $sel_categoryid = isset($_GET['categoryid']) ? $_GET['categoryid'] : 0;
        $categoryObj->setVar('categoryid', $sel_categoryid);
        publisher_openCollapsableBar('createitemtable', 'createitemicon', _AM_PUBLISHER_ITEM_CREATING, _AM_PUBLISHER_ITEM_CREATING_DSC);
    }
    $sform = $itemObj->getForm(_AM_PUBLISHER_ITEMS);
    $sform->assign($formTpl);
    $formTpl->display('db:publisher_submit.html');
    publisher_closeCollapsableBar('edititemtable', 'edititemicon');
    publisher_openCollapsableBar('pagewraptable', 'pagewrapicon', _AM_PUBLISHER_PAGEWRAP, _AM_PUBLISHER_PAGEWRAPDSC);
    $dir = publisher_getUploadDir(true, 'content');
    if (!preg_match('/777/i', decoct(fileperms($dir)))) {
        echo "<font color='FF0000'><h4>" . _AM_PUBLISHER_PERMERROR . "</h4></font>";
    }
    // Upload File
    echo "<form name='form_name2' id='form_name2' action='pw_upload_file.php' method='post' enctype='multipart/form-data'>";
    echo "<table cellspacing='1' width='100%' class='outer'>";
    echo "<tr><th colspan='2'>" . _AM_PUBLISHER_UPLOAD_FILE . "</th></tr>";
    echo "<tr valign='top' align='left'><td class='head'>" . _AM_PUBLISHER_SEARCH_PW . "</td><td class='even'><input type='file' name='fileupload' id='fileupload' size='30' /></td></tr>";
    echo "<tr valign='top' align='left'><td class='head'><input type='hidden' name='MAX_FILE_SIZE' id='op' value='500000' /></td><td class='even'><input type='submit' name='submit' value='" . _AM_PUBLISHER_UPLOAD . "' /></td></tr>";
    echo "<input type='hidden' name='backto' value='{$publisher_current_page}'/>";
    echo "</table>";
    echo "</form>";
    // Delete File
    $form = new XoopsThemeForm(_CO_PUBLISHER_DELETEFILE, "form_name", "pw_delete_file.php");
    $pWrap_select = new XoopsFormSelect(publisher_getUploadDir(true, 'content'), "address");
    $folder = dir($dir);
    while ($file = $folder->read()) {
        if ($file != "." && $file != "..") {
            $pWrap_select->addOption($file, $file);
        }
    }
    $folder->close();
    $form->addElement($pWrap_select);
    $delfile = "delfile";
    $form->addElement(new XoopsFormHidden('op', $delfile));
    $submit = new XoopsFormButton("", "submit", _AM_PUBLISHER_BUTTON_DELETE, "submit");
    $form->addElement($submit);
    $form->addElement(new XoopsFormHidden('backto', $publisher_current_page));
    $form->display();
    publisher_closeCollapsableBar('pagewraptable', 'pagewrapicon');
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:101,代码来源:item.php

示例12: Criteria

            $criteria_article->setSort("art_id");
            $criteria_article->setOrder("DESC");
            $article_list = $article_list + $article_handler->getList(new Criteria("cat_id", $category_obj->getVar("cat_id")));
            $article_select = new XoopsFormSelect(art_constant("MD_ENTRY_SELECT"), "cat_entry", $category_obj->getVar("cat_entry"));
            $article_select->addOptionArray($article_list);
            $form_art->addElement($article_select);
        }
    }
}
// Sponsor links
$form_art->addElement(new XoopsFormTextArea(art_constant("MD_SPONSOR"), "cat_sponsor", $category_obj->getVar("cat_sponsor", "E")));
//$form_art->addElement(new XoopsFormLabel(art_constant("MD_SPONSOR_DESC"), art_constant("MD_SPONSOR_DESC_TEXT")));
$form_art->addElement(new XoopsFormHidden("cat_id", $category_obj->getVar("cat_id")));
$form_art->addElement(new XoopsFormHidden("from", $from));
$button_tray = new XoopsFormElementTray("", "");
$button_tray->addElement(new XoopsFormButton("", "submit", _SUBMIT, "submit"));
$cancel_button = new XoopsFormButton('', 'cancel', _CANCEL, 'button');
if (!empty($from)) {
    $extra = "admin/admin.category.php";
} elseif ($category_obj->getVar("cat_id")) {
    $extra = "view.category.php?category=" . $category_obj->getVar("cat_id");
} elseif ($category_obj->getVar("cat_pid")) {
    $extra = "view.category.php?category=" . $category_obj->getVar("cat_pid");
} else {
    $extra = "index.php";
}
$cancel_button->setExtra("onclick='window.document.location=\"" . $extra . "\"'");
$button_tray->addElement($cancel_button);
$form_art->addElement($button_tray);
$form_art->display();
开发者ID:trabisdementia,项目名称:xuups,代码行数:30,代码来源:form.category.php

示例13: getForm

 function getForm($action = false)
 {
     global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
     if ($action === false) {
         $action = $_SERVER['REQUEST_URI'];
     }
     $title = $this->isNew() ? sprintf(_AM_TDMCREATE_MODULES_ADD) : sprintf(_AM_TDMCREATE_MODULES_EDIT);
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     $form = new XoopsThemeForm($title, 'form_modules', $action, 'post', true);
     $form->setExtra('enctype="multipart/form-data"');
     $form->insertBreak('<div align="center"><b>' . _AM_TDMCREATE_MODULES_IMPORTANT . '</b></div>', 'head');
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_NAME, 'modules_name', 50, 255, $this->getVar('modules_name')), true);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_VERSION, 'modules_version', 50, 255, $this->getVar('modules_version')), true);
     $form->addElement(new XoopsFormTextArea(_AM_TDMCREATE_MODULES_DESCRIPTION, 'modules_description', $this->getVar('modules_description'), 3, 47), true);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR, 'modules_author', 50, 255, $this->getVar('modules_author')), true);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_LICENSE, 'modules_license', 50, 255, $this->getVar('modules_license')), true);
     $modules_display_menu = $this->isNew() ? '1' : $this->getVar('modules_display_menu');
     $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_DISPLAY_MENU, 'modules_display_menu', $modules_display_menu, _YES, _NO));
     $modules_display_admin = $this->isNew() ? '1' : $this->getVar('modules_display_admin');
     $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_DISPLAY_ADMIN, 'modules_display_admin', $modules_display_admin, _YES, _NO));
     $modules_active_search = $this->isNew() ? '1' : $this->getVar('modules_active_search');
     $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_SEARCH, 'modules_active_search', $modules_active_search, _YES, _NO));
     $modules_image = $this->getVar('modules_image') ? $this->getVar('modules_image') : 'blank.gif';
     $uploadirectory = "/modules/" . $xoopsModule->dirname() . "/images/uploads/modules";
     $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULES_IMAGE, '<br />');
     $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, "./modules/" . $xoopsModule->dirname() . "/images/uploads/modules");
     $imageselect = new XoopsFormSelect($imgpath, 'modules_image', $modules_image);
     $modules_image_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $uploadirectory);
     foreach ($modules_image_array as $image) {
         $imageselect->addOption("{$image}", $image);
     }
     $imageselect->setExtra("onchange='showImgSelected(\"image3\", \"modules_image\", \"" . $uploadirectory . "\", \"\", \"" . XOOPS_URL . "\")'");
     $imgtray->addElement($imageselect, false);
     $imgtray->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $uploadirectory . "/" . $modules_image . "' name='image3' id='image3' alt='' />"));
     $fileseltray = new XoopsFormElementTray('', '<br />');
     $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD, 'attachedfile', 104857600), false);
     $fileseltray->addElement(new XoopsFormLabel(''), false);
     $imgtray->addElement($fileseltray);
     $form->addElement($imgtray);
     $form->insertBreak('<div align="center"><b>' . _AM_TDMCREATE_MODULES_NOTIMPORTANT . '</b></div>', 'head');
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR_WEBSITE_URL, 'modules_author_website_url', 50, 255, $this->getVar('modules_author_website_url')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_AUTHOR_WEBSITE_NAME, 'modules_author_website_name', 50, 255, $this->getVar('modules_author_website_name')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_CREDITS, 'modules_credits', 50, 255, $this->getVar('modules_credits')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE_INFO, 'modules_release_info', 50, 255, $this->getVar('modules_release_info')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE_FILE, 'modules_release_file', 50, 255, $this->getVar('modules_release_file')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MANUAL, 'modules_manual', 50, 255, $this->getVar('modules_manual')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MANUAL_FILE, 'modules_manual_file', 50, 255, $this->getVar('modules_manual_file')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_DEMO_SITE_URL, 'modules_demo_site_url', 50, 255, $this->getVar('modules_demo_site_url')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_DEMO_SITE_NAME, 'modules_demo_site_name', 50, 255, $this->getVar('modules_demo_site_name')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MODULE_WEBSITE_URL, 'modules_module_website_url', 50, 255, $this->getVar('modules_module_website_url')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_MODULE_WEBSITE_NAME, 'modules_module_website_name', 50, 255, $this->getVar('modules_module_website_name')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_RELEASE, 'modules_release', 50, 255, $this->getVar('modules_release')), false);
     $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULES_STATUS, 'modules_module_status', 50, 255, $this->getVar('modules_module_status')), false);
     $form->addElement(new XoopsFormHidden('op', 'modules_save'));
     $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
     $form->display();
     return $form;
 }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:58,代码来源:tdmcreate_modules.php

示例14: editfaq

function editfaq($showmenu = false, $faqid = -1)
{
    global $faq_handler, $category_handler, $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 faq
    if ($faqid != -1) {
        // Creating the FAQ object
        $faqObj = new sfFaq($faqid);
        if ($faqObj->notLoaded()) {
            redirect_header("faq.php", 1, _AM_SF_NOARTTOEDIT);
            exit;
        }
        switch ($faqObj->status()) {
            case _SF_STATUS_ASKED:
                $breadcrumb_action = _AM_SF_APPROVING;
                $collapsableBar_title = _AM_SF_QUESTION_APPROVING;
                $collapsableBar_info = _AM_SF_QUESTION_APPROVING_INFO;
                $button_caption = _AM_SF_QUEUE;
                break;
            case "default":
            default:
                $breadcrumb_action = _AM_SF_EDITING;
                $collapsableBar_title = _AM_SF_EDITQUES;
                $collapsableBar_info = _AM_SF_EDITING_INFO;
                $button_caption = _AM_SF_MODIFY;
                break;
        }
        // Creating the category of this FAQ
        $categoryObj =& $category_handler->get($faqObj->categoryid());
        if ($showmenu) {
            sf_adminMenu(3, _AM_SF_OPEN_QUESTIONS . " > " . $breadcrumb_action);
        }
        echo "<br />\n";
        sf_collapsableBar('bottomtable', 'bottomtableicon');
        echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . $collapsableBar_title . "</h3>";
        echo "<div id='bottomtable'>";
        echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $collapsableBar_info . "</span>";
    } else {
        // there's no parameter, so we're adding a faq
        $faqObj =& $faq_handler->create();
        $faqObj->setVar('uid', $xoopsUser->getVar('uid'));
        $categoryObj =& $category_handler->create();
        $breadcrumb_action = _AM_SF_CREATINGNEW;
        $button_caption = _AM_SF_CREATE;
        if ($showmenu) {
            sf_adminMenu(3, _AM_SF_OPEN_QUESTIONS . " > " . $breadcrumb_action);
        }
        sf_collapsableBar('bottomtable', 'bottomtableicon');
        echo "<img id='bottomtableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/close12.gif alt='' /></a>&nbsp;" . _AM_SF_CREATEQUESTION . "</h3>";
        echo "<div id='bottomtable'>";
    }
    $sform = new XoopsThemeForm(_AM_SF_OPEN_QUESTION, "op", xoops_getenv('PHP_SELF'));
    $sform->setExtra('enctype="multipart/form-data"');
    // faq requester
    $sform->addElement(new XoopsFormLabel(_AM_SF_REQUESTED_BY, sf_getLinkedUnameFromId($faqObj->uid(), $xoopsModuleConfig['userealname'])));
    // CATEGORY
    /*
     * Get information for pulldown menu using XoopsTree.
     * First var is the database table
     * Second var is the unique field ID for the categories
     * Last one is not set as we do not have sub menus in Smartfaq
     */
    $mytree = new XoopsTree($xoopsDB->prefix("smartfaq_categories"), "categoryid", "parentid");
    ob_start();
    $mytree->makeMySelBox("name", "weight", $categoryObj->categoryid());
    $sform->addElement(new XoopsFormLabel(_AM_SF_CATEGORY_QUESTION, ob_get_contents()));
    ob_end_clean();
    // faq QUESTION
    $sform->addElement(new XoopsFormTextArea(_AM_SF_QUESTION, 'question', $faqObj->question(), 7, 60));
    // PER ITEM PERMISSIONS
    $member_handler =& xoops_gethandler('member');
    $group_list =& $member_handler->getGroupList();
    $groups_checkbox = new XoopsFormCheckBox(_AM_SF_PERMISSIONS_QUESTION, 'groups[]', $faqObj->getGroups_read());
    foreach ($group_list as $group_id => $group_name) {
        if ($group_id != XOOPS_GROUP_ADMIN) {
            $groups_checkbox->addOption($group_id, $group_name);
        }
    }
    $sform->addElement($groups_checkbox);
    // faq ID
    $sform->addElement(new XoopsFormHidden('faqid', $faqObj->faqid()));
    $button_tray = new XoopsFormElementTray('', '');
    $hidden = new XoopsFormHidden('op', 'addfaq');
    $button_tray->addElement($hidden);
    $sform->addElement(new XoopsFormHidden('status', $faqObj->status()));
    // Setting the FAQ Status
    /*	$status_select = new XoopsFormSelect('', 'status', $status);
    	$status_select->addOptionArray(sf_getStatusArray());
    	$status_tray = new XoopsFormElementTray(_AM_SF_STATUS_EXP , '&nbsp;');
    	$status_tray->addElement($status_select);
    	$sform->addElement($status_tray);
    	*/
    if ($faqid == -1) {
        // there's no faqid? Then it's a new faq
        // $button_tray -> addElement( new XoopsFormButton( '', 'mod', _AM_SF_CREATE, 'submit' ) );
        $butt_create = new XoopsFormButton('', '', _AM_SF_CREATE, 'submit');
        $butt_create->setExtra('onclick="this.form.elements.op.value=\'addfaq\'"');
        $button_tray->addElement($butt_create);
        $butt_clear = new XoopsFormButton('', '', _AM_SF_CLEAR, 'reset');
        $button_tray->addElement($butt_clear);
//.........这里部分代码省略.........
开发者ID:trabisdementia,项目名称:xuups,代码行数:101,代码来源:question.php

示例15: del_keyword_form

function del_keyword_form($keyid)
{
    global $keywords;
    $key = $keywords->get($keyid);
    $form = new XoopsThemeForm(_AM_KEYWORDS_REMOVE, 'RemoveForm', 'keywords.php');
    $form->addElement(new XoopsFormLabel(_AM_KEYWORDS_NAME, $key['name']));
    $form->addElement(new XoopsFormLabel(_AM_KEYWORDS_DESC, $key['description']));
    $form->addElement(new XoopsFormLabel(_AM_KEYWORDS_COUNT, sprintf(_AM_KEYWORDS_PRINT, $key['name'], $keywords->count($keyid))));
    $form->addElement(new XoopsFormHidden('keyid', $keyid));
    $form->addElement(new XoopsFormButton('', 'delkey', _DELETE, 'submit'));
    $form->display();
}
开发者ID:nbuy,项目名称:xoops-modules-medialinks,代码行数:12,代码来源:keywords.php


注:本文中的XoopsThemeForm::display方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。