function make_status_link($fields, $type, $color, $alt = "", $can_operate) { $image_name = sprintf("icon_%s_%s.gif", $color, $fields[$type] == 0 ? "off" : "on"); if ($can_operate) { $parm = array("products_id" => $fields['products_id'], "attributes_id" => $fields['products_attributes_id'], "action" => $fields[$type] == 0 ? 'status_on' : 'status_off', "type" => $type, "page" => $page); $image = easy_admin_products_html::input_image($image_name, $alt); return '<a href="' . easy_admin_products_html::href_link("attributes", $parm) . '">' . $image . '</a>'; } else { return easy_admin_products_html::image($image_name, $alt); } }
* @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } if (file_exists(DIR_WS_CLASSES . 'split_page_results.php')) { require_once DIR_WS_CLASSES . 'split_page_results.php'; } global $zco_notifier; global $easy_admin_products_category; global $easy_admin_products_category_validate; global $easy_admin_products_category_id; $languages = zen_get_languages(); $model = new easy_admin_products_category_model(); $html = new easy_admin_products_html(); $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'index'; $cID = (int) $_REQUEST['cID']; // 一覧へ戻るための情報 $current_parm = array(); if ($action == 'index' || $action == 'search') { $current_parm = array('action' => $action, 'page' => (int) ($_REQUEST['page'] ? $_REQUEST['page'] : 1)); if ($action == 'index') { $current_parm['category_id'] = (int) $_REQUEST['category_id']; } elseif ($action == 'search') { $current_parm['search_name'] = $_REQUEST['search_name']; $current_parm['search_description'] = $_REQUEST['search_description']; } } else { $current_parm = $_REQUEST['current']; }
function convert_product_result($fields) { // カテゴリ $categories_html = array(); $categories = self::get_product_categories($fields['products_id']); $link = easy_admin_products_html::href_link('categories'); foreach ($categories as $category_id) { $categories_html[] = self::get_category($category_id, $link); } $fields['categories'] = implode("<br/>", $categories_html); // ステータス if (isset($_REQUEST['page'])) { $page = "&page=" . $_REQUEST['page']; } else { $page = ""; } if ($fields['products_status'] == 1) { $parm = array("products_id" => $fields['products_id'], "action" => "status_off", "page" => $page); $image = easy_admin_products_html::image("icon_green_on.gif", MODULE_EASY_ADMIN_PRODUCTS_STATUS_ON); } else { $parm = array("products_id" => $fields['products_id'], "action" => "status_on", "page" => $page); $image = easy_admin_products_html::image("icon_red_on.gif", MODULE_EASY_ADMIN_PRODUCTS_STATUS_OFF); } $fields['products_status'] = '<a href="' . easy_admin_products_html::href_link("", $parm) . '">' . $image . '</a>'; return $fields; }
function get_breadcrumb($categories_id, $separater = ' > ') { $breadcrumbs = array(); $categories = zen_generate_category_path($categories_id); for ($i = 0, $n = sizeof($categories); $i < $n; $i++) { for ($j = 0, $k = sizeof($categories[$i]); $j < $k; $j++) { $id = $categories[$i][$j]['id']; if (empty($id)) { continue; } if ($id != $categories_id) { $parm = array('category_id' => $id); $link = easy_admin_products_html::href_link("categories", $parm); $breadcrumb = '<a href="' . $link . '">' . zen_output_string_protected($categories[$i][$j]['text']) . '</a>'; } else { $breadcrumb = zen_output_string_protected($categories[$i][$j]['text']); } array_unshift($breadcrumbs, $breadcrumb); } } if (empty($breadcrumbs)) { $top = TEXT_TOP; } else { $top = '<a href="' . easy_admin_products_html::href_link("categories") . '">' . TEXT_TOP . '</a>'; } array_unshift($breadcrumbs, $top); return join($separater, $breadcrumbs); }