• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getButton函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getButton函数的典型用法代码示例。如果您正苦于以下问题:PHP getButton函数的具体用法?PHP getButton怎么用?PHP getButton使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: getCheckboxHtml

    <li class="option">
        <div class="title">
            <label for="setChecksum">Checksum</label>
        </div>
        <div class="value">
            <?php 
echo getCheckboxHtml('setChecksum', $setChecksum, array('value' => 1));
?>
        </div>
    </li>
</ul>

<div id="validCharacters">
    <h3>Valid Characters</h3>
    <?php 
foreach ($characters as $character) {
    echo getButton($character);
}
?>
</div>

<div id="explanation">
    <h3>Explanation</h3>
    <ul>
        <li>Developed by the MSI Data Corporation.</li>
        <li>Used primarily to mark retail shelves for inventory control.</li>
    </ul>
</div>

<?php 
include 'footer.php';
开发者ID:shojibflamon,项目名称:Bar-Code-example,代码行数:31,代码来源:msi.php


示例2: RightColumnContent

 public function RightColumnContent()
 {
     if (in_array($this->Action, array('add', 'view', 'edit'))) {
         $languages = Db_Language::getLanguageWithKey();
         $this->TPL->assign('languages', $languages);
         $options = Db_Options::getFulLDetails();
         $product_options = Db_ProductOptions::getOptionsByProductId($this->Id);
         $this->TPL->assign('options', $options);
         $this->TPL->assign('product_options', $product_options);
     }
     if (in_array($this->Action, array('view', 'edit'))) {
         $product = Db_Products::getDetailsById($this->Id);
         $product_trans = Db_ProductTrans::getDetailsById($this->Id);
         $this->TPL->assign('product', $product);
         $this->TPL->assign('product_trans', $product_trans);
     }
     switch ($this->Action) {
         case 'delete':
             if ($this->Id == 0) {
                 break;
             }
             Db_Products::deleteByField('id', $this->Id);
             Db_ProductTrans::deleteAllByField('pt_product_id', $this->Id);
             Db_ProductOptions::deleteAllByField('po_product_id', $this->Id);
             Upload::rrmdir(BASE_PATH . 'files/' . $this->img_path . $this->Id, true);
             $this->Msg->SetMsg($this->_T('success_item_deleted'));
             $this->Redirect($this->PageUrl);
             break;
         case 'save':
             $p_model = getPost('p_model');
             $p_url = getPost('p_url');
             $p_published = isset($_POST['p_published']) ? 1 : 0;
             $p_price = getPost('p_price');
             $p_discount = getPost('p_discount');
             $p_discount_status = isset($_POST['p_discount_status']) ? 1 : 0;
             $pt_title = getPost('pt_title');
             $pt_description = getPost('pt_description');
             $options = getPost('options');
             $product = new Db_Products($this->DB, $this->Id, 'id');
             $product->p_model = $p_model;
             $product->p_url = $p_url;
             $product->p_published = $p_published;
             $product->p_price = $p_price;
             $product->p_discount = $p_discount;
             $product->p_discount_status = $p_discount_status;
             $product->p_type = $this->productType;
             $product->save();
             foreach ($pt_title as $lang => $item) {
                 $product_trans = new Db_ProductTrans();
                 $product_trans->findByFields(array('pt_product_id' => $product->id, 'pt_lang_id' => $lang));
                 $product_trans->pt_title = $pt_title[$lang];
                 $product_trans->pt_description = $pt_description[$lang];
                 $product_trans->pt_lang_id = $lang;
                 $product_trans->pt_product_id = $product->id;
                 $product_trans->save();
             }
             if (!empty($_FILES['p_image']) && $_FILES['p_image']['error'] == 0) {
                 $image = Db_Products::getImageById($product->id);
                 $path = BASE_PATH . 'files' . $this->img_path . $product->id . '/';
                 if (is_dir($path)) {
                     Upload::deleteImage($path, $image, $this->img_sizes);
                 }
                 if ($filename = Upload::uploadImage($path, $_FILES['p_image'], 'product', $this->img_sizes, 'crop')) {
                     $product->p_image = $filename;
                     $product->save();
                 }
             }
             if (!empty($options)) {
                 foreach ($options as $option_id => $option_value) {
                     if (empty($option_value) || empty($option_id)) {
                         continue;
                     }
                     $product_option = new Db_ProductOptions();
                     $product_option->findByFields(array('po_option_id' => $option_id, 'po_product_id' => $product->id));
                     $product_option->po_option_id = $option_id;
                     $product_option->po_product_id = $product->id;
                     $product_option->po_value = $option_value;
                     $product_option->save();
                 }
             }
             $this->Msg->SetMsg($this->_T('success_item_saved'));
             $this->Redirect($this->PageUrl . '?action=view&id=' . $product->id);
             break;
         default:
             $Objects = Db_Products::getObjects($this->productType);
             $ListGrid = false;
             if ($Objects) {
                 $ListGrid = new TGrid();
                 $ListGrid->Spacing = 0;
                 $ListGrid->Width = '100%';
                 $ListGrid->SetClass('table table-bordered table-highlight-head');
                 $ListGrid->AddHeaderRow($this->_T('id'), $this->_T('Title'), $this->_T('Url'), $this->_T('Enabled'), $this->_T('actions'));
                 $ListGrid->BeginBody();
                 foreach ($Objects as $Object) {
                     $Grid_TR = new TGrid_TTR();
                     $Grid_TD = new TGrid_TTD($Object['id'] . getButton('view', $this->PageUrl, 'view', $Object['id']));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['title']);
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['url']);
//.........这里部分代码省略.........
开发者ID:alexchitoraga,项目名称:tunet,代码行数:101,代码来源:Products.class.php


示例3: define

define('IN_CB', true);
include 'include/header.php';
registerImageKey('code', 'BCGcode93');
$vals = array();
for ($i = 0; $i <= 127; $i++) {
    $vals[] = '%' . sprintf('%02X', $i);
}
$characters = array('NUL', 'SOH', 'STX', 'ETX', 'EOT', 'ENQ', 'ACK', 'BEL', 'BS', 'TAB', 'LF', 'VT', 'FF', 'CR', 'SO', 'SI', 'DLE', 'DC1', 'DC2', 'DC3', 'DC4', 'NAK', 'SYN', 'ETB', 'CAN', 'EM', 'SUB', 'ESC', 'FS', 'GS', 'RS', 'US', '&nbsp;', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', 'DEL');
?>

<div id="validCharacters">
    <h3>Valid Characters</h3>
    <?php 
$c = count($characters);
for ($i = 0; $i < $c; $i++) {
    echo getButton($characters[$i], $vals[$i]);
}
?>
</div>

<div id="explanation">
    <h3>Explanation</h3>
    <ul>
        <li>Known also as USS Code 93.</li>
        <li>Code 93 was designed to provide a higher density and data security enhancement to Code 39.</li>
        <li>Used primarily by Canadian postal office to encode supplementary delivery information.</li>
        <li>Similar to Code 39, Code 93 has the same 43 characters plus 5 special ones to encode the ASCII 0 to 127.</li>
        <li>This symbology composed of 2 check digits ("C" and "K").</li>
        <li>Your browser may not be able to write the special characters (NUL, SOH, etc.) but you can write them with the code.</li>
    </ul>
</div>
开发者ID:sea129,项目名称:kbay,代码行数:31,代码来源:BCGcode93.php


示例4: asearch_print_form_row_basic

/** Print one basic form row
 */
function asearch_print_form_row_basic($imapConnection, &$boxes, $mailbox, $biop, $unop, $where, $what, $exclude, $sub, $row_num)
{
    global $search_button_html;
    global $color;
    echo html_tag('tr', '', '', $color[4]);
    //Mailbox list
    echo html_tag('td', '<b>' . _("In") . '</b> ' . asearch_get_form_mailbox($imapConnection, $boxes, $mailbox), 'center') . "\n";
    //Unary operator and Search location
    echo html_tag('td', asearch_get_form_location($unop, $where), 'center') . "\n";
    //Text input
    echo html_tag('td', asearch_get_form_what($what), 'center') . "\n";
    //Submit button
    echo html_tag('td', getButton('submit', 'submit', $search_button_html), 'center') . "\n";
    echo "</tr>\n";
}
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:17,代码来源:search.php


示例5: RightColumnContent

 public function RightColumnContent()
 {
     if (in_array($this->Action, array('add', 'additem', 'edit', 'edititem', 'viewitem'))) {
         $languages = Db_Language::getLanguageWithKey();
         $this->TPL->assign('languages', $languages);
     }
     if (in_array($this->Action, array('view', 'edit'))) {
         $slider = Db_Sliders::getDetailsById($this->Id);
         $this->TPL->assign('slider', $slider);
     }
     if (in_array($this->Action, array('edititem', 'viewitem'))) {
         $slide = Db_SliderItems::getDetailsById($this->Id);
         $slide_trans = Db_SliderItemTrans::getTransById($this->Id);
         $this->TPL->assign('slide', $slide);
         $this->TPL->assign('slide_trans', $slide_trans);
     }
     switch ($this->Action) {
         case 'delete':
             if ($this->Id == 0) {
                 return false;
             }
             $ids = Db_SliderItems::getIdsBySliderId($this->Id);
             Db_Sliders::deleteByField('id', $this->Id);
             Db_SliderItems::deleteAllByField('si_slider_id', $this->Id);
             Db_SliderItemTrans::deleteBySliderItemIds($ids);
             $this->Msg->SetMsg($this->_T('success_item_deleted'));
             $this->Redirect($this->PageUrl);
             break;
         case 'deleteitem':
             Db_SliderItems::deleteByField('id', $this->Id);
             Db_SliderItemTrans::deleteAllByField('sit_slider_item_id', $this->Id);
             $this->Msg->SetMsg($this->_T('success_item_deleted'));
             $this->Redirect($this->PageUrl . '?action=viewitems&id=' . $this->Id);
             break;
         case 'saveitem':
             if ($this->sId == 0) {
                 return '';
             }
             $si_url = getPost('si_url');
             $si_priority = getPost('si_priority');
             $sit_h1 = getPost('sit_h1');
             $sit_h2 = getPost('sit_h2');
             $sit_h3 = getPost('sit_h3');
             $sit_title_link = getPost('sit_title_link');
             $slide = new Db_SliderItems($this->DB, $this->Id, 'id');
             $slide->si_url = $si_url;
             $slide->si_priority = $si_priority;
             $slide->si_slider_id = $this->sId;
             $slide->save();
             foreach ($sit_h1 as $lang => $item) {
                 $slide_trans = new Db_SliderItemTrans();
                 $slide_trans->findByFields(array('sit_slider_item_id' => $slide->id, 'sit_lang_id' => $lang));
                 $slide_trans->sit_h1 = $sit_h1[$lang];
                 $slide_trans->sit_h2 = $sit_h2[$lang];
                 $slide_trans->sit_h3 = $sit_h3[$lang];
                 $slide_trans->sit_title_link = $sit_title_link[$lang];
                 $slide_trans->sit_slider_item_id = $slide->id;
                 $slide_trans->sit_lang_id = $lang;
                 $slide_trans->save();
             }
             if (!empty($_FILES['si_image']) && $_FILES['si_image']['error'] == 0) {
                 $image = Db_SliderItems::getImageById($this->sId);
                 $path = BASE_PATH . 'files' . $this->img_path . $this->sId . DS;
                 if (is_dir($path)) {
                     Upload::deleteImage($path, $image, $this->img_sizes);
                 }
                 if ($image = Upload::uploadImage($path, $_FILES['si_image'], 'slider', $this->img_sizes, 'crop')) {
                     $slide->si_image = $image;
                     $slide->save();
                 }
             }
             $this->Msg->SetMsg($this->_T('success_item_saved'));
             $this->Redirect($this->PageUrl . '?action=viewitem&id=' . $slide->id . '&sid=' . $this->sId);
             break;
         case 'save':
             $s_key = getPost('s_key');
             $s_enabled = isset($_POST['s_enabled']) ? 1 : 0;
             $slider = new Db_Sliders($this->DB, $this->Id, 'id');
             $slider->s_key = $s_key;
             $slider->s_enabled = $s_enabled;
             $slider->save();
             $this->Msg->SetMsg($this->_T('success_item_saved'));
             $this->Redirect($this->PageUrl . '?action=view&id=' . $slider->id);
             break;
         case 'viewitems':
             $Objects = Db_SliderItems::getFulLDetailsBySliderId($this->Id);
             $this->TPL->assign('slider_id', $this->Id);
             $ListGrid = false;
             if ($Objects) {
                 $ListGrid = new TGrid();
                 $ListGrid->Spacing = 0;
                 $ListGrid->Width = '100%';
                 $ListGrid->SetClass('table table-bordered table-highlight-head');
                 $ListGrid->AddHeaderRow($this->_T('id'), $this->_T('Image'), $this->_T('H1'), $this->_T('H2'), $this->_T('H3'), $this->_T('Link title'), $this->_T('Url'), $this->_T('Priority'), $this->_T('actions'));
                 $ListGrid->BeginBody();
                 foreach ($Objects as $Object) {
                     $Grid_TR = new TGrid_TTR();
                     $Grid_TD = new TGrid_TTD($Object['id'] . getButton('view', $this->PageUrl, 'viewitem', $Object['id'], $this->Id));
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
//.........这里部分代码省略.........
开发者ID:alexchitoraga,项目名称:tunet,代码行数:101,代码来源:Sliders.class.php


示例6: mail_message_listing_beginning

function mail_message_listing_beginning($imapConnection, $mailbox = '', $sort = -1, $msg_cnt_str = '', $paginator = '&nbsp;', $start_msg = 1)
{
    global $color, $auto_expunge, $base_uri, $thread_sort_messages, $allow_thread_sort, $allow_server_sort, $server_sort_order, $PHP_SELF;
    $php_self = $PHP_SELF;
    /* fix for incorrect $PHP_SELF */
    if (strpos($php_self, 'move_messages.php')) {
        $php_self = str_replace('move_messages.php', 'right_main.php', $php_self);
    }
    $urlMailbox = urlencode($mailbox);
    if (preg_match('/^(.+)\\?.+$/', $php_self, $regs)) {
        $source_url = $regs[1];
    } else {
        $source_url = $php_self;
    }
    /*
     * This is the beginning of the message list table.
     * It wraps around all messages
     */
    if (!empty($paginator) && !empty($msg_cnt_str)) {
        echo html_tag('table', html_tag('tr', html_tag('td', html_tag('table', html_tag('tr', html_tag('td', $paginator, 'left') . html_tag('td', $msg_cnt_str, 'right')), '', $color[4], 'border="0" width="100%" cellpadding="1"  cellspacing="0"'), 'left', '', ''), '', $color[0]), '', '', 'border="0" width="100%" cellpadding="1"  cellspacing="0"');
    }
    /* line between header and button area */
    echo '</td></tr><tr><td height="5" bgcolor="' . $color[4] . '"></td></tr>';
    echo html_tag('tr') . "\n" . html_tag('td', '', 'left', '', '') . html_tag('table', '', '', $color[9], 'border="0" width="100%" cellpadding="1"  cellspacing="0"') . '<tr><td>' . html_tag('table', '', '', $color[0], 'border="0" width="100%" cellpadding="1"  cellspacing="0"') . html_tag('tr', getSmallStringCell(_("Move Selected To"), 'left', 'nowrap') . getSmallStringCell(_("Transform Selected Messages"), 'right')) . html_tag('tr') . "\n" . html_tag('td', '', 'left', '', 'valign="middle" nowrap');
    getMbxList($imapConnection);
    echo getButton('SUBMIT', 'moveButton', _("Move")) . "\n";
    echo getButton('SUBMIT', 'attache', _("Forward")) . "\n";
    do_hook('mailbox_display_buttons');
    echo "      </small></td>\n" . html_tag('td', '', 'right', '', 'nowrap');
    if (!$auto_expunge) {
        echo getButton('SUBMIT', 'expungeButton', _("Expunge")) . "\n";
    }
    echo getButton('SUBMIT', 'markRead', _("Read")) . "\n";
    echo getButton('SUBMIT', 'markUnread', _("Unread")) . "\n";
    echo getButton('SUBMIT', 'delete', _("Delete")) . "&nbsp;\n";
    if (!strpos($php_self, 'mailbox')) {
        $location = $php_self . '?mailbox=INBOX&amp;startMessage=1';
    } else {
        $location = $php_self;
    }
    //    $location = urlencode($location);
    echo '<input type="hidden" name="location" value="' . $location . '">';
    echo "</td>\n" . "   </tr>\n";
    /* draws thread sorting links */
    if ($allow_thread_sort == TRUE) {
        if ($thread_sort_messages == 1) {
            $set_thread = 2;
            $thread_name = _("Unthread View");
        } elseif ($thread_sort_messages == 0) {
            $set_thread = 1;
            $thread_name = _("Thread View");
        }
        echo html_tag('tr', html_tag('td', '&nbsp;<small><a href="' . $source_url . '?sort=' . "{$sort}" . '&amp;start_messages=1&amp;set_thread=' . "{$set_thread}" . '&amp;mailbox=' . urlencode($mailbox) . '">' . $thread_name . '</a></small>&nbsp;', '', '', ''), '', '', '');
    }
    echo "</table></td></tr></table></td></tr>\n";
    do_hook('mailbox_form_before');
    /* if using server sort we highjack the
     * the $sort var and use $server_sort_order
     * instead. but here we reset sort for a bit
     * since its easy
     */
    if ($allow_server_sort == TRUE) {
        $sort = $server_sort_order;
    }
}
开发者ID:jprice,项目名称:EHCP,代码行数:65,代码来源:mailbox_display.php


示例7: mail_message_listing_beginning

/**
 * Displays the standard message list header.
 *
 * To finish the table, you need to do a "</table></table>";
 *
 * @param resource $imapConnection
 * @param array    $aMailbox associative array with mailbox related information
 * @param string   $msg_cnt_str
 * @param string   $paginator Paginator string
 */
function mail_message_listing_beginning($imapConnection, $aMailbox, $msg_cnt_str = '', $paginator = '&nbsp;')
{
    global $color, $show_flag_buttons, $PHP_SELF;
    global $lastTargetMailbox, $boxes;
    $php_self = $PHP_SELF;
    $urlMailbox = urlencode($aMailbox['NAME']);
    if (preg_match('/^(.+)\\?.+$/', $php_self, $regs)) {
        $source_url = $regs[1];
    } else {
        $source_url = $php_self;
    }
    if (!isset($msg)) {
        $msg = '';
    }
    $moveFields = addHidden('msg', $msg) . addHidden('mailbox', $aMailbox['NAME']) . addHidden('startMessage', $aMailbox['PAGEOFFSET']);
    /* build thread sorting links */
    $sort = $aMailbox['SORT'];
    if ($aMailbox['ALLOW_THREAD']) {
        if ($aMailbox['SORT'] & SQSORT_THREAD) {
            $sort -= SQSORT_THREAD;
            $thread_name = _("Unthread View");
        } else {
            $thread_name = _("Thread View");
            $sort = $aMailbox['SORT'] + SQSORT_THREAD;
        }
        $thread_link_str = '<small>[<a href="' . $source_url . '?srt=' . $sort . '&start_messages=1' . '&mailbox=' . urlencode($aMailbox['NAME']) . '">' . $thread_name . '</a>]</small>';
    } else {
        $thread_link_str = '';
    }
    /*
     * This is the beginning of the message list table.
     * It wraps around all messages
     */
    $safe_name = preg_replace("/[^0-9A-Za-z_]/", '_', $aMailbox['NAME']);
    $form_name = "FormMsgs" . $safe_name;
    echo '<form name="' . $form_name . '" method="post" action="' . $php_self . '">' . "\n" . $moveFields;
    $button_str = '';
    // display flag buttons only if supported
    if ($show_flag_buttons && in_array('\\flagged', $aMailbox['PERMANENTFLAGS'], true)) {
        $button_str .= getButton('submit', 'markUnflagged', _("Unflag"));
        $button_str .= getButton('submit', 'markFlagged', _("Flag"));
        $button_str .= "&nbsp;\n";
    }
    if (in_array('\\seen', $aMailbox['PERMANENTFLAGS'], true)) {
        $button_str .= getButton('submit', 'markUnread', _("Unread"));
        $button_str .= getButton('submit', 'markRead', _("Read"));
        $button_str .= "&nbsp;\n";
    }
    $button_str .= getButton('submit', 'attache', _("Forward")) . "&nbsp;\n";
    if (in_array('\\deleted', $aMailbox['PERMANENTFLAGS'], true)) {
        $button_str .= getButton('submit', 'delete', _("Delete"));
        $button_str .= '<input type="checkbox" name="bypass_trash" />' . _("Bypass Trash");
        $button_str .= "&nbsp;\n";
    }
    if (!$aMailbox['AUTO_EXPUNGE'] && $aMailbox['RIGHTS'] != 'READ-ONLY') {
        $button_str .= getButton('submit', 'expungeButton', _("Expunge")) . '&nbsp;' . _("mailbox") . "\n";
        $button_str .= '&nbsp;';
    }
    ?>
    <table width="100%" cellpadding="1"  cellspacing="0" style="border: 1px solid <?php 
    echo $color[0];
    ?>
">
        <tr>
        <td>
            <table bgcolor="<?php 
    echo $color[4];
    ?>
" border="0" width="100%" cellpadding="1"  cellspacing="0">
            <tr>
                <?php 
    echo html_tag('td', '<small>' . $paginator . $thread_link_str . '</small>', 'left') . "\n";
    ?>
                <?php 
    echo html_tag('td', '', 'center') . "\n";
    ?>
                <?php 
    echo html_tag('td', '<small>' . $msg_cnt_str . '</small>', 'right') . "\n";
    ?>
            </tr>
            </table>
        </td>
        </tr>
        <tr width="100%" cellpadding="1"  cellspacing="0" border="0" bgcolor="<?php 
    echo $color[0];
    ?>
">
        <td>
            <table border="0" width="100%" cellpadding="1"  cellspacing="0">
            <tr>
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:101,代码来源:mailbox_display.php


示例8: bayesspam_show_buttons

function bayesspam_show_buttons()
{
    if ($GLOBALS['bayesdbhandle'] == null) {
        return;
    }
    if ($GLOBALS['bayesspam_show_spam_buttons']) {
        bindtextdomain('bayesspam', SM_PATH . 'plugins/bayesspam/locale');
        textdomain('bayesspam');
        echo getButton('SUBMIT', 'markSpam', _("Spam"));
        echo getButton('SUBMIT', 'markHam', _("NonSpam"));
        bindtextdomain('squirrelmail', SM_PATH . 'locale');
        textdomain('squirrelmail');
    }
}
开发者ID:CauldronDevelopmentLLC,项目名称:squirrelmail-bayesspam,代码行数:14,代码来源:bayesspam_functions.php


示例9: RightColumnContent

 public function RightColumnContent()
 {
     if (in_array($this->Action, array('add', 'view', 'edit'))) {
         $languages = Db_Language::getLanguageWithKey();
         $this->TPL->assign('languages', $languages);
     }
     if (in_array($this->Action, array('view', 'edit'))) {
         $option = Db_Options::getDetailsById($this->Id);
         $option_trans = Db_OptionTrans::getDetailsById($this->Id);
         $this->TPL->assign('option', $option);
         $this->TPL->assign('option_trans', $option_trans);
     }
     switch ($this->Action) {
         case 'delete':
             if ($this->Id == 0) {
                 return false;
             }
             Db_Options::deleteByField('id', $this->Id);
             Db_OptionTrans::deleteAllByField('ot_option_id', $this->Id);
             Db_ProductOptions::deleteAllByField('po_option_id', $this->Id);
             $this->Msg->SetMsg($this->_T('success_item_deleted'));
             $this->Redirect($this->PageUrl);
             break;
         case 'save':
             $o_key = getPost('o_key');
             $o_priority = getPost('o_priority');
             $o_enabled = isset($_POST['o_enabled']) ? 1 : 0;
             $ot_title = getPost('ot_title');
             $option = new Db_Options($this->DB, $this->Id, 'id');
             $option->o_key = $o_key;
             $option->o_enabled = $o_enabled;
             $option->o_priority = $o_priority;
             $option->save();
             foreach ($ot_title as $lang => $title) {
                 $option_trans = new Db_OptionTrans();
                 $option_trans->findByFields(array('ot_option_id' => $option->id, 'ot_lang_id' => $lang));
                 $option_trans->ot_title = $title;
                 $option_trans->ot_lang_id = $lang;
                 $option_trans->ot_option_id = $option->id;
                 $option_trans->save();
             }
             $this->Msg->SetMsg($this->_T('success_item_saved'));
             $this->Redirect($this->PageUrl . '?action=view&id=' . $option->id);
             break;
         default:
             $Objects = Db_Options::getFulLDetails();
             $ListGrid = false;
             if ($Objects) {
                 $ListGrid = new TGrid();
                 $ListGrid->Spacing = 0;
                 $ListGrid->Width = '100%';
                 $ListGrid->SetClass('table table-bordered table-highlight-head');
                 $ListGrid->AddHeaderRow($this->_T('id'), $this->_T('Key'), $this->_T('Title'), $this->_T('Enabled'), $this->_T('Priority'), $this->_T('actions'));
                 $ListGrid->BeginBody();
                 foreach ($Objects as $Object) {
                     $Grid_TR = new TGrid_TTR();
                     $Grid_TD = new TGrid_TTD($Object['id'] . getButton('view', $this->PageUrl, 'view', $Object['id']));
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['option_key']);
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['title']);
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['enabled']);
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['priority']);
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD(getButton('edit', $this->PageUrl, 'edit', $Object['id']) . getButton('delete', $this->PageUrl, 'delete', $Object['id']));
                     $Grid_TD->AddAttr(new TAttr('class', 'align-center col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $ListGrid->AddTR($Grid_TR);
                 }
                 $ListGrid->EndBody();
                 $ListGrid = $ListGrid->Html();
             }
             $this->TPL->assign('ListGrid', $ListGrid);
             break;
     }
     $msg = $this->Msg->Html();
     $this->TPL->assign('msg', $msg);
     $this->TPL->assign('Action', $this->Action);
     $result = $this->TPL->display(null, true);
     $this->Msg->Clear();
     return $result;
 }
开发者ID:alexchitoraga,项目名称:tunet,代码行数:87,代码来源:Options.class.php


示例10: RightColumnContent

 public function RightColumnContent()
 {
     if (in_array($this->Action, array('view', 'edit', 'add'))) {
         $languages = Db_Language::getLanguageWithKey();
         $this->TPL->assign('languages', $languages);
     }
     if (in_array($this->Action, array('view', 'edit'))) {
         $blog = Db_Blog::getObjectById($this->Id);
         $blog_trans = Db_BlogTrans::getTransById($this->Id);
         $this->TPL->assign('blog', $blog);
         $this->TPL->assign('blog_trans', $blog_trans);
     }
     switch ($this->Action) {
         case 'delete':
             if ($this->Id != 0) {
                 Db_Blog::deleteByField('id', $this->Id);
                 Db_BlogTrans::deleteByField('bt_blog_id', $this->Id, 0);
                 $this->rrmdir(BASE_PATH . 'files/' . $this->img_path . $this->Id, true);
                 $this->Msg->SetMsg($this->_T('success_item_deleted'));
                 $this->Redirect($this->PageUrl);
             }
             break;
         case 'save':
             $b_enabled = isset($_POST['b_enabled']) ? 1 : 0;
             $b_priority = getPost('b_priority');
             $b_date_start = getPost('b_date_start');
             $b_date_end = getPost('b_date_end');
             $b_url = getPost('b_url');
             $bt_title = getPost('bt_title');
             $bt_short_description = getPost('bt_short_description');
             $bt_description = getPost('bt_description');
             $blog = new Db_Blog($this->DB, $this->Id, 'id');
             $blog->b_enabled = $b_enabled;
             $blog->b_priority = $b_priority;
             $blog->b_date_start = $b_date_start;
             $blog->b_date_end = $b_date_end;
             $blog->b_url = $b_url;
             $blog->save();
             foreach ($bt_title as $lang => $item) {
                 $blog_trans = new Db_BlogTrans();
                 $blog_trans->findByFields(array('bt_blog_id' => $blog->id, 'bt_lang_id' => $lang));
                 $blog_trans->bt_blog_id = $blog->id;
                 $blog_trans->bt_title = $bt_title[$lang];
                 $blog_trans->bt_short_description = $bt_short_description[$lang];
                 $blog_trans->bt_description = $bt_description[$lang];
                 $blog_trans->bt_lang_id = $lang;
                 $blog_trans->save();
             }
             if (!empty($_FILES['b_image']) && $_FILES['b_image']['error'] == 0) {
                 $image = Db_Blog::getImageById($blog->id);
                 $path = BASE_PATH . 'files' . $this->img_path . $blog->id . DS;
                 if (is_dir($path)) {
                     Upload::deleteImage($path, $image, $this->img_sizes);
                 }
                 if ($image = Upload::uploadImage($path, $_FILES['b_image'], 'image', $this->img_sizes, 'crop')) {
                     $blog->b_image = $image;
                     $blog->save();
                 }
             }
             $this->Msg->SetMsg($this->_T('success_item_saved'));
             $this->Redirect($this->PageUrl . '?action=view&id=' . $blog->id);
             break;
         default:
             $Objects = Db_Blog::getObjects();
             $ObjectsTrans = Db_BlogTrans::getTransByLang($this->LangId);
             $ListGrid = false;
             if ($Objects) {
                 $ListGrid = new TGrid();
                 $ListGrid->Spacing = 0;
                 $ListGrid->Width = '100%';
                 $ListGrid->SetClass('table table-bordered table-highlight-head');
                 $ListGrid->AddHeaderRow($this->_T('id'), $this->_T('Title'), $this->_T('Url'), $this->_T('Date start'), $this->_T('Date end'), $this->_T('Enabled'), $this->_T('actions'));
                 $ListGrid->BeginBody();
                 foreach ($Objects as $Object) {
                     $Grid_TR = new TGrid_TTR();
                     $Grid_TD = new TGrid_TTD($Object['id'] . getButton('view', $this->PageUrl, 'view', $Object['id']));
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($ObjectsTrans[$Object['id']]['bt_title']);
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['b_url']);
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['b_date_start']);
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['b_date_end']);
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD($Object['b_enabled'] == 1 ? $this->_T('yes') : $this->_T('no'));
                     $Grid_TD->AddAttr(new TAttr('class', 'col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $Grid_TD = new TGrid_TTD(getButton('edit', $this->PageUrl, 'edit', $Object['id']) . getButton('delete', $this->PageUrl, 'delete', $Object['id']));
                     $Grid_TD->AddAttr(new TAttr('class', 'align-center col-md-1'));
                     $Grid_TR->Add($Grid_TD);
                     $ListGrid->AddTR($Grid_TR);
                 }
                 $ListGrid->EndBody();
                 $ListGrid = $ListGrid->Html();
             }
             $this->TPL->assign('ListGrid', $ListGrid);
             break;
     }
//.........这里部分代码省略.........
开发者ID:alexchitoraga,项目名称:tunet,代码行数:101,代码来源:Blog.class.php


示例11: addTopYNPrompt

		/**
		 * Add a prompt to the top of the form, in which the user may choose YES or NO
		 * the result will be existence of commit or cancel in next processing step.
		 * @param string Text, that will be displayed for prompt.
		 */
		function addTopYNPrompt($text, $title="") {
			global $lang;
			if ($title=="") 
			  $title = $lang->get('thereisquestion', 'Confirm action');
			
			$this->question = getFormHeadline($title, "100%");
			$this->question.= '<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td><br>';
			$this->question.= $text;
			$this->question.= '<input type="hidden" name="commit" value=""><br><br>';
			$this->question.= '</td></tr><tr><td align="right">';		
			$this->question .= getButton("commit", $lang->get("no"), "navelement", "submit", $this->getWaitupScreen(), $this->name);
			$this->question .= "&nbsp;&nbsp;";
			$this->question .= getButton("commit", $lang->get("yes"), "navelement", "submit", $this->getWaitupScreen(), $this->name);
			$this->question .= "</td></tr></table>";
			$this->question.=getFormFooterline().'<br/><br/>';
		
		}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:22,代码来源:form.php


示例12: formatMenubar


//.........这里部分代码省略.........
                }
            }
            $nav_row .= '[' . $prev_link . $topbar_delimiter . $next_link . ']';
            if (isset($del_prev_link) && isset($del_next_link)) {
                $nav_row .= $double_delimiter . '[' . $del_prev_link . $topbar_delimiter . $del_next_link . ']';
            }
        }
    }
    // Start with Search Results or Message List link.
    $msgs_url .= "{$where}?where=read_body.php&amp;what={$what}&amp;mailbox=" . $urlMailbox . "&amp;startMessage={$startMessage}";
    if ($where == 'search.php') {
        $msgs_str = _("Search Results");
    } else {
        $msgs_str = _("Message List");
    }
    $nav_row .= $double_delimiter . '[<a href="' . $msgs_url . '">' . $msgs_str . '</a>]';
    $nav_row .= '</small></td></tr>';
    // BEGIN MENU ROW - DELETE/REPLY/FORWARD/MOVE/etc.
    $menu_row = '<tr bgcolor="' . $color[0] . '"><td><small>';
    $comp_uri = $base_uri . 'src/compose.php' . '?passed_id=' . $passed_id . '&amp;mailbox=' . $urlMailbox . '&amp;startMessage=' . $startMessage . (isset($passed_ent_id) ? '&amp;passed_ent_id=' . $passed_ent_id : '');
    // Start form for reply/reply all/forward..
    $target = '';
    $on_click = '';
    $method = 'method="post" ';
    if ($compose_new_win == '1') {
        if ($javascript_on) {
            $on_click = ' onclick="comp_in_new_form(\'' . $comp_uri . '\', this, this.form)"';
            $comp_uri = 'javascript:void(0)';
            $method = 'method="get" ';
        } else {
            $target = 'target="_blank"';
        }
    }
    $menu_row .= "\n" . '<form name="composeForm" action="' . $comp_uri . '" ' . $method . $target . ' style="display: inline">' . "\n";
    // If Draft folder - create Resume link
    if ($mailbox == $draft_folder && $save_as_draft) {
        $new_button = 'smaction_draft';
        $comp_alt_string = _("Resume Draft");
    } else {
        if (handleAsSent($mailbox)) {
            // If in Sent folder, edit as new
            $new_button = 'smaction_edit_new';
            $comp_alt_string = _("Edit Message as New");
        }
    }
    // Show Alt URI for Draft/Sent
    if (isset($comp_alt_string)) {
        $menu_row .= getButton('submit', $new_button, $comp_alt_string, $on_click) . "\n";
    }
    $menu_row .= getButton('submit', 'smaction_reply', _("Reply"), $on_click) . "\n";
    $menu_row .= getButton('submit', 'smaction_reply_all', _("Reply All"), $on_click) . "\n";
    $menu_row .= getButton('submit', 'smaction_forward', _("Forward"), $on_click);
    if ($enable_forward_as_attachment) {
        $menu_row .= '<input type="checkbox" name="smaction_attache" />' . _("As Attachment") . '&nbsp;&nbsp;' . "\n";
    }
    $menu_row .= '</form>&nbsp;';
    if (in_array('\\deleted', $aMailbox['PERMANENTFLAGS'], true)) {
        // Form for deletion. Form is handled by the originating display in $where. This is right_main.php or search.php
        $delete_url = $base_uri . "src/{$where}";
        $menu_row .= '<form name="deleteMessageForm" action="' . $delete_url . '" method="post" style="display: inline">';
        if (!(isset($passed_ent_id) && $passed_ent_id)) {
            $menu_row .= addHidden('mailbox', $aMailbox['NAME']);
            $menu_row .= addHidden('msg[0]', $passed_id);
            $menu_row .= addHidden('startMessage', $startMessage);
            $menu_row .= getButton('submit', 'delete', _("Delete"));
            $menu_row .= '<input type="checkbox" name="bypass_trash" />' . _("Bypass Trash");
        } else {
            $menu_row .= getButton('submit', 'delete', _("Delete"), '', FALSE) . "\n";
            // delete button is disabled
        }
        $menu_row .= '</form>';
    }
    // Add top move link
    $menu_row .= '</small></td><td align="right">';
    if (!(isset($passed_ent_id) && $passed_ent_id) && in_array('\\deleted', $aMailbox['PERMANENTFLAGS'], true)) {
        $menu_row .= '<form name="moveMessageForm" action="' . $base_uri . 'src/' . $where . '?' . '" method="post" style="display: inline">' . '<small>' . addHidden('mailbox', $aMailbox['NAME']) . addHidden('msg[0]', $passed_id) . _("Move to:") . '<select name="targetMailbox" style="padding: 0px; margin: 0px">';
        if (isset($lastTargetMailbox) && !empty($lastTargetMailbox)) {
            $menu_row .= sqimap_mailbox_option_list($imapConnection, array(strtolower($lastTargetMailbox)));
        } else {
            $menu_row .= sqimap_mailbox_option_list($imapConnection);
        }
        $menu_row .= '</select> ';
        $menu_row .= getButton('submit', 'moveButton', _("Move")) . "\n" . '</form>';
    }
    $menu_row .= '</td></tr>';
    // echo rows, with hooks
    $ret = do_hook_function('read_body_menu_top', array($nav_row, $menu_row));
    if (is_array($ret)) {
        if (isset($ret[0]) && !empty($ret[0])) {
            $nav_row = $ret[0];
        }
        if (isset($ret[1]) && !empty($ret[1])) {
            $menu_row = $ret[1];
        }
    }
    echo '<table width="100%" cellpadding="3" cellspacing="0" align="center" border="0">';
    echo $nav_on_top ? $nav_row . $menu_row : $menu_row . $nav_row;
    echo '</table>' . "\n";
    do_hook('read_body_menu_bottom');
}
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:101,代码来源:read_body.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getBuyList函数代码示例发布时间:2022-05-15
下一篇:
PHP getBulan函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap