<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';
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']); $Grid_TR->Add($Grid_TD); $Grid_TD = new TGrid_TTD($Object['enabled'] == 1 ? $this->_T('yes') : $this->_T('no')); $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')); $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; }
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', ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '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>
/** 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"; }
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); $Grid_TD = new TGrid_TTD($Object['image']); $Grid_TD->AddAttr(new TAttr('class', 'col-md-1')); $Grid_TR->Add($Grid_TD); $Grid_TD = new TGrid_TTD($Object['h1']); $Grid_TD->AddAttr(new TAttr('class', 'col-md-1')); $Grid_TR->Add($Grid_TD); $Grid_TD = new TGrid_TTD($Object['h2']); $Grid_TD->AddAttr(new TAttr('class', 'col-md-1')); $Grid_TR->Add($Grid_TD); $Grid_TD = new TGrid_TTD($Object['h3']); $Grid_TD->AddAttr(new TAttr('class', 'col-md-1')); $Grid_TR->Add($Grid_TD); $Grid_TD = new TGrid_TTD($Object['title_link']); $Grid_TD->AddAttr(new TAttr('class', 'col-md-1')); $Grid_TR->Add($Grid_TD); $Grid_TD = new TGrid_TTD($Object['url']); $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, 'edititem', $Object['id'], $this->Id) . getButton('delete', $this->PageUrl, 'deleteitem', $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; default: $Objects = Db_Sliders::getObjects(); $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('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, 'viewitems', $Object['id'])); $Grid_TD->AddAttr(new TAttr('class', 'col-md-1')); $Grid_TR->Add($Grid_TD); $Grid_TD = new TGrid_TTD($Object['s_key']); $Grid_TD->AddAttr(new TAttr('class', 'col-md-9')); $Grid_TR->Add($Grid_TD); $Grid_TD = new TGrid_TTD($Object['s_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; } $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; }
function mail_message_listing_beginning($imapConnection, $mailbox = '', $sort = -1, $msg_cnt_str = '', $paginator = ' ', $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")) . " \n"; if (!strpos($php_self, 'mailbox')) { $location = $php_self . '?mailbox=INBOX&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', ' <small><a href="' . $source_url . '?sort=' . "{$sort}" . '&start_messages=1&set_thread=' . "{$set_thread}" . '&mailbox=' . urlencode($mailbox) . '">' . $thread_name . '</a></small> ', '', '', ''), '', '', ''); } 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; } }
/** * 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 = ' ') { 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 .= " \n"; } if (in_array('\\seen', $aMailbox['PERMANENTFLAGS'], true)) { $button_str .= getButton('submit', 'markUnread', _("Unread")); $button_str .= getButton('submit', 'markRead', _("Read")); $button_str .= " \n"; } $button_str .= getButton('submit', 'attache', _("Forward")) . " \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 .= " \n"; } if (!$aMailbox['AUTO_EXPUNGE'] && $aMailbox['RIGHTS'] != 'READ-ONLY') { $button_str .= getButton('submit', 'expungeButton', _("Expunge")) . ' ' . _("mailbox") . "\n"; $button_str .= ' '; } ?> <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> <?php echo html_tag('td', '', 'left') . "\n"; ?> <small> <?php echo $button_str; ?> <?php do_hook('mailbox_display_buttons'); ?> </small> </td> <?php if (in_array('\\deleted', $aMailbox['PERMANENTFLAGS'], true)) { ?> <?php echo html_tag('td', '', 'right'); ?> <small> <tt> <select name="targetMailbox"> <?php echo sqimap_mailbox_option_list($imapConnection, array(strtolower($lastTargetMailbox)), 0, $boxes); ?> </select></tt> <?php echo getButton('submit', 'moveButton', _("Move")); ?> </small> <?php } ?> </td> </tr> </table> </td> </tr> </table> <?php do_hook('mailbox_form_before'); }
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'); } }
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; }
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; } $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; }
/** * 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 .= " "; $this->question .= getButton("commit", $lang->get("yes"), "navelement", "submit", $this->getWaitupScreen(), $this->name); $this->question .= "</td></tr></table>"; $this->question.=getFormFooterline().'<br/><br/>'; }
/** * Format message toolbar * * @param string $mailbox Name of current mailbox * @param int $passed_id UID of current message * @param int $passed_ent_id Id of entity within message * @param object $message Current message object * @param object $mbx_response */ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removedVar, $nav_on_top = TRUE) { global $base_uri, $draft_folder, $where, $what, $color, $sort, $startMessage, $PHP_SELF, $save_as_draft, $enable_forward_as_attachment, $imapConnection, $lastTargetMailbox, $data_dir, $username, $delete_prev_next_display, $compose_new_win, $javascript_on; //FIXME cleanup argument list, use $aMailbox where possible $mailbox = $aMailbox['NAME']; $topbar_delimiter = ' | '; $double_delimiter = ' '; $urlMailbox = urlencode($mailbox); $msgs_url = $base_uri . 'src/'; // BEGIN NAV ROW - PREV/NEXT, DEL PREV/NEXT, LINKS TO INDEX, etc. $nav_row = '<tr><td align="left" colspan="2" style="border: 1px solid ' . $color[9] . ';"><small>'; // Create Prev & Next links // Handle nested entities first (i.e. Mime Attach parts) if (isset($passed_ent_id) && $passed_ent_id) { // code for navigating through attached message/rfc822 messages $url = set_url_var($PHP_SELF, 'passed_ent_id', 0); $entities = array(); $entity_count = array(); $c = 0; foreach ($message->parent->entities as $ent) { if ($ent->type0 == 'message' && $ent->type1 == 'rfc822') { $c++; $entity_count[$c] = $ent->entity_id; $entities[$ent->entity_id] = $c; } } $prev_link = _("Previous"); if ($entities[$passed_ent_id] > 1) { $prev_ent_id = $entity_count[$entities[$passed_ent_id] - 1]; $prev_link = '<a href="' . set_url_var($PHP_SELF, 'passed_ent_id', $prev_ent_id) . '">' . $prev_link . '</a>'; } $next_link = _("Next"); if ($entities[$passed_ent_id] < $c) { $next_ent_id = $entity_count[$entities[$passed_ent_id] + 1]; $next_link = '<a href="' . set_url_var($PHP_SELF, 'passed_ent_id', $next_ent_id) . '">' . $next_link . '</a>'; } $par_ent_id = $message->parent->entity_id; $up_link = ''; if ($par_ent_id) { $par_ent_id = substr($par_ent_id, 0, -2); if ($par_ent_id != 0) { $up_link = $topbar_delimiter; $url = set_url_var($PHP_SELF, 'passed_ent_id', $par_ent_id); $up_link .= '<a href="' . $url . '">' . _("Up") . '</a>'; } } $nav_row .= $prev_link . $up_link . $topbar_delimiter . $next_link; $nav_row .= $double_delimiter . '[<a href="' . $url . '">' . _("View Message") . '</a>]'; // Prev/Next links for regular messages } else { if (true) { //!(isset($where) && isset($what)) ) { /** * Check if cache is still valid */ if (!is_array($aMailbox['UIDSET'][$what])) { fetchMessageHeaders($imapConnection, $aMailbox); } $prev = findPreviousMessage($aMailbox['UIDSET'][$what], $passed_id); $next = findNextMessage($aMailbox['UIDSET'][$what], $passed_id); $prev_link = _("Previous"); if ($prev >= 0) { $uri = $base_uri . 'src/read_body.php?passed_id=' . $prev . '&mailbox=' . $urlMailbox . '&sort=' . $sort . "&where={$where}&what={$what}" . '&startMessage=' . $startMessage . '&show_more=0'; $prev_link = '<a href="' . $uri . '">' . $prev_link . '</a>'; } $next_link = _("Next"); if ($next >= 0) { $uri = $base_uri . 'src/read_body.php?passed_id=' . $next . '&mailbox=' . $urlMailbox . '&sort=' . $sort . "&where={$where}&what={$what}" . '&startMessage=' . $startMessage . '&show_more=0'; $next_link = '<a href="' . $uri . '">' . $next_link . '</a>'; } // Only bother with Delete & Prev and Delete & Next IF // top display is enabled. if ($delete_prev_next_display == 1 && in_array('\\deleted', $aMailbox['PERMANENTFLAGS'], true)) { $del_prev_link = _("Delete & Prev"); if ($prev >= 0) { $uri = $base_uri . 'src/read_body.php?passed_id=' . $prev . '&mailbox=' . $urlMailbox . '&sort=' . $sort . '&startMessage=' . $startMessage . '&show_more=0' . "&where={$where}&what={$what}" . '&delete_id=' . $passed_id; $del_prev_link = '<a href="' . $uri . '">' . $del_prev_link . '</a>'; } $del_next_link = _("Delete & Next"); if ($next >= 0) { $uri = $base_uri . 'src/read_body.php?passed_id=' . $next . '&mailbox=' . $urlMailbox . '&sort=' . $sort . '&startMessage=' . $startMessage . '&show_more=0' . "&where={$where}&what={$what}" . '&delete_id=' . $passed_id; $del_next_link = '<a href="' . $uri . '">' . $del_next_link . '</a>'; } } $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&what={$what}&mailbox=" . $urlMailbox . "&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 . '&mailbox=' . $urlMailbox . '&startMessage=' . $startMessage . (isset($passed_ent_id) ? '&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") . ' ' . "\n"; } $menu_row .= '</form> '; 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'); }