function printProjectPage($projectID) { $project = getProject($projectID); echo '<h1 class="page_title_withside">' . $project['project_name'] . '</h1>'; echo '<div class="page_content">'; echo '<div class="img_right"><img src="' . getProjectImage($project['project_id']) . '"></img></div>'; echo $project['project_page']; echo '</div>'; echo '<div class="page_content">'; echo '<h1>Blog Posts About this Project</h1>'; echo '<p>Blog posts tagged as "' . getTagName($project['project_tag']) . '" refer to this project. Click below to see all of the blog posts about ' . $project['project_name'] . '.</p>'; echo '<h3>Blog Posts Tagged in <a class="dark_red" href="/blog/tag/' . $project['project_tag'] . '">' . getTagName($project['project_tag']) . ' (' . $project['project_tag'] . ')</a></h3>'; echo '</div>'; }
function makePreview($text, $maxlength) { $open = '['; $close = ']'; if (substr_count($text, $open) != substr_count($text, $close)) { echo "Falsch formatiert!\n"; //Abbrechen } $htmlopentags = 0; $finaltext = ""; $continue = true; $opentags = array(); $nexttag = strpos($text, $open); $nextstop = 0; if ($nexttag != null or $nexttag >= 0) { while ($continue) { $nextstop = strpos($text, $close, $nextstop + 1); if (strpos($text, $open . '/', $nexttag) == $nexttag) { unset($opentags[--$htmlopentags]); } else { $opentags[$htmlopentags++] = getTagName($text, $nexttag, $nextstop); } $maxlength += $nextstop - $nexttag + 1; $nexttag = strpos($text, $open, $nexttag + 1); if ($nexttag >= $maxlength or $maxlength >= strlen($text)) { $continue = false; } } $finaltext .= substr($text, 0, $maxlength); $losttags = ''; if (count($opentags) > 0) { foreach ($opentags as $tag) { $losttags = $open . '/' . $tag . $close . $losttags; } } $finaltext .= $losttags; } else { $finaltext = substr($text, 0, $maxlength); } return $finaltext; }
function principal() { $this->obj->inicializar('configuracion', 'Configuración'); $this->obj->sesion->exponer(); $this->exponer(); $id = $_SESSION['uid']; $query = "SELECT * FROM `aRecurso_usuarios` WHERE `id`='{$id}'"; $res = mysql_query($query); $r = mysql_fetch_array($res); $nomb = $r['nombres']; $apel = $r['apellidos']; $webs = $r['website']; $noti = $r['notificar']; $this->asignar('nombres', $nomb); $this->asignar('apellidos', $apel); $this->asignar('website', $webs); //*****Tags $query = "SELECT * FROM `kControl_diccionario_etiquetas_usuarios` WHERE `id_usuario`='{$id}'"; $res = mysql_query($query); $etiqueta = ""; while ($r = mysql_fetch_array($res)) { if (getTagName($r['id_etiqueta']) != "") { $etiqueta .= getTagName($r['id_etiqueta']) . ","; } } $this->asignar('etiquetas', $etiqueta); //*****Tags if ($noti) { $this->asignar('notificar', 1); } $this->asignar('sexo', 'm'); tengoPermiso('crear_recursos', @$_SESSION['perfil']) ? $this->asignar('crear_recursos', true) : ""; tengoPermiso('actualizar_recursos', @$_SESSION['perfil']) ? $this->asignar('actualizar_recursos', true) : ""; tengoPermiso('borrar_recursos', @$_SESSION['perfil']) ? $this->asignar('borrar_recursos', true) : ""; tengoPermiso('configuracion_perfil', @$_SESSION['perfil']) ? $this->asignar('configuracion_perfil', true) : ""; tengoPermiso('configuracion_grupos', @$_SESSION['perfil']) ? $this->asignar('configuracion_grupos', true) : ""; $this->obj->enviarPagina(); }
/** * @ describe the function ManageOrders->. */ function getTag($tag) { global $application; $value = null; switch ($tag) { case 'CountByStatus0': $value = modApiFunc('Checkout', 'getOrderCount', 0); break; case 'CountByStatus1': $value = modApiFunc('Checkout', 'getOrderCount', 1); break; case 'CountByStatus2': $value = modApiFunc('Checkout', 'getOrderCount', 2); break; case 'CountByStatus3': $value = modApiFunc('Checkout', 'getOrderCount', 3); break; case 'SearchStatusSelector': $this->_simple_selector['options'] = array(); $status_array = modApiFunc('Checkout', 'getOrderStatusList'); if (isset($this->_filter['status_id']) && $this->_filter['status_id'] != "") { $this->_simple_selector['selected'] = $this->_filter['status_id']; } foreach ($status_array as $status) { $sel = 0; if (isset($this->_filter['order_statuses']) && is_array($this->_filter['order_statuses']) && isset($this->_filter['order_statuses'][$status['id']])) { $sel = 1; } $this->_simple_selector['options'][] = array('value' => $status['id'], 'name' => $status['name'], 'selected' => $sel); } $value = $this->TemplateFiller->fill("checkout/orders/", "search-status-selector.tpl.html", array()); break; case 'SearchPaymentStatusSelector': $this->_simple_selector['options'] = array(); if (isset($this->_filter['payment_status_id']) && $this->_filter['payment_status_id'] != "") { $this->_simple_selector['selected'] = $this->_filter['payment_status_id']; } $status_array = modApiFunc('Checkout', 'getOrderPaymentStatusList'); foreach ($status_array as $status) { $sel = 0; if (isset($this->_filter['payment_statuses']) && is_array($this->_filter['payment_statuses']) && isset($this->_filter['payment_statuses'][$status['id']])) { $sel = 1; } $this->_simple_selector['options'][] = array('value' => $status['id'], 'name' => $status['name'], 'selected' => $sel); } $value = $this->TemplateFiller->fill("checkout/orders/", "search-payment-status-selector.tpl.html", array()); break; case 'SearchFromDaySelector': $this->_simple_selector['selected'] = $this->_filter['from_day']; $this->_simple_selector['options'] = array(); for ($i = 1; $i <= 31; $i++) { $num = sprintf("%02d", $i); $this->_simple_selector['options'][] = array('value' => $num, 'name' => $i); } $value = $this->TemplateFiller->fill("checkout/orders/", "search-from-day-selector.tpl.html", array()); break; case 'SearchFromMonthSelector': $this->_simple_selector['selected'] = $this->_filter['from_month']; $this->_simple_selector['options'] = array(); for ($i = 1; $i <= 12; $i++) { $num = sprintf("%02d", $i); $this->_simple_selector['options'][] = array('value' => $num, 'name' => $this->MessageResources->getMessage("GENERAL_MONTH_" . $num)); } $value = $this->TemplateFiller->fill("checkout/orders/", "search-from-month-selector.tpl.html", array()); break; case 'SearchFromYearSelector': $this->_simple_selector['selected'] = $this->_filter['from_year']; $this->_simple_selector['options'] = array(); $curr_year_4digits = date('Y'); $start_year = (int) modApiFunc('Settings', 'getParamValue', 'VISUAL_INTERFACE', 'SEARCH_START_YEAR'); $offset_to = modApiFunc('Settings', 'getParamValue', 'VISUAL_INTERFACE', 'SEARCH_YEAR_OFFSET'); for ($i = $start_year; $i <= $curr_year_4digits + $offset_to; $i++) { $this->_simple_selector['options'][] = array('value' => $i, 'name' => $i); } $value = $this->TemplateFiller->fill("checkout/orders/", "search-from-year-selector.tpl.html", array()); break; case 'SearchToDaySelector': if (empty($this->_filter['to_day']) == false) { $this->_simple_selector['selected'] = $this->_filter['to_day']; } else { $this->_simple_selector['selected'] = date("j"); } $this->_simple_selector['options'] = array(); for ($i = 1; $i <= 31; $i++) { $num = sprintf("%02d", $i); $this->_simple_selector['options'][] = array('value' => $num, 'name' => $i); } $value = $this->TemplateFiller->fill("checkout/orders/", "search-to-day-selector.tpl.html", array()); break; case 'SearchToMonthSelector': if (empty($this->_filter['to_month']) == false) { $this->_simple_selector['selected'] = $this->_filter['to_month']; } else { $this->_simple_selector['selected'] = date("m"); } $this->_simple_selector['options'] = array(); for ($i = 1; $i <= 12; $i++) { $num = sprintf("%02d", $i); $this->_simple_selector['options'][] = array('value' => $num, 'name' => $this->MessageResources->getMessage("GENERAL_MONTH_" . $num)); } $value = $this->TemplateFiller->fill("checkout/orders/", "search-to-month-selector.tpl.html", array()); break; case 'SearchToYearSelector': if (empty($this->_filter['to_year']) == false) { $this->_simple_selector['selected'] = $this->_filter['to_year']; } else { $this->_simple_selector['selected'] = date("Y"); } $this->_simple_selector['options'] = array(); $curr_year_4digits = date('Y'); $start_year = (int) modApiFunc('Settings', 'getParamValue', 'VISUAL_INTERFACE', 'SEARCH_START_YEAR'); $offset_to = modApiFunc('Settings', 'getParamValue', 'VISUAL_INTERFACE', 'SEARCH_YEAR_OFFSET'); for ($i = $start_year; $i <= $curr_year_4digits + $offset_to; $i++) { $this->_simple_selector['options'][] = array('value' => $i, 'name' => $i); } $value = $this->TemplateFiller->fill("checkout/orders/", "search-to-year-selector.tpl.html", array()); break; case 'SimpleSelectorOption': $selected = $this->_simple_selector['selected']; $value = ""; foreach ($this->_simple_selector['options'] as $option) { $sel = $option['value'] == $selected ? " selected" : ""; $value .= "<OPTION value=\"" . $option['value'] . "\"" . $sel . ">" . $option['name'] . "</OPTION>\n"; } break; case 'SimpleCheckBoxGroup_Orders': $selected = $this->_simple_selector['selected']; $value = ""; $items_per_col = 2; // number of items per column $idx = 0; $flag = 0; foreach ($this->_simple_selector['options'] as $option) { if ($idx % $items_per_col == 0) { $value .= "<TR>\n"; $flag = 0; } $sel = ""; $highlight = ""; if ($option['selected'] == 1) { $sel = "checked"; if ($this->_filter['search_by'] == "date") { $highlight = "style='color: black;'"; } } $name = "order_" . preg_replace("/ /", "", $option['name']); $value .= "<TD {$highlight}><INPUT class='form-control input-inline input-sm' id='" . $name . "' name='order_status[" . $option['value'] . "]' type='checkbox' " . $sel . "> " . $option['name'] . "</TD>\n"; if ($idx % $items_per_col == 0 && $flag == 1) { $value .= "</TR>\n"; $flag = 0; } $flag = 1; $idx++; } break; case 'SimpleCheckBoxGroup_Payments': $selected = $this->_simple_selector['selected']; $value = ""; $items_per_col = 1; // number of items per column $idx = 0; $flag = 0; foreach ($this->_simple_selector['options'] as $option) { if ($idx % $items_per_col == 0) { $value .= "<TR>\n"; $flag = 0; } $sel = ""; $highlight = ""; if ($option['selected'] == 1) { $sel = "checked"; if ($this->_filter['search_by'] == "date") { $highlight = "color: black;"; } } $name = "payment_" . preg_replace("/ /", "", $option['name']); $value .= "<TD style='margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" . $highlight . "'><INPUT class='form-control input-inline input-sm' id='" . $name . "' name='payment_status[" . $option['value'] . "]' type='checkbox' " . $sel . "> " . $option['name'] . "</TD>\n"; if ($idx % $items_per_col == 0 && $flag == 1) { $value .= "</TR>\n"; $flag = 0; } $flag = 1; $idx++; } break; case 'ResultCount': $from = modApiFunc("Paginator", "getCurrentPaginatorOffset") + 1; $to = modApiFunc("Paginator", "getCurrentPaginatorOffset") + modApiFunc("Paginator", "getPaginatorRowsPerPage", "Checkout_Orders"); $total = modApiFunc("Paginator", "getCurrentPaginatorTotalRows"); if ($to > $total) { $to = $total; } if ($total <= modApiFunc("Paginator", "getPaginatorRowsPerPage", "Checkout_Orders")) { $value = $this->MessageResources->getMessage(new ActionMessage(array("ORDERS_RESULTS_LESS_THEN_ROWS_PER_PAGE_FOUND", $total))); } else { $value = $this->MessageResources->getMessage(new ActionMessage(array("ORDERS_RESULTS_MORE_THEN_ROWS_PER_PAGE_FOUND", $from, $to, $total))); } break; case 'ResultDateRange': $count = count($this->_orders); if ($count == 0) { $value = ""; break; } elseif ($count == 1) { $orderInfo = $this->_fetched_orders[$this->_orders[0]]; $value = modApiFunc("Localization", "SQL_date_format", $orderInfo['order_date']); break; } $first_in_list_order_info = $this->_fetched_orders[$this->_orders[0]]; $last_in_list_order_info = $this->_fetched_orders[$this->_orders[$count - 1]]; $value = $value = modApiFunc("Localization", "SQL_date_format", $last_in_list_order_info['order_date']) . " - " . modApiFunc("Localization", "SQL_date_format", $first_in_list_order_info['order_date']); break; case 'ResultAmount': if (count($this->_orders) == 0) { $value = 0; break; } $amount = 0; $all_orders_are_in_main_currency = true; $main_store_currency = modApiFunc("Localization", "getCurrencyCodeById", modApiFunc("Localization", "getMainStoreCurrency")); foreach ($this->_orders as $order_id) { // order_total main_store_currency . // order' , default ( . . // main_store_currency ). // default currency main_store_currency, // , . order_total // . $order_default_currency = modApiFunc("Localization", "getOrderMainCurrency", $order_id, $this->_fetched_orders[$order_id]['order_currencies_list']); $order_total_in_order_default_currency = $this->_fetched_orders[$order_id]['price_total'][$order_default_currency]['order_total']; if ($order_default_currency == $main_store_currency) { //var_dump($order); $amount += $order_total_in_order_default_currency; } else { $all_orders_are_in_main_currency = false; $total = modApiFunc('Currency_Converter', 'convert', $order_total_in_order_default_currency, $order_default_currency, $main_store_currency); $amount += $total; } } $main_store_currency_id = modApiFunc("Localization", "getMainStoreCurrency"); modApiFunc("Localization", "pushDisplayCurrency", $main_store_currency_id, $main_store_currency_id); $value = modApiFunc("Localization", "currency_format", $amount); modApiFunc("Localization", "popDisplayCurrency"); if ($all_orders_are_in_main_currency == false) { $value = "~" . $value; } break; case 'ResultTaxTotal': break; case 'ResultFullTaxExempt': break; case 'ResultTaxTotalMinusFullTaxExempt': $tax_summary = $this->__getTaxSummary(); $value = $tax_summary[$tag]; break; case 'Items': $value = $this->getOrders(); break; case 'OrderStatusSelector': $value = '<select class="form-control input-sm input-small" name="status_id[' . $this->_order['IdInt'] . ']" onchange="onStatusChanged(' . $this->_order['IdInt'] . ')">'; if (!isset($this->OrderStatusList)) { $this->OrderStatusList = modApiFunc('Checkout', 'getOrderStatusList'); } foreach ($this->OrderStatusList as $status) { $value .= '<option value="' . $status['id'] . '" ' . ($status['id'] == $this->_order['StatusId'] ? " selected" : "") . '>' . $status['name'] . '</option>'; } $value .= '</select>'; break; case 'OrderIdLinkTitle': $value = $this->MessageResources->getMessage('ORDERS_RESULTS_ORDER_ID_LINK_TITLE'); break; case 'OrderCustomerNameLinkTitle': $value = $this->MessageResources->getMessage('ORDERS_RESULTS_ORDER_CUSTOMER_NAME_LINK_TITLE'); break; case 'OrderPaymentStatusSelector': $value = '<select class="form-control input-sm input-small" name="payment_status_id[' . $this->_order['IdInt'] . ']" onchange="onStatusChanged(' . $this->_order['IdInt'] . ')">\\n'; if (!isset($this->OrderPaymentStatusList)) { $this->OrderPaymentStatusList = modApiFunc('Checkout', 'getOrderPaymentStatusList'); } foreach ($this->OrderPaymentStatusList as $status) { $this->_payment_status = $status; $value .= '<option value="' . $status['id'] . '" ' . ($status['id'] == $this->_order['PaymentStatusId'] ? ' selected' : '') . '>' . $status['name'] . '</option>'; } $value .= '</select>'; break; case 'SearchOrders': $value = $this->TemplateFiller->fill("checkout/orders/", "search.tpl.html", array()); break; case 'SearchBy': if ($this->_filter['search_by'] == 'status') { $msg = ""; switch ($this->_filter['filter_status_id']) { case 0: $msg = $this->MessageResources->getMessage('ORDERS_SEARCH_ALL'); break; case 1: $msg = $this->MessageResources->getMessage('ORDERS_SEARCH_NEW_ORDERS'); break; case 2: $msg = $this->MessageResources->getMessage('ORDERS_SEARCH_IN_PROGRESS'); break; case 3: $msg = $this->MessageResources->getMessage('ORDERS_SEARCH_READY_TO_SHIP'); break; } $value = $msg; } elseif ($this->_filter['search_by'] == 'date') { $value = $this->MessageResources->getMessage('ORDERS_SEARCH_FILTER'); } elseif ($this->_filter['search_by'] == 'id') { $value = $this->MessageResources->getMessage('ORDERS_SEARCH_ORDER_ID'); } break; case 'SearchResults': if (count($this->_orders) == 0) { $value = modApiFunc('TmplFiller', 'fill', "checkout/orders/", "empty.tpl.html", array()); } else { $value = $this->TemplateFiller->fill("checkout/orders/", "results.tpl.html", array()); } break; case 'HighLightAll': if ($this->_filter['search_by'] == 'status' && $this->_filter['filter_status_id'] == 0) { $value = "color: blue;"; } break; case 'HighLightNewOrders': if ($this->_filter['search_by'] == 'status' && $this->_filter['filter_status_id'] == 1) { $value = "color: blue;"; } break; case 'HighLightInProgress': if ($this->_filter['search_by'] == 'status' && $this->_filter['filter_status_id'] == 2) { $value = "color: blue;"; } break; case 'HighLightReadyToShip': if ($this->_filter['search_by'] == 'status' && $this->_filter['filter_status_id'] == 3) { $value = "color: blue;"; } break; case 'HighLightDate': if ($this->_filter['search_by'] == 'date') { $value = "color: blue;"; } break; case 'HighLightDateOrderStatus': if ($this->_filter['search_by'] == 'date' && isset($this->_filter['order_statuses'])) { $value = "color: blue;"; } break; case 'HighLightDateOrderPaymentStatus': if ($this->_filter['search_by'] == 'date' && isset($this->_filter['payment_statuses'])) { $value = "color: blue;"; } break; case 'HighLightOrderId': if ($this->_filter['search_by'] == 'id') { $value = "color: blue;"; } break; case 'HighLightAffiliateId': if ($this->_filter['search_by'] == 'date' && !empty($this->_filter['affiliate_id'])) { $value = "style='color: blue;font-weight:bold;'"; } break; case 'SearchingOrderId': $value = ""; if ($this->_filter['search_by'] == 'id' && !empty($this->_filter['order_id'])) { $value = $this->_filter['order_id']; } break; case 'DeleteOrdersLink': $request = new Request(); $request->setView('DeleteOrders'); $request->setAction('SetOrdersForDeleteAction'); $value = $request->getURL(); break; case 'PaginatorLine': $obj =& $application->getInstance($tag); $value = $obj->output("Checkout_Orders", "Orders"); break; # PaginatorRows # PaginatorRows case 'PaginatorRows': $obj =& $application->getInstance($tag); $value = $obj->output("Checkout_Orders", 'Orders', 'PGNTR_ORD_ITEMS'); break; case 'ResultMessageRow': $value = $this->outputResultMessage(); break; case 'ResultMessage': $value = $this->_Template_Contents['ResultMessage']; break; case 'PackingSlipLink': $request = new Request(); $request->setView('OrderPackingSlip'); $request->setAction('SetCurrentOrder'); $request->setKey('order_id', $this->_order['IdInt']); // uncomment the following link to force printing // $request -> setKey('do_print', 'Y'); $value = $request->getURL(); break; case 'InvoiceLink': $request = new Request(); $request->setView('OrderInvoice'); $request->setAction('SetCurrentOrder'); $request->setKey('order_id', $this->_order['IdInt']); // uncomment the following link to force printing // $request -> setKey('do_print', 'Y'); $value = $request->getURL(); break; case 'AffiliateIDSearch': $v = isset($this->_filter['affiliate_id']) ? $this->_filter['affiliate_id'] : ""; $value = "<input type='text' name='affiliate_id' size='28' class='form-control form-filter input-sm' value='" . $v . "' />"; break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'order') { if (_ml_strpos($tag, 'price') === 0) { $tag = _ml_strtolower(_ml_substr($tag, _ml_strlen('price'))); if ($tag == 'total') { $value = $this->_order['Total']; if ($this->_order['TotalInMainStoreCurrency'] !== NULL) { $value = $this->_order['TotalInMainStoreCurrency'] . ' (' . $value . ')'; } } elseif ($tag == 'subtotal') { $value = $this->_order['Subtotal']; } else { if ($tag == 'taxes') { $full_tax_exempt_orders = $this->__getFullTaxExemptOrders(); $code = $this->_fetched_orders[$this->_order['IdInt']]["order_currencies_list"]["CURRENCY_TYPE_MAIN_STORE_CURRENCY"]["currency_code"]; $value = $this->_fetched_orders[$this->_order['IdInt']]["price_total"][$code]["order_tax_total"]; $crcy_id = modApiFunc("Localization", "getCurrencyIdByCode", $code); modApiFunc("Localization", "pushDisplayCurrency", $crcy_id, $crcy_id); $value = modApiFunc("Localization", "currency_format", $value); $null_value = modApiFunc("Localization", "currency_format", "0.0000"); modApiFunc("Localization", "popDisplayCurrency"); if (array_key_exists($this->_order['IdInt'], $full_tax_exempt_orders)) { $value = $null_value . " (ex. {$value})"; } } else { $prices = getKeyIgnoreCase('price', $this->_order); $value = $prices[$tag]; } } } elseif (_ml_strpos($tag, 'customer') === 0) { $tag = _ml_strtolower(_ml_substr($tag, _ml_strlen('customer'))); switch ($tag) { case 'name': $value = $this->_order['PersonName']; break; case 'id': $value = $this->_order['PersonId']; break; case 'infoname': $value = $this->_order['PersonInfoName']; break; } } else { $value = getKeyIgnoreCase($tag, $this->_order); } } break; } return $value; }
<tr><td>Name:</td><td><input type="text" name="name"></td></tr> <tr><td>ID:</td><td><input type="text" name="id"></td></tr> </table> <br> <input type="submit" value="Create"> </form> <?php } else { if ($second_resource === "edit") { ?> <a href="/admin/tags"><<< Back to Tag Management</a><br><br> <form action="/admin/edittag" method="post"> <table> <tr><td>Name:</td><td><input type="text" name="name" value="<?php echo getTagName($third_resource); ?> "></td></tr> <tr><td>ID:</td><td><input type="text" name="id" value="<?php echo $third_resource; ?> "></td></tr> </table> <br> <input type="hidden" name="orig_id" value="<?php echo $third_resource; ?> "> <input type="submit" value="Modify"> </form> <?php
/** * Processes tags in the templates for the given view. * * @return string tag value, if tag has been processed. NULL, otherwise. */ function getTag($tag) { $value = null; switch ($tag) { case 'Local_Items': $value = $this->outputCatalogNavigatorTree(); break; case 'Local_NestedCategories': $value = $this->outputCatalogNavigatorTree($this->_Current_Category->getCategoryTagValue('id')); break; case 'Local_RootCategoryID': $value = $this->settings['TREE_ROOT']; break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'category' && is_object($this->_Current_Category)) { $value = $this->_Current_Category->getCategoryTagValue($tag); } break; } return $value; }
/** * Processes tags in the templates for the given view. * * @return string tag value, if tag has been processed. NULL, otherwise. */ function getTag($tag) { global $application; $value = null; switch ($tag) { case 'Local_JSfuncProductFormSubmit': $value = "<script type=\"text/javascript\">" . "function ProductFormSubmit_" . $this->_ProductInfo['ID'] . "()" . "{" . " document.forms['ProductForm_" . $this->_ProductInfo['ID'] . "'].submit();" . "};" . "</script>"; break; case 'Local_ProductStockWarnings': if (!modApiFunc('Session', 'is_set', 'StockDiscardedBy')) { $value = ''; } else { $stock_discarded_by = modApiFunc('Session', 'get', 'StockDiscardedBy'); modApiFunc('Session', 'un_set', 'StockDiscardedBy'); $value = $stock_discarded_by; //cz_getMsg($stock_discarded_by); } break; case 'Local_ProductFormStart': $value = '<form action="cart.php" name="ProductForm_' . $this->_ProductInfo['ID'] . '" id="ProductForm_' . $this->_ProductInfo['ID'] . '" method="post" enctype="multipart/form-data"> <input type="hidden" name="asc_action" value="AddToCart" /> <input type="hidden" name="prod_id" value="' . $this->_ProductInfo['ID'] . '" /> <script type="text/javascript"> function ProductFormSubmit_' . $this->_ProductInfo['ID'] . '() { document.forms[\'ProductForm_' . $this->_ProductInfo['ID'] . '\'].submit(); }; </script>'; break; case 'Local_ProductFormEnd': $value = '</form>'; break; case 'Local_ProductAddToCart': $value = 'javascript: ProductFormSubmit_' . $this->_ProductInfo['ID'] . '();'; break; case 'ProductOptionsForm': $value = getOptionsChoice($this->_ProductInfo['ID']); break; case 'Local_FormQuantityFieldName': $value = 'quantity_in_cart'; break; case 'Local_ProductQuantityOptions': $qty_in_cart = modApiFunc("Cart", "getProductQuantity", $this->_ProductInfo['ID']); $value = modApiFunc("Cart", "getProductQuantityOptions", $qty_in_cart, $this->_ProductInfo['ID']); break; case 'RelatedProducts': $value = $this->_rp_output; // output break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'product') { $value = getKeyIgnoreCase($tag, $this->_ProductInfo); } break; } return $value; }
function load_config($file) { global $dictionary; if (!file_exists($file)) { return; } // Load via SimpleXML. $xml_document = simplexml_load_file($file); // Add all of the settings to the dictionary. foreach ($xml_document->xpath('/settings/*') as $item) { $item_content = dumpNode($item); $item_name = getTagName($item); if ($item_name[strlen($item_name) - 1] == "/") { $item_name = substr($item_name, 0, strlen($item_name) - 1); } $dictionary["{$item_name}"] = $item_content; } $servers = array(); $uploadFileType = array(); // Add all of the languages to the dictionary. foreach ($xml_document->xpath('/settings/servers/server') as $item) { //print_r($item); $temp = object2array($item); array_push($servers, $temp); } foreach ($xml_document->xpath('/settings/uploadFileType') as $item) { $temp = object2array($item); array_push($uploadFileType, $temp); } $dictionary["servers"] = $servers; $dictionary["uploadFileType"] = $uploadFileType; // print_r($dictionary); }
function editar() { $this->obj->inicializar('software-editar', 'Editar Software'); $aid = $_GET['id']; $vid = $aid; $query = "SELECT * FROM `aRecurso_software` WHERE `id`='{$aid}'"; $res = mysql_query($query); $r = mysql_fetch_array($res); $tip = $this->obj->archivos->tipo($this->obj->archivos->nombre($r['id_archivo'])); $nom = $this->obj->archivos->nombre($r['id_archivo']); $tam = $this->obj->archivos->tamano($r['id_archivo']); $tit = $r['titulo']; $url = $r['url']; $car = "carpeta"; //$r['carpeta']; $res = $r['resumen']; $this->asignar('id', $aid); $this->asignar('aid', $vid); $this->asignar('tipo', $tip); $this->asignar('nombre', $nom); $this->asignar('tamano', $tam); $this->asignar('tituloa', $tit); if ($url) { $this->asignar('url', $url); } if ($res) { $this->asignar('resumen', $res); } //******* $query = "SELECT * FROM `kControl_diccionario_etiquetas` WHERE `id_recurso`='{$aid}' AND `tipo_recurso`='2' "; $res = mysql_query($query); $etiqueta = ""; while ($r = mysql_fetch_array($res)) { if (getTagName($r['id_etiqueta']) != "") { $etiqueta .= getTagName($r['id_etiqueta']) . ","; } } $this->asignar('etiquetas', $etiqueta); //********* $this->carpeta = $car; $this->obj->sesion->exponer(); $this->exponer(); tengoPermiso('crear_recursos', @$_SESSION['perfil']) ? $this->asignar('crear_recursos', true) : ""; tengoPermiso('actualizar_recursos', @$_SESSION['perfil']) ? $this->asignar('actualizar_recursos', true) : ""; tengoPermiso('borrar_recursos', @$_SESSION['perfil']) ? $this->asignar('borrar_recursos', true) : ""; tengoPermiso('configuracion_perfil', @$_SESSION['perfil']) ? $this->asignar('configuracion_perfil', true) : ""; tengoPermiso('configuracion_grupos', @$_SESSION['perfil']) ? $this->asignar('configuracion_grupos', true) : ""; $this->obj->enviarPagina(); }
function editar() { $this->obj->inicializar('vinculos-editar', 'Editar Software'); $aid = $_GET['id']; $query = "SELECT * FROM `aRecurso_vinculos` WHERE `id`='{$aid}'"; $res = mysql_query($query); $r = mysql_fetch_array($res); $url = $r['url']; $car = "carpeta"; //$r['carpeta']; $des = $r['descripcion']; $this->asignar('id', $aid); if ($url) { $this->asignar('url', $url); } if ($des) { $this->asignar('descripcion', $des); } //******* $query = "SELECT * FROM `kControl_diccionario_etiquetas` WHERE `id_recurso`='{$aid}' AND `tipo_recurso`='4' "; $res = mysql_query($query); $etiqueta = ""; while ($r = mysql_fetch_array($res)) { if (getTagName($r['id_etiqueta']) != "") { $etiqueta .= getTagName($r['id_etiqueta']) . ","; } } $this->asignar('etiquetas', $etiqueta); //********* $this->carpeta = $car; $this->obj->sesion->exponer(); $this->exponer(); tengoPermiso('crear_recursos', @$_SESSION['perfil']) ? $this->asignar('crear_recursos', true) : ""; tengoPermiso('actualizar_recursos', @$_SESSION['perfil']) ? $this->asignar('actualizar_recursos', true) : ""; tengoPermiso('borrar_recursos', @$_SESSION['perfil']) ? $this->asignar('borrar_recursos', true) : ""; tengoPermiso('configuracion_perfil', @$_SESSION['perfil']) ? $this->asignar('configuracion_perfil', true) : ""; tengoPermiso('configuracion_grupos', @$_SESSION['perfil']) ? $this->asignar('configuracion_grupos', true) : ""; $this->obj->enviarPagina(); }
function getTag($tag) { global $application; $value = null; switch ($tag) { case "areOrderPricesEditable": $value = ""; if ($this->_form_style == ORDERS_INFO_ADVANCED_FORM) { $value = $this->checkAreOrderPricesEditable(); } break; case 'Products': $value = $this->getProducts(); break; case 'CycleColor': $value = $this->_pkey % 2 == 0 ? '#FFFFFF' : '#EEEEEE'; break; case 'PersonInfo': $value = ''; if (modApiFunc('Customer_Account', 'isPersionInfoGroupActive', 'Billing')) { $value .= $this->getPersonInfo('Billing'); } if (modApiFunc('Customer_Account', 'isPersionInfoGroupActive', 'Shipping')) { $value .= $this->getPersonInfo('Shipping'); } $value .= $this->getPersonInfoEncrypted('CreditCard'); $value .= $this->getPersonInfo('BankAccount'); break; case 'OrderComments': $value = $this->getComments(); break; case 'OrderHistory': $value = $this->getHistory(); break; // @ tax labels here // @ tax labels here case "OrderTaxItemTaxName": $value = $this->_Tax_Item['TaxName']; if ($this->_form_style == ORDERS_INFO_ADVANCED_FORM && $this->_Tax_Item['is_included'] == 1 && $this->DisplayIncludedTax == true) { $value = '*' . $value; } break; case "OrderTaxItemTaxAmount": if ($this->_form_style == ORDERS_INFO_SIMPLE_FORM || $this->isOrderEditable == false) { $value = modApiFunc("Localization", "currency_format", $this->_Tax_Item['TaxAmount']); if ($this->_Tax_Item['TaxId'] == "taxExemption") { $value .= "<input type='hidden' name='taxExemption' value='off'>"; } else { $value .= "<input type=hidden name='tax[{$this->_Tax_Item['TaxId']}][value]' value='{$this->_Tax_Item['TaxAmount']}'>" . "<input type=hidden name='tax[{$this->_Tax_Item['TaxId']}][is_included]' value='{$this->_Tax_Item['is_included']}'>"; } } else { if ($this->_Tax_Item['TaxId'] == "taxExemption") { $value = $this->_Tax_Item['TaxAmount']; } else { $value = '<input class="input_value" type="text" ' . $this->HtmlForm->genInputTextField("16", "tax[{$this->_Tax_Item['TaxId']}][value]", "6", prepareHTMLDisplay($this->_Tax_Item['TaxAmount'])) . " onFocus='setPricesAsEdited();' />" . "<input type=hidden name='tax[{$this->_Tax_Item['TaxId']}][is_included]' value='{$this->_Tax_Item['is_included']}'>"; } } break; case "OrderTaxDisOpItemName": $value = $this->_Tax_Item['TaxName']; if ($this->_form_style == ORDERS_INFO_ADVANCED_FORM) { $value .= " (ƒ: {$this->_Tax_Item['formula']})"; } break; case "OrderTaxDisOpItemAmount": $value = $value = modApiFunc("Localization", "currency_format", $this->_Tax_Item['TaxAmount']); break; case 'Controls': if (modApiFunc("Checkout", "getDeleteOrdersFlag") == "true") { $value = $this->TemplateFiller->fill("checkout/" . $this->template_folder . "/", "controls-style3.tpl.html", array()); } elseif ($this->_form_style == ORDERS_INFO_SIMPLE_FORM) { $value = $this->TemplateFiller->fill("checkout/" . $this->template_folder . "/", "controls-style1.tpl.html", array()); } elseif ($this->_form_style == ORDERS_INFO_ADVANCED_FORM) { $value = $this->TemplateFiller->fill("checkout/" . $this->template_folder . "/", "controls-style2.tpl.html", array()); } break; case 'PageTutorialHelpLinks': if (modApiFunc("Checkout", "getDeleteOrdersFlag") == "true") { $value = $this->TemplateFiller->fill("checkout/" . $this->template_folder . "/", "pagetutoriallinks-style3.tpl.html", array()); } elseif ($this->_form_style == ORDERS_INFO_SIMPLE_FORM) { $value = $this->TemplateFiller->fill("checkout/" . $this->template_folder . "/", "pagetutoriallinks-style1.tpl.html", array()); } elseif ($this->_form_style == ORDERS_INFO_ADVANCED_FORM) { $value = $this->TemplateFiller->fill("checkout/" . $this->template_folder . "/", "pagetutoriallinks-style2.tpl.html", array()); } break; case 'CommentDate': $value = modApiFunc("Localization", "SQL_date_format", $this->_note['date']) . " " . modApiFunc("Localization", "SQL_time_format", $this->_note['date']); break; case 'CommentValue': $value = $this->_note['content']; break; case 'Counter': $value = $this->_counter; break; ### Status selectors ### Status selectors case 'OrderStatusSelector': if (modApiFunc("Checkout", "getDeleteOrdersFlag") == "true") { $value = $this->_order['Status']; } else { $value = $this->TemplateFiller->fill("checkout/" . $this->template_folder . "/", "status-selector.tpl.html", array()); } break; case 'OrderStatusSelectorItems': $status_array = modApiFunc('Checkout', 'getOrderStatusList'); $value = ""; foreach ($status_array as $status) { $this->_status = $status; $value .= $this->TemplateFiller->fill("checkout/" . $this->template_folder . "/", "status-selector-item.tpl.html", array()); } break; case 'StatusId': $value = $this->_status['id']; break; case 'StatusName': $value = $this->_status['name']; break; case 'StatusSelected': if ($this->_status['id'] == $this->_order['StatusId']) { $value = " selected"; } else { $value = ""; } break; case 'OrderPaymentStatusSelector': if (modApiFunc("Checkout", "getDeleteOrdersFlag") == "true") { $value = $this->_order['PaymentStatus']; } else { $value = $this->TemplateFiller->fill("checkout/" . $this->template_folder . "/", "payment-status-selector.tpl.html", array()); } break; case 'OrderPaymentStatusSelectorItems': $status_array = modApiFunc('Checkout', 'getOrderPaymentStatusList'); $value = ""; foreach ($status_array as $status) { $this->_payment_status = $status; $value .= $this->TemplateFiller->fill("checkout/orders/", "payment-status-selector-item.tpl.html", array()); } break; case 'PaymentStatusId': $value = $this->_payment_status['id']; break; case 'PaymentStatusName': $value = $this->_payment_status['name']; break; case 'PaymentStatusSelected': if ($this->_payment_status['id'] == $this->_order['PaymentStatusId']) { $value = " selected"; } else { $value = ""; } break; case 'AppliedGiftCertificatesList': $gcs = modApiFunc('GiftCertificateApi', 'getOrderGCs', $this->order_id); $value = ""; if (!empty($gcs) && is_array($gcs)) { foreach ($gcs as $gc) { $value .= $this->TemplateFiller->fill("checkout/orders/", "gift-certificate-item.tpl.html", array("GiftCertificateCode" => $gc['gc_code'])); } } else { $value = "<tr><td colspan=\"3\" class=\"text-center\">" . getMsg("CHCKT", "LBL_NO_GIFT_CERTIFICATES") . "</td></tr>"; } break; case 'OrderIvoiceHREF': $request = new Request(); $request->setView('OrderInvoice'); $request->setAction('SetCurrentOrder'); $request->setKey('order_id', $this->order_id); $request->setKey('order_currency_id', $this->order_currency); $value = $request->getURL(); break; case 'OrderPackingSlipHREF': $request = new Request(); $request->setView('OrderPackingSlip'); $request->setAction('SetCurrentOrder'); $request->setKey('order_id', $this->order_id); $request->setKey('order_currency_id', $this->order_currency); $value = $request->getURL(); break; case 'OrderTrackId': if (modApiFunc("Checkout", "getDeleteOrdersFlag") == "true") { $value = $this->_order['TrackId']; } else { $value = "<textarea name=\"track_id\" cols=\"60\" rows=\"5\" class=\"form-control\">" . prepareHTMLDisplay($this->_order['TrackId']) . "</textarea>"; } break; case 'OrderAffiliateId': if (!empty($this->_order['AffiliateId'])) { $value = $this->_order['AffiliateId']; } else { $value = getMsg("CHCKT", "LBL_NO_AFFILIATE_ID"); } break; case 'FormStyle': $value = $this->_form_style; break; case 'OrderPaymentMethod': if ($this->_form_style == ORDERS_INFO_SIMPLE_FORM) { $value = getKeyIgnoreCase('PaymentMethod', $this->_order); } else { $payment_method = getKeyIgnoreCase('PaymentMethod', $this->_order); $this->_input_control = array('name' => 'payment_method', 'value' => $payment_method, 'size' => 40); $value = $this->TemplateFiller->fill("checkout/" . $this->template_folder . "/", "input-control.tpl.html", array()); } break; case 'OrderShippingMethod': if ($this->_form_style == ORDERS_INFO_SIMPLE_FORM) { $value = getKeyIgnoreCase('ShippingMethod', $this->_order); } else { $shipping_method = getKeyIgnoreCase('ShippingMethod', $this->_order); $this->_input_control = array('name' => 'shipping_method', 'value' => $shipping_method, 'size' => 40); $value = $this->TemplateFiller->fill("checkout/" . $this->template_folder . "/", "input-control.tpl.html", array()); } break; case 'OrderShippingMethodLabelOnly': $value = getKeyIgnoreCase('ShippingMethod', $this->_order); break; case 'OrderPaymentProcessorOrderId': if ($this->_form_style == ORDERS_INFO_SIMPLE_FORM) { $value = getKeyIgnoreCase('PaymentProcessorOrderId', $this->_order); } else { $processor_order_id = getKeyIgnoreCase('PaymentProcessorOrderId', $this->_order); $this->_input_control = array('name' => 'processor_order_id', 'value' => $processor_order_id, 'size' => 40); $value = $this->TemplateFiller->fill("checkout/" . $this->template_folder . "/", "input-control.tpl.html", array()); } break; case 'InputControlName': $value = $this->_input_control['name']; break; case 'InputControlValue': $value = $this->_input_control['value']; break; case 'InputControlSize': $value = $this->_input_control['size']; break; case 'Delete': $value = modApiFunc("Checkout", "getDeleteOrdersFlag"); break; case 'AddCommentVisibilityOpen': if (modApiFunc("Checkout", "getDeleteOrdersFlag") == "true") { $value = "<!--"; } break; case 'AddCommentVisibilityClose': if (modApiFunc("Checkout", "getDeleteOrdersFlag") == "true") { $value = "-->"; } break; case 'CHECKOUT_ORDER_INFO_REMOVE_ENCRYPTED_PERSON_INFO_MSG': case 'CHECKOUT_ORDER_INFO_REMOVE_ENCRYPTED_PERSON_INFO_CONFIRM_MSG': $value = $this->_msg[$tag]; break; case 'ResultMessageRow': $value = $this->outputResultMessage(); break; case 'ResultMessage': $value = $this->_Template_Contents['ResultMessage']; break; case 'OrderCurrency': $value = $this->outputOrderCurrency(); break; case 'OrderCurrencyHREF': $request = new Request(); $request->setView('OrderInfo'); $request->setAction('SetCurrentOrder'); $request->setKey('order_id', $this->order_id); $value = $request->getURL(); break; case 'OrderCurrencyStyle': // - . $value = $this->outputOrderCurrencyStyle(); break; default: $tag_copy = $tag; list($entity, $tag) = getTagName($tag); if ($entity == 'order') { if (_ml_strpos($tag, 'price') === 0) { $tag = _ml_strtolower(_ml_substr($tag, _ml_strlen('price'))); if ($tag == 'total') { $value = modApiFunc("Localization", "currency_format", $this->_order['Total']); } elseif ($tag == 'subtotal') { $value = modApiFunc("Localization", "currency_format", $this->_order['Subtotal']); } elseif ($tag == 'totaltopay') { $value = modApiFunc("Localization", "currency_format", $this->_order['Price']['OrderTotalToPay']); } elseif ($tag == 'totalprepaidbygc') { $value = modApiFunc("Localization", "currency_format", $this->_order['Price']['OrderTotalPrepaidByGC']); } elseif ($tag == 'taxes') { $value = $this->getTaxes(); } elseif ($tag == 'shippinglabelonly') { $prices = getKeyIgnoreCase('price', $this->_order); $shipping = getKeyIgnoreCase("TotalShippingAndHandlingCost", $prices); $shipping = $shipping == PRICE_N_A ? 0.0 : $shipping; $value = modApiFunc("Localization", "currency_format", $shipping); } elseif ($tag == 'shipping') { $prices = getKeyIgnoreCase('price', $this->_order); $shipping = getKeyIgnoreCase("TotalShippingAndHandlingCost", $prices); $shipping = $shipping == PRICE_N_A ? 0.0 : $shipping; if ($this->_form_style == ORDERS_INFO_SIMPLE_FORM || $this->isOrderEditable == false) { $value = modApiFunc("Localization", "currency_format", $shipping); $value .= "<input type=hidden name='shippingHandling' value='{$shipping}'>"; } else { $value = '<input class="input_value" type="text" ' . $this->HtmlForm->genInputTextField("16", "shippingHandling", "6", prepareHTMLDisplay($shipping)) . " onFocus='setPricesAsEdited();' />"; } } elseif ($tag == 'subtotalglobaldiscount') { $prices = getKeyIgnoreCase('price', $this->_order); $subtotal_global_discount = getKeyIgnoreCase("SubtotalGlobalDiscount", $prices); $subtotal_global_discount = $subtotal_global_discount == PRICE_N_A ? 0.0 : $subtotal_global_discount; if ($this->_form_style == ORDERS_INFO_SIMPLE_FORM || $this->isOrderEditable == false) { $value = modApiFunc("Localization", "currency_format", $subtotal_global_discount); $value .= "<input type=hidden name='globalDiscount' value='{$subtotal_global_discount}'>"; } else { $value = '<input type="text" class="input_value"' . $this->HtmlForm->genInputTextField("16", "globalDiscount", "6", prepareHTMLDisplay($subtotal_global_discount)) . " onFocus=\"setPricesAsEdited();\" />"; } } elseif ($tag == 'subtotalpromocodediscount') { $prices = getKeyIgnoreCase('price', $this->_order); $subtotal_promo_code_discount = getKeyIgnoreCase("SubtotalPromoCodeDiscount", $prices); $subtotal_promo_code_discount = $subtotal_promo_code_discount == PRICE_N_A ? 0.0 : $subtotal_promo_code_discount; if ($this->_form_style == ORDERS_INFO_SIMPLE_FORM || $this->isOrderEditable == false) { $value = modApiFunc("Localization", "currency_format", $subtotal_promo_code_discount); $value .= "<input type=hidden name='promoCodeDiscount' value='{$subtotal_promo_code_discount}'>"; } else { $value = '<input class="input_value" type="text" ' . $this->HtmlForm->genInputTextField("16", "promoCodeDiscount", "6", prepareHTMLDisplay($subtotal_promo_code_discount)) . " onFocus=\"setPricesAsEdited();\" />"; } } elseif ($tag == 'subtotalpromocodediscountinfo') { $prices = getKeyIgnoreCase('price', $this->_order); $subtotal_promo_code_discount = getKeyIgnoreCase("SubtotalPromoCodeDiscount", $prices); // - . $info = modApiFunc("PromoCodes", "getOrderCoupons", $this->order_id); if (!empty($info)) { // $coupon_id = $info[0]["coupon_id"]; $coupon_promo_code = $info[0]["coupon_promo_code"]; // , _ ( id). // - . - // . $info = modApiFunc("PromoCodes", "getPromoCodeInfo", $coupon_id); if ($info === false) { $coupon_tag = "(" . $coupon_promo_code . ")"; } else { $request = new Request(); $request->setView('EditPromoCode'); $request->setAction('SetEditablePromoCode'); $request->setKey('PromoCode_id', $coupon_id); $value = $request->getURL(); $coupon_tag = '(<a href="' . $value . '" style="color: blue;">' . $coupon_promo_code . '</a>)'; } } else { $coupon_tag = ""; } $value = $coupon_tag; } elseif ($tag == 'quantitydiscount') { $prices = getKeyIgnoreCase('price', $this->_order); $quantity_discount = getKeyIgnoreCase("QuantityDiscount", $prices); $quantity_discount = $quantity_discount == PRICE_N_A ? 0.0 : $quantity_discount; if ($this->_form_style == ORDERS_INFO_SIMPLE_FORM || $this->isOrderEditable == false) { $value = modApiFunc("Localization", "currency_format", $quantity_discount); $value .= "<input type=hidden name='qtyDiscount' value='{$quantity_discount}'>"; } else { $value = '<input class="input_value" type="text" ' . $this->HtmlForm->genInputTextField("16", "qtyDiscount", "6", prepareHTMLDisplay($quantity_discount)) . " onFocus=\"setPricesAsEdited();\" />"; } } elseif ($tag == 'discountedsubtotal') { $prices = getKeyIgnoreCase('price', $this->_order); $discounted_subtotal = getKeyIgnoreCase("DiscountedSubtotal", $prices); $discounted_subtotal = $discounted_subtotal == PRICE_N_A ? 0.0 : $discounted_subtotal; $value = modApiFunc("Localization", "currency_format", $discounted_subtotal); } else { $prices = getKeyIgnoreCase('price', $this->_order); $value = modApiFunc("Localization", "currency_format", getKeyIgnoreCase($tag, $prices)); } } elseif (_ml_strpos($tag, 'taxitem') === 0) { $tag = _ml_strtolower(_ml_substr($tag, _ml_strlen('taxitem'))); $value = getKeyIgnoreCase($tag, $this->_Tax_Item); } else { $value = getKeyIgnoreCase($tag, $this->_order); } } elseif ($entity == 'product') { if ($tag == 'amount') { $qty = getKeyIgnoreCase('qty', $this->_product); $price = getKeyIgnoreCase('SalePrice', $this->_product['attr']); $value = modApiFunc("Localization", "currency_format", $qty * $price['value']); } else { if ($tag == "name") { if ($this->_form_style == ORDERS_INFO_SIMPLE_FORM) { $value = $this->_product["name"]; } else { $value = '<input type="text" class="input_value" ' . $this->HtmlForm->genInputTextField("255", "productName[{$this->_product["id"]}]", "50", prepareHTMLDisplay($this->_product["name"])) . "/>"; } } else { if ($tag == "qty") { if ($this->_form_style == ORDERS_INFO_SIMPLE_FORM || $this->isOrderEditable == false) { $value = $this->_product["qty"]; $value .= "<input type=hidden name='productQty[{$this->_product["id"]}]' value='{$this->_product["qty"]}'>"; } else { $value = '<input type="text" class="input_value" ' . $this->HtmlForm->genInputTextField("16", "productQty[{$this->_product["id"]}]", "4", prepareHTMLDisplay($this->_product["qty"])) . " onFocus=\"setPricesAsEdited();\" />"; } } elseif ($tag == 'saleprice') { if ($this->_form_style == ORDERS_INFO_SIMPLE_FORM || $this->isOrderEditable == false) { $price = getKeyIgnoreCase('SalePrice', $this->_product['attr']); $value = modApiFunc("Localization", "currency_format", $price['value']); $value .= "<input type=hidden name='productPrice[{$this->_product["id"]}]' value='{$price['value']}'>"; } else { $price = getKeyIgnoreCase('SalePrice', $this->_product['attr']); $value = modApiFunc("Localization", "currency_format", $price['value']); $value = '<input type="text" class="input_value" ' . $this->HtmlForm->genInputTextField("32", "productPrice[{$this->_product["id"]}]", "10", prepareHTMLDisplay($price['value'])) . " onFocus=\"setPricesAsEdited();\" />"; } } elseif ($tag == 'handpickedoptions') { //: put to the template? $value = ""; for ($j = 0; $j < count($this->_product['options']); $j++) { $_val = $this->_product['options'][$j]['option_value']; if ($_val != '') { if ($this->_product['options'][$j]['is_file'] == 'Y') { $_val = '<a href="orders_info.php?asc_action=get_uploaded_file&fp=' . base64_encode($_val) . '">' . basename($_val) . '</a>'; } else { if ($this->_form_style == ORDERS_INFO_ADVANCED_FORM) { $_val = "<br/><textarea name='productOption[{$this->_product['options'][$j]['product_option_id']}]' cols='30' rows='1'>" . prepareHTMLDisplay($_val) . "</textarea>"; } } } $value .= "<b>" . $this->_product['options'][$j]['option_name'] . "</b>: " . $_val . "<br>"; } if ($value != "") { $value = "<div style='padding-top: 4px;'><div style='padding: 2px; background: #EEF2F8; border-top: solid 1px #A9A9A9; font-weight: bold;'>" . getMsg('PO', 'OPTIONS') . "</div>" . $value . "</div>"; } } elseif ($tag == 'hotlinks') { $value = ""; if (count(modApiFunc('Product_Files', 'getHotlinksList', $this->_product['id']))) { $value = '<br><a href="javascript: void(0);" onClick="openURLinNewWindow(\'popup_window.php?page_view=PF_OrderHotlinks&opid=' . $this->_product['id'] . '\',\'OrderHotlinks\')"><b>' . getMsg('PF', 'HOTLINKS') . '</b></a>'; } } else { $value = getKeyIgnoreCase($tag, $this->_product); } } } } elseif ($entity == 'group') { $value = getKeyIgnoreCase($tag, $this->_group); } elseif ($entity == 'attribute') { //The code is not correct. Output the warning about CVV. //It would be better to find the id by the tag in the table person_attributes. $cvv_person_attribute_id = 14; if (isset($this->_attr['personattributeid']) && $this->_attr['personattributeid'] == $cvv_person_attribute_id) { $value = getKeyIgnoreCase($tag, $this->_attr); } else { $value = nl2br(htmlspecialchars(getKeyIgnoreCase($tag, $this->_attr))); } } break; } return $value; }
//echo $job . ' for tab: ' . $tabId; if ($job == "getUserTab" && $tabId != "") { //$('input').tagsinput('add', { id: 1, text: 'some tag' }); //echo json_encode($data); $sql = "select tabTagIds FROM userTabTags WHERE userTabId = '{$tabId}'"; //echo $sql; $addTagScript = ""; $storedTags = ""; if ($res = $db_CS->query($sql)) { $obj = $res->fetch_object(); if ($obj && $obj->tabTagIds != "") { //echo $obj->tabTagIds; $tagsArray = explode(",", $obj->tabTagIds); //$tagsArray = array_reverse($tagsArray); foreach ($tagsArray as $tagId) { $tagName = getTagName($db_CS, $tagId); if ($tagName != "Не существует") { $storedTags[] = array("id" => $tagId, "text" => $tagName); $addTagScript .= "\$('#tagList').tagsinput('add', { value: " . $tagId . ", text: '" . $tagName . "' });"; } } } } if ($type != "json") { echo "\n\t\t<script>\n\t\t\$('#tagList').tagsinput('removeAll');\n\t\t" . $addTagScript . "\n\t\t</script>\n\t\t"; } else { echo json_encode($storedTags); } } if ($job == "updateUserTab" && $tabId != "") { $sql = "replace into userTabTags (tabTagIds,userTabId) VALUES ('";
/** * @ describe the function AddProductInfo->getTag. */ function getTag($tag) { global $application; $obj =& $application->getInstance('MessageResources'); $imagesUrl = $application->getAppIni('URL_IMAGES_DIR'); if ($application->getCurrentProtocol() == "https" && $application->getAppIni('HTTPS_URL_IMAGES_DIR')) { $imagesUrl = $application->getAppIni('HTTPS_URL_IMAGES_DIR'); } $pathImagesDir = $application->getAppIni('PATH_IMAGES_DIR'); $value = null; switch ($tag) { case 'Items': $value = $this->getAttributes(); break; case 'Errors': $value = $this->getErrors(); break; case 'AttributeName': $value = $this->_attr['name']; break; case 'AttributeValue': $value = $this->_attr['value']; break; case 'AttributeDefaultValue': $value = $this->_attr['def_value']; break; case 'AttributeTag': $value = $this->_attr['tag']; break; case 'AttributeTagHidden': $value = $this->_attr['tag_hid']; break; case 'AttributeUnit': $value = $this->_attr['unit']; break; case 'AttributePatternType': $value = $this->_attr['pattern_type']; break; case 'AttributeFormat': $value = modApiFunc("Localization", "format_settings_for_js", $this->_attr['pattern_type']); break; case 'AttributeSize': $value = $this->_attr['size']; break; case 'AttributeMax': $value = $this->_attr['max']; break; case 'Counter': $value = $this->_counter; break; case 'AttributeSelectOptions': $value = ""; foreach ($this->_attr_options as $opt_value) { $this->_attr_option = $opt_value; $value .= $this->TemplateFiller->fill("catalog/product_add/", "attr-select-option.tpl.html", array()); } break; case 'AttributeCheckboxes': $value = ""; foreach ($this->_attr_options as $opt_value) { $this->_attr_option = $opt_value; $value .= $this->TemplateFiller->fill("catalog/product_add/", "attr-checkboxgroup-item.tpl.html", array()); } break; case 'AttributeOptionValue': $value = $this->_attr_option['value']; break; case 'AttributeOptionSelected': if ($this->_attr_option['selected']) { $value = " selected"; } break; case 'AttributeOptionName': if ($this->_attr['tag'] == 'TaxClass' && $this->_attr['tag'] != 'MembershipVisibility') { $value = prepareHTMLDisplay($this->_attr_option['name']); } else { $value = $this->_attr_option['name']; } break; case 'AttributeNextCheckboxColumn': $value = $this->_attr_option['next_column']; break; case 'AddLink': $value = isset($this->_attr['additional_link']) ? $this->_attr['additional_link'] : ""; break; case 'AddLinkText': $value = isset($this->_attr['additional_link_text']) ? $this->_attr['additional_link_text'] : ""; break; case 'ViewStateLargeImage': $value = ''; if ($this->ViewState['LargeImage']) { $images_dir = $imagesUrl; $value = $images_dir . $this->ViewState['LargeImage']; } break; case 'ViewStateSmallImage': $value = ''; if ($this->ViewState['SmallImage']) { $images_dir = $imagesUrl; $value = $images_dir . $this->ViewState['SmallImage']; } break; case 'LargeImageWidth': $value = ''; if ($this->ViewState['LargeImage']) { list($width, $height) = getimagesize($pathImagesDir . $this->ViewState['LargeImage']); $value = $width; } break; case 'LargeImageHeight': $value = ''; if ($this->ViewState['LargeImage']) { list($width, $height) = getimagesize($pathImagesDir . $this->ViewState['LargeImage']); $value = $height; } break; case 'ViewStateSmallImageRelativePath': //Hidden Value $value = ''; if ($this->ViewState['SmallImage']) { $images_dir = $imagesUrl; $value = $images_dir . $this->ViewState['SmallImage']; } break; case 'ViewStateTypeID': $value = $this->ViewState['TypeID']; break; case 'ProductTypeID': $value = $this->product_type_id; break; case 'ProductTypeName': $product_type_desc = modApiFunc('Catalog', 'getProductType', $this->product_type_id); $value = $product_type_desc['name']; break; case 'ViewStateClose': $value = $this->ViewState['hasCloseScript']; break; case 'refreshParent': $value = ''; if (isset($this->POST['addAnother']) && $this->POST['addAnother'] == "true") { $value = "window.opener.location.reload();\n"; $value .= "window.focus();"; } break; case 'ErrorIndex': $value = $this->_error_index; break; case 'Error': $value = $this->_error; break; case 'InputStyleClass': $classes = array(); if ($this->_error != '') { $classes[] = 'error'; } if ($this->allow_html) { $classes[] = 'tiny_mce'; } $value = implode(' ', $classes); break; case 'SubmitUploadImagesScript': $value = 'onclick="if(formElementOnFocus()){CatalogAddProduct.FormSubmitValue.value = \'UploadImages\';CatalogAddProduct.submit();_disableButtons();return true;}"'; break; case 'nOnFocusMode': $value = $this->ViewState['TypeID'] == "" ? 1 : 2; break; case 'UseWYSIWYGFor': $value = array(); foreach ($this->product_type as $view_tag => $attr) { if ($attr['allow_html'] && $attr['visible']) { $value[] = $view_tag; } } $value = implode(', ', $value); break; case 'ImagesUploadErrorMessage': $value = $obj->getMessage("SETUP_WARNING_IMAGE_FOLDER_IS_NOT_WRITABLE", array("0" => modApiFunc("Catalog", "getImagesDir"))); break; case 'RequiredFieldText': $value = $obj->getMessage(new ActionMessage('REQUIRED_FIELD_LABEL')); break; case 'Breadcrumb': $obj =& $application->getInstance('Breadcrumb'); $value = $obj->output(false); break; case 'Local_ProductBookmarks': $value = getProductBookmarks('details', $this->prod_id, 'add'); break; case 'AutoGenSmallImageComment': $is_present_large_image = false; foreach ($this->_group['attr'] as $attr_info) { if ($attr_info['view_tag'] == 'LargeImage' and $attr_info['visible'] == 1) { $is_present_large_image = true; $pi_settings = modApiFunc('Product_Images', 'getSettings'); if ($pi_settings['AUTO_GEN_MAIN_SMALL_IMAGE'] == 'Y' and function_exists('gd_info')) { $value = getMsg('PI', 'COMMENT_AUTO_GEN_SMALL_IMAGE'); } } } break; case 'NoImagePath': $value = $imagesUrl . 'noimage.png'; break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'product') { $value = getKeyIgnoreCase($tag, $this->POST); } elseif ($entity == 'group') { $value = getKeyIgnoreCase($tag, $this->_group); } break; } return $value; }
function editar() { $this->obj->inicializar('articulos-editar', 'Editar Artículo'); $aid = $_GET['id']; $vid = $aid; $query = "SELECT * FROM `aRecurso_articulos` WHERE `id`='{$aid}'"; $res = mysql_query($query); $r = mysql_fetch_array($res); $tip = $this->obj->archivos->tipo($this->obj->archivos->nombre($r['id_archivo'])); $nom = $this->obj->archivos->nombre($r['id_archivo']); $tam = $this->obj->archivos->tamano($r['id_archivo']); $aut = $r['autores']; $tit = $r['titulo']; $ann = $r['anno']; $rev = $r['revista']; $lug = $r['lugar']; $vol = $r['volumen']; $num = $r['numero']; $pag = $r['paginas']; $url = $r['url']; $car = "carpeta"; //$r['carpeta']; $res = $r['resumen']; $this->asignar('imagen', $this->obj->archivos->vistaPrevia($aid)); $this->asignar('id', $aid); $this->asignar('aid', $vid); $this->asignar('tipo', $tip); $this->asignar('nombre', $nom); $this->asignar('tamano', $tam); $this->asignar('autores', $aut); $this->asignar('tituloa', $tit); $this->asignar('anno', $ann); if ($rev) { $this->asignar('revista', $rev); } if ($lug) { $this->asignar('lugar', $lug); } if ($vol) { $this->asignar('volumen', $vol); } if ($num) { $this->asignar('numero', $num); } if ($pag) { $this->asignar('paginas', $pag); } if ($url) { $this->asignar('url', $url); } if ($res) { $this->asignar('resumen', $res); } //******* $query = "SELECT * FROM `kControl_diccionario_etiquetas` WHERE `id_recurso`='{$aid}' AND `tipo_recurso`='1' "; $res = mysql_query($query); $etiqueta = ""; while ($r = mysql_fetch_array($res)) { if (getTagName($r['id_etiqueta']) != "") { $etiqueta .= getTagName($r['id_etiqueta']) . ","; } } $this->asignar('etiquetas', $etiqueta); //********* $this->carpeta = $car; $this->obj->sesion->exponer(); $this->exponer(); tengoPermiso('crear_recursos', @$_SESSION['perfil']) ? $this->asignar('crear_recursos', true) : ""; tengoPermiso('actualizar_recursos', @$_SESSION['perfil']) ? $this->asignar('actualizar_recursos', true) : ""; tengoPermiso('borrar_recursos', @$_SESSION['perfil']) ? $this->asignar('borrar_recursos', true) : ""; tengoPermiso('configuracion_perfil', @$_SESSION['perfil']) ? $this->asignar('configuracion_perfil', true) : ""; tengoPermiso('configuracion_grupos', @$_SESSION['perfil']) ? $this->asignar('configuracion_grupos', true) : ""; $this->obj->enviarPagina(); }
/** * @ describe the function ProductInfo->getTag. */ function getTag($tag) { global $application; $value = null; switch ($tag) { case 'Items': $value = $this->getAttributes(); break; case 'AttributeName': $value = $this->_attr['name']; break; case 'AttributeValue': if ($this->_attr['tag'] == 'TaxClass') { $value = prepareHTMLDisplay($this->_attr['value']); } else { $value = $this->_attr['value']; } break; case 'AttributeTag': $value = $this->_attr['tag']; break; case 'AttributeUnit': $value = $this->_attr['unit']; break; case 'AttributeImageURL': $value = $this->_attr['ImageURL']; break; case 'AttributeImageWidth': $value = $this->_attr['ImageWidth']; break; case 'AttributeImageHeight': $value = $this->_attr['ImageHeight']; break; case 'AttributeImage': $value = '<img src="' . $this->_attr['ImageURL'] . '" width="' . $this->_attr['ImageWidth'] . '" height="' . $this->_attr['ImageHeight'] . '">'; break; case 'Counter': $value = $this->_counter; break; case 'EditLink': $request = new Request(); $request->setView('Catalog_EditProduct'); $request->setAction('SetCurrentProduct'); $request->setKey('prod_id', $this->prod_id); $value = $request->getURL(); break; case 'Button': $request =& $application->getInstance('Request'); if ($request->getValueByKey('del_info') == "true") { $value = $this->TemplateFiller->fill("catalog/product_info/", "button_close.tpl.html", array()); } else { $value = $this->TemplateFiller->fill("catalog/product_info/", "button_edit.tpl.html", array()); } break; case 'Breadcrumb': $obj =& $application->getInstance('Breadcrumb'); $value = $obj->output(false); break; case 'Local_ProductBookmarks': $value = getProductBookmarks('details', $this->prod_id); break; case 'additionalJS': if (modApiFunc('Session', 'is_set', 'mustReloadParent')) { modApiFunc('Session', 'un_set', 'mustReloadParent'); $value = "if (window.opener && window.opener.document.ProductSearchForm && window.opener.document.ProductSearchForm.active && window.opener.document.ProductSearchForm.active.value == 'Y') window.opener.document.ProductSearchForm.submit(); else if (window.opener) window.opener.location.reload();\n"; } break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'product') { $value = getKeyIgnoreCase($tag, $this->product_info); } elseif ($entity == 'group') { $value = getKeyIgnoreCase($tag, $this->_group); } break; } return $value; }
/** * Processes tags in the templates for the given view. * * @return string tag value, if the tag is not processed. NULL otherwise. */ function getTag($tag) { $value = null; switch ($tag) { case 'Items': $value = $this->outputCheckoutNavigationBarList(); break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'step') { $value = getKeyIgnoreCase($tag, $this->_Step_Info); } break; } return $value; }
} $showFilter .= " (<a href=\"{$thisPage}?webApp=x\" title=\"Clear Web App Info Filter\" class=\"filter_control\">Del</a>)</span> "; } if (isset($_SESSION['filter']['userId'])) { if (isset($_SESSION['filter']['Not_userId']) and $_SESSION['filter']['Not_userId']) { $showFilter .= "| User ID: <span class=\"Negate\">" . headerprintnobr($_SESSION['filter']['userId']) . "</span>"; $showFilter .= "<span class=\"filter_control\" > (<a href=\"{$thisPage}?userId=" . headerprintnobr($_SESSION['filter']['userId']) . "&Not_userId=0\" title=\"Exclude this User ID from Filter\" class=\"filter_control\">Not</a>)"; } else { $showFilter .= "| User ID: " . headerprintnobr($_SESSION['filter']['userId']); $showFilter .= "<span class=\"filter_control\" > (<a href=\"{$thisPage}?userId=" . headerprintnobr($_SESSION['filter']['userId']) . "&Not_userId=1\" title=\"Exclude this User ID from Filter\" class=\"filter_control\">Not</a>)"; } $showFilter .= " (<a href=\"{$thisPage}?userId=x\" title=\"Clear User ID Filter\" class=\"filter_control\">Del</a>)</span> "; } // Tag if (isset($_SESSION['filter']['tag'])) { $tag_name = getTagName($_SESSION['filter']['tag']); if (isset($_SESSION['filter']['Not_tag']) and $_SESSION['filter']['Not_tag']) { $showFilter .= "| Tag: <span class=\"Negate\">{$tag_name}</span>"; $showFilter .= "<span class=\"filter_control\" > (<a href=\"{$thisPage}?tag=" . $_SESSION['filter']['tag'] . "&Not_tag=0\" title=\"Exclude the Tag from Filter\" class=\"filter_control\">Not</a>)"; } else { $showFilter .= "| Tag: {$tag_name}"; $showFilter .= "<span class=\"filter_control\" > (<a href=\"{$thisPage}?tag=" . $_SESSION['filter']['tag'] . "&Not_tag=1\" title=\"Exclude the Tag from Filter\" class=\"filter_control\">Not</a>)"; } $showFilter .= " (<a href=\"{$thisPage}?tag=x\" title=\"Clear Tag Filter\" class=\"filter_control\">Del</a>)</span> "; } if (isset($_SESSION['filter']['score'])) { if ($_SESSION['filter']['score_interval'] == "le") { $showFilter .= "| Score Total: ≤ " . $_SESSION['filter']['score']; $showFilter .= "<span class=\"filter_control\" > (<a href=\"{$thisPage}?score=" . $_SESSION['filter']['score'] . "&score_interval=ge\" title=\"Invert Score Total Filter\" class=\"filter_control\">Invert to ≥</a>)"; } else { $showFilter .= "| Score Total: ≥ " . $_SESSION['filter']['score'];
function editar() { $this->obj->inicializar('noticias-editar', 'Editar Noticia'); $this->obj->sesion->exponer(); $this->exponer(); $id = $_GET['id']; $query = "SELECT * FROM `aRecurso_noticias` WHERE `id`='{$id}'"; $res = mysql_query($query); $r = mysql_fetch_array($res); $this->asignar('titulon', $r['titulo']); $this->asignar('contenido', $r['contenido']); $this->asignar('id', $id); $query = "SELECT * FROM `kControl_diccionario_etiquetas` WHERE `id_recurso`='" . $id . "' AND `tipo_recurso`='5'"; $res = mysql_query($query); $etiqueta = ""; while ($r = mysql_fetch_array($res)) { if (getTagName($r['id_etiqueta']) != "") { $etiqueta .= getTagName($r['id_etiqueta']) . ","; } } $this->asignar('etiquetas', $etiqueta); tengoPermiso('crear_recursos', @$_SESSION['perfil']) ? $this->asignar('crear_recursos', true) : ""; tengoPermiso('actualizar_recursos', @$_SESSION['perfil']) ? $this->asignar('actualizar_recursos', true) : ""; tengoPermiso('borrar_recursos', @$_SESSION['perfil']) ? $this->asignar('borrar_recursos', true) : ""; tengoPermiso('configuracion_perfil', @$_SESSION['perfil']) ? $this->asignar('configuracion_perfil', true) : ""; tengoPermiso('configuracion_grupos', @$_SESSION['perfil']) ? $this->asignar('configuracion_grupos', true) : ""; $this->obj->enviarPagina(); }
function getTag($tag) { global $application; $value = null; $curr_id = modApiFunc("Localization", "getMainStoreCurrency"); switch ($tag) { case 'Local_Items': $value = $this->outputCartContent(); break; case 'Local_ProductOptionsSelected': $value = getOptionsCombination($this->_Cart_Item['Options'], 'Order', $this->order_mode_enabled); break; case 'Local_Subtotal': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "Subtotal", $curr_id)); break; case 'Local_GlobalDiscount': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "SubtotalGlobalDiscount", $curr_id)); break; case 'Local_PromoCodeDiscount': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "SubtotalPromoCodeDiscount", $curr_id)); break; case 'Local_QuantityDiscount': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "QuantityDiscount", $curr_id)); break; case 'Local_ShippingCost': case 'Local_TotalShippingAndHandlingCost': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "TotalShippingAndHandlingCost", $curr_id)); break; case 'Local_FreeHandlingForOrdersOver': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "FreeHandlingForOrdersOver", $curr_id)); break; case 'Local_PerItemShippingCostSum': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "PerItemShippingCostSum", $curr_id)); break; case 'Local_ShippingMethodCost': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "ShippingMethodCost", $curr_id)); break; case 'Local_FreeShippingForOrdersOver': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "FreeShippingForOrdersOver", $curr_id)); break; case 'Local_MinimumShippingCost': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "MinimumShippingCost", $curr_id)); break; case 'Local_PerOrderShippingFee': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "PerOrderShippingFee", $curr_id)); break; case 'Local_TotalShippingCharge': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "TotalShippingCharge", $curr_id)); break; case 'Local_ShippingMethodName': $shipping_module_id = modApiFunc("Checkout", "getChosenShippingModuleIdCZ"); if ($shipping_module_id === NULL) { // , return '---'; } $shipping_method_id = modApiFunc("Checkout", "getChosenShippingMethodIdCZ"); $shipping_module_info = modApiFunc("Checkout", "getShippingModuleInfo", $shipping_module_id); if ($shipping_module_info["GlobalUniqueShippingModuleID"] == "6F82BA03-C5B1-585B-CE2E-B8422A1A19F6") { $mRes =& $application->getInstance('MessageResources', "messages"); $value = $mRes->getMessage('ALL_SM_ARE_INACTIVE'); unset($mRes); } else { $ShippingMethodInfo = modApiFunc("Shipping_Cost_Calculator", "getCalculatedMethod", $shipping_module_info["APIClassName"], $shipping_method_id); $value = $ShippingMethodInfo['method_name']; } break; case 'Local_PerItemHandlingCostSum': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "PerItemHandlingCostSum", $curr_id)); break; case 'Local_PerOrderHandlingFee': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "PerOrderHandlingFee", $curr_id)); break; case 'Local_TotalHandlingCharge': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "TotalHandlingCharge", $curr_id)); break; case 'Local_Taxes': $value = $this->outputTax(); break; case 'Local_Total': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "Total", $curr_id)); break; case 'Local_GiftCertificatePrepaidAmount': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "TotalPrepaidByGC", $curr_id)); break; case 'Local_TotalToPay': $value = modApiFunc("Localization", "currency_format", modApiFunc("Checkout", "getOrderPrice", "TotalToPay", $curr_id)); break; case 'Local_SwatchColorSelected': $colname = $this->_Cart_Item['Colorname']; $value = ""; if (!($colname == "")) { $value = "<div style='clear:both;float:left; padding-left: 10px;'>Chosen colors : </div><div style='font-weight:normal;float: left;'> {$colname}</div>"; } break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'product' || $entity == 'unknown') { // " Subtotal", // . if (getKeyIgnoreCase($tag, $this->_Cart_Item)) { $value = getKeyIgnoreCase($tag, $this->_Cart_Item); } else { $value = isset($this->_Tax_Item) ? getKeyIgnoreCase($tag, $this->_Tax_Item) : null; if ($value == null && $entity == 'product') { $po = new CProductInfo($this->_Cart_Item['ID']); if ($tag == "infolink" && $this->_Cart_Item['TypeID'] == GC_PRODUCT_TYPE_ID) { $request = new Request(); $request->setView("GiftCertificate"); return $request->getURL(); } $value = $po->getProductTagValue($tag); } } } break; } return $value; }
/** * Processes tags in the templates for the given view. * * @return string tag value, if tag has been processed. NULL, otherwise. */ function getTag($tag) { $value = null; switch ($tag) { case 'Local_Items': $value = $this->outputCatalogNavigatorTree($this->cat_id); break; case 'Local_LevelIndent': $value = isset($this->_Subcategories["Local_LevelIndent"]) ? $this->_Subcategories["Local_LevelIndent"] : ""; break; case 'Local_Subcategories': $value = isset($this->_Subcategories["Local_Subcategories"]) ? $this->_Subcategories["Local_Subcategories"] : ""; break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'category' && is_object($this->_Current_Category)) { $value = $this->_Current_Category->getCategoryTagValue($tag); } break; } return $value; }
/** * Processes tags in the templates for the given view. * * @return string tag value, if tag has been processed. NULL, otherwise. */ function getTag($tag) { global $application; $value = null; switch ($tag) { case 'Local_ProductID': $value = $this->_ProductInfo['ID']; break; case 'Local_JSfuncProductFormSubmit': $value = "<script type=\"text/javascript\">" . "function ProductFormSubmit_" . $this->_ProductInfo['ID'] . "()" . "{" . " document.forms['ProductForm_" . $this->_ProductInfo['ID'] . "'].submit();" . "};" . "</script>"; break; case 'Local_ProductStockWarnings': if (!modApiFunc('Session', 'is_set', 'StockDiscardedBy')) { $value = ''; } else { $stock_discarded_by = modApiFunc('Session', 'get', 'StockDiscardedBy'); modApiFunc('Session', 'un_set', 'StockDiscardedBy'); $value = $stock_discarded_by; //cz_getMsg($stock_discarded_by); } break; case 'Local_ProductFormStart': $skin = modApiFunc('Look_Feel', 'getCurrentSkin'); if ($skin == 'digiCenter' || $skin == 'foodCourt' || $skin == 'flowers') { if (empty($this->_product_form_action)) { $this->_product_form_action = getpageurl('CartContent'); } $redirect = modApiFunc('Configuration', 'getValue', SYSCONFIG_STORE_SHOW_CART); $script = $redirect ? $this->_product_form_action : $_SERVER["PHP_SELF"]; $value = '<form action="' . $script . '" name="ProductForm_' . $this->_ProductInfo['ID'] . '" id="product_addtocart_form" method="post" enctype="multipart/form-data"> '; } else { if (empty($this->_product_form_action)) { $this->_product_form_action = getpageurl('CartContent'); } $redirect = modApiFunc('Configuration', 'getValue', SYSCONFIG_STORE_SHOW_CART); $script = $redirect ? $this->_product_form_action : $_SERVER["PHP_SELF"]; $value = '<form action="' . $script . '" name="ProductForm_' . $this->_ProductInfo['ID'] . '" id="ProductForm_' . $this->_ProductInfo['ID'] . '" method="post" enctype="multipart/form-data"> <input type="hidden" name="asc_action" value="AddToCart" /> <input type="hidden" name="prod_id" value="' . $this->_ProductInfo['ID'] . '" /> <script type="text/javascript"> function ProductFormSubmit_' . $this->_ProductInfo['ID'] . '() { document.forms[\'ProductForm_' . $this->_ProductInfo['ID'] . '\'].submit(); }; </script>'; } break; case 'Local_ProductFormEnd': $value = '</form>'; break; case 'Local_ProductAddToCart': $value = 'javascript: ProductFormSubmit_' . $this->_ProductInfo['ID'] . '();'; break; case 'ProductOptionsForm': $value = getOptionsChoice($this->_ProductInfo['ID']); break; case 'Local_FormQuantityFieldName': $value = 'quantity_in_cart'; break; case 'NextProductID': $value = $this->next_product_id; break; case 'PreviousProductID': $value = $this->previous_product_id; break; case 'Local_ProductQuantityOptions': $force_quantity = false; if (modApiFunc('Request', 'getValueByKey', 'presetCombination') != '') { list($type, $customer_id, $wl_id) = explode('_', modApiFunc('Request', 'getValueByKey', 'presetCombination')); if ($type == 'wl') { $wl_info = modApiFunc('Wishlist', 'getWishlistRecordCartData', $wl_id, $customer_id); if ($wl_info && @$wl_info['parent_entity'] == 'product' && @$wl_info['entity_id'] == $this->_ProductInfo['ID']) { $qty_in_cart = $wl_info['qty']; $force_quantity = true; } } } else { $qty_in_cart = modApiFunc("Cart", "getProductQuantity", $this->_ProductInfo['ID']); } $value = modApiFunc("Cart", "getProductQuantityOptions", $qty_in_cart, $this->_ProductInfo['ID'], false, false, $force_quantity); break; case 'Local_ProductSettingsJSON': $product_object = new CProductInfo($this->_ProductInfo['ID']); $options_settings = modApiFunc('Product_Options', 'getOptionsSettingsForEntity', 'product', $this->_ProductInfo['ID']); $settings = array('product_id' => (int) $this->_ProductInfo['ID'], 'sale_price' => (double) getValProductSalePrice(), 'list_price' => (double) getValProductListPrice(), 'currency_settings' => modApiFunc('Localization', 'getCurrencySettings'), 'aanic' => $options_settings['AANIC'], 'aanis' => $options_settings['AANIS'], 'labels' => array('comb_unavailable' => $options_settings['WRN_CI_CR'], 'inv_unavailable' => $options_settings['WRN_CI_INV'], 'comb_limit_stock' => $options_settings['WRN_CI_INV'], 'comb_out_of_stock' => $options_settings['WRN_CI_INV'])); $json = new Services_JSON(); $value = $json->encode($settings); break; case 'Local_ThumbnailSide': $pi_settings = modApiFunc('Product_Images', 'getSettings'); $value = $pi_settings['MAIN_IMAGE_SIDE']; break; case 'ProductColorSwatchImages': $value = getColorSwatchImages($this->_ProductInfo['ID']); break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'product') { //$value = getKeyIgnoreCase($tag, $this->_ProductInfo); // , default switch' . // , $this->_ProductInfo ( ), // getValProduct*, , // . . $product_object = new CProductInfo($this->_ProductInfo['ID']); $value = $product_object->getProductTagValue($tag); } break; } return $value; }
function getTag($tag, $arg_list = array()) { $value = null; switch ($tag) { case 'Local_Items': $value = $this->createCategoriesSheet(); break; case 'Local_CategoryBranch': $value = $this->content_one_row; break; case 'Local_CategoryLevel': $value = $this->category_level; break; case 'Local_CategoryProducts': $value = $this->category_products; break; case 'Local_WidthCol': $value = $this->width_col; break; case 'Local_TotalCol': $value = $this->total_cols; break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'category' && is_object($this->current_category)) { $value = $this->current_category->getCategoryTagValue($tag); } if ($entity == 'product' && is_object($this->current_product)) { $value = $this->current_product->getProductTagValue($tag); } break; } return $value; }
/** * Processes tags in the templates for the given view. * * @return string tag value, if tag has been processed. NULL, otherwise. */ function getTag($tag) { global $application; $value = null; switch ($tag) { case 'PaginatorLine': $obj =& $application->getInstance('PaginatorLine'); $value = $obj->output('Catalog_SearchResult_' . $this->search_id, "SearchResult"); break; case 'Local_Items': $value = $this->getHTMLProductsList(); break; case 'PaginatorRows': $obj =& $application->getInstance('PaginatorRows'); $value = $obj->output('Catalog_SearchResult_' . $this->search_id, "SearchResult"); break; case 'Local_ProductNumber': if (is_object($this->_Product_Info)) { $value = $this->_Product_Info->getProductTagValue('Local_ProductNumber'); } else { $value = ''; } break; case 'ProductName': if (is_object($this->_Product_Info)) { $value = $this->_Product_Info->getProductTagValue('Name'); $value = $this->highlightIndexWords($value); } break; case 'ProductShortDescription': if (is_object($this->_Product_Info)) { $value = $this->_Product_Info->getProductTagValue('ShortDescription'); $value = $this->cstring->mergeWhiteSpace($this->cstring->stripHTML($value)); $value = $this->highlightIndexWords($value); } break; case 'ProductDetailedDescription': if (is_object($this->_Product_Info)) { $value = $this->_Product_Info->getProductTagValue('DetailedDescription'); $value = $this->cstring->mergeWhiteSpace($this->cstring->stripHTML($value)); $value = $this->highlightIndexWords($value); } break; case 'ProductInfoLink': # return redefined tag value $value = $this->_Product_Info->getProductTagValue('ProductInfoLink'); break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'product' && is_object($this->_Product_Info)) { $value = $this->_Product_Info->getProductTagValue($tag); } break; } return $value; }
/** * Processes tags in the templates for the given view. * * @return string tag value, if tag has been processed. NULL, otherwise. */ function getTag($tag, $arg_list = array()) { global $application; $value = null; $Category_Descr =& $application->getInstance('CCategoryInfo', $this->_CatID); switch ($tag) { case 'Local_Items': $value = $this->getSubcategoriesList(); break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'category' && is_object($this->_Subcategory_Info)) { $value = $this->_Subcategory_Info->getCategoryTagValue($tag); } break; } return $value; }
function __info_tag_output($tag, $arg_list) { global $application, $zone; # . $view = $application->getLatestTag(); list($entity, $attr) = getTagName($tag); /* * empty($arg_list) , msg * . */ if ($view != null && is_callable(array($view, 'getTag')) && empty($arg_list)) { if (strtolower($tag) == 'viewclassname') { $alias = $application->getBlockOverride($view); echo strtolower($alias == null ? $view : $alias); return; } $view_obj =& $application->getInstance($view); $output = $view_obj->getTag($tag, $arg_list); if ($output !== null) { echo $output; return; } } if (empty($arg_list)) { # . , . $params = $application->getTemplateParameters(); $product_id = $params['product_id']; $category_id = $params['category_id']; $page_id = @$params['page_id']; } else { $product_id = $arg_list[0]; $category_id = $arg_list[0]; $page_id = $arg_list[0]; } $output = ""; switch ($entity) { case 'attribute': if (empty($arg_list) || !array_key_exists(0, $arg_list) || !array_key_exists(1, $arg_list)) { break; } $obj =& $application->getInstance('Catalog'); $attributeInfo = $obj->getAttributeInfo($arg_list[0], $arg_list[1]); $output = $attributeInfo[strtolower($attr)]; break; case 'productreviews': if ($product_id == -1) { break; } loadClass('CProductReviewInfo'); $prcrobj = new CProductReviewInfo($product_id); if ($prcrobj !== null) { $output = $prcrobj->getReviewTagValue($attr); } break; case 'cmspage': if (!$page_id) { // trying to get the page_id from the request $page_id = modApiFunc('Request', 'getValueByKey', 'page_id'); } loadClass('CCMSPageInfo'); $cmspageobj = new CCMSPageInfo($page_id); $output = $cmspageobj->getCMSPageTagValue($attr, $arg_list); break; case 'product': if ($product_id == -1) { break; } $prdobj = new CProductInfo($product_id); if ($prdobj !== null) { $output = $prdobj->getProductTagValue($attr); } break; case 'manufacturer': $mnf_id = __info_tag_output_find_tag_params($entity, $arg_list); $mnf_info = modApiFunc("Manufacturers", "getManufacturerInfo", $mnf_id); if ($mnf_id == PARAM_NOT_FOUND || $mnf_id == MANUFACTURER_NOT_DEFINED || $mnf_info === NULL) { $output = NULL; } else { $img_info = modApiFunc("Images", "getImageData", $mnf_info['manufacturer_image_id']); switch ($attr) { case 'id': $output = $mnf_info['manufacturer_id']; break; case 'name': $output = $mnf_info['manufacturer_name']; break; case 'url': $output = $mnf_info['manufacturer_site_url']; break; case 'description': $output = $mnf_info['manufacturer_descr']; break; case 'status': $output = $mnf_info['manufacturer_active'] == DB_TRUE ? getMsg('MNF', 'STATUS_ACTIVE') : getMsg('MNF', 'STATUS_INACTIVE'); break; case 'image': $output = $img_info['image_data'] === NULL ? "" : getimage_output_cz('mnf_image_' . rand(0, 32768), new image_obj($img_info['image_data']['image_id'])); break; case 'imagesrc': $output = $img_info['image_data'] === NULL || !isset($img_info['image_data']) ? "" : $img_info['image_data']['image_src']; break; case 'imagewidth': $output = $img_info['image_data'] === NULL || !isset($img_info['image_data']) ? "" : $img_info['image_data']['image_width']; break; case 'imageheight': $output = $img_info['image_data'] === NULL || !isset($img_info['image_data']) ? "" : $img_info['image_data']['image_height']; break; case 'imagealttext': $output = $img_info['image_data'] === NULL || !isset($img_info['image_data']) ? "" : $img_info['image_data']['image_alt_text']; break; case 'thumbnail': $output = $img_info['image_thumbnail_data'] === NULL || !isset($img_info['image_thumbnail_data']) ? "" : getimage_output_cz('mnf_image_' . rand(0, 32768), new image_obj($img_info['image_thumbnail_data']['image_id'])); break; case 'thumbnailsrc': $output = $img_info['image_thumbnail_data'] === NULL || !isset($img_info['image_thumbnail_data']) ? "" : $img_info['image_thumbnail_data']['image_src']; break; case 'thumbnailwidth': $output = $img_info['image_thumbnail_data'] === NULL || !isset($img_info['image_thumbnail_data']) ? "" : $img_info['image_thumbnail_data']['image_width']; break; case 'thumbnailheight': $output = $img_info['image_thumbnail_data'] === NULL || !isset($img_info['image_thumbnail_data']) ? "" : $img_info['image_thumbnail_data']['image_height']; break; case 'thumbnailalttext': $output = $img_info['image_thumbnail_data'] === NULL || !isset($img_info['image_thumbnail_data']) ? "" : $img_info['image_thumbnail_data']['image_alt_text']; break; } } break; case 'category': if ($category_id == -1) { break; } $catobj =& $application->getInstance('CCategoryInfo', $category_id); if ($catobj !== null) { $output = $catobj->getCategoryTagValue($attr); } break; case 'msg': $obj =& $application->getInstance('MessageResources'); $output = $obj->getMessage(new ActionMessage($arg_list)); break; case 'xmsg': $obj =& $application->getInstance('MessageResources', modApiFunc("Modules_Manager", "getResFileByShortName", $arg_list[0]), 'AdminZone', $arg_list[0]); array_shift($arg_list); $output = $obj->getMessage(new ActionMessage($arg_list)); break; case 'label': $obj =& $application->getInstance('MessageResources', "", 'CustomerZone', "CZ"); $output = $obj->getMessage(new ActionMessage($arg_list)); break; case 'hinttext': $obj =& $application->getInstance('Hint'); $output = $obj->getHintText($arg_list); break; case 'hintlink': $obj =& $application->getInstance('Hint'); $output = $obj->getHintLink($arg_list); break; case 'storeowner': $obj =& $application->getInstance('Configuration'); $output = $obj->getTagValue($tag); break; case 'pagehelplink': loadCoreFile('page_help_tutorial_links.php'); $obj =& $application->getInstance('HelpLinkCreator'); $output = $obj->getPageHelpLink($arg_list[0]); break; case 'videotutoriallink': loadCoreFile('page_help_tutorial_links.php'); $obj =& $application->getInstance('HelpLinkCreator'); $output = $obj->getTutorialLink($arg_list[0]); break; case 'shoppingcart': $obj =& $application->getInstance('Cart'); $output = $obj->getCartInfo($tag); break; case 'paypalproexpresscheckout': $output = ""; break; case 'paypalproukexpresscheckout': $output = ""; break; case 'pageurl': $req = new Request(); $req->setView($arg_list[0]); if (isset($arg_list[1]) and is_array($arg_list[1]) and !empty($arg_list[1])) { foreach ($arg_list[1] as $k => $v) { $req->setKey($k, $v); } } if ($arg_list[0] == 'ProductList') { if (isset($arg_list[1])) { $category_id = $arg_list[1]; } if (!$category_id) { $plf = $application->getInstance('CProductListFilter'); $category_id = $plf->getCurrentCatgoryId(); $req->setCategoryID($category_id); } } $output = $req->getURL(); break; case 'customer': if ($zone == 'CustomerZone') { $account_name = modApiFunc('Customer_Account', 'getCurrentSignedCustomer'); if ($account_name != null) { preg_match('/^customer(.+)/i', $tag, $m1); if (preg_match('/^(billing|shipping|orders)(.+)/i', $m1[1], $m2)) { $group = $m2[1]; $attr = $m2[2]; } else { if (in_array(strtolower($attr), array('id', 'status'))) { $group = 'base'; } else { $group = 'Customer'; } $attr = $m1[1]; } $obj =& $application->getInstance('CCustomerInfo', $account_name); if (strtolower($attr) == 'accountname') { $output = prepareHTMLDisplay($obj->getDisplayAccountName()); break; } if (strtolower($attr) == 'signouturl') { $r = new Request(); $r->setView(CURRENT_REQUEST_URL); $r->setAction('customer_sign_out'); $r->setKeyValList(modApiFunc('Request', 'getGETArray')); $output = $r->getURL(); break; } if (strtolower($group) != 'orders') { $attr_value = $obj->getPersonInfo($attr, $group); switch (strtolower($attr)) { case 'country': $output = modApiFunc('Location', 'getCountry', $attr_value); break; case 'state': if (modApiFunc('Location', 'getStateCode', $attr_value) != '') { $output = modApiFunc('Location', 'getState', $attr_value); } else { $output = prepareHTMLDisplay($attr_value); } break; default: $output = prepareHTMLDisplay($attr_value); break; } } else { $qstat = ORDER_STATUS_ALL; if (isset($arg_list[0]) and is_string($arg_list[0])) { if (defined('ORDER_STATUS_' . strtoupper($arg_list[0]))) { $qstat = constant('ORDER_STATUS_' . strtoupper($arg_list[0])); } } $filter = array('type' => 'quick', 'order_status' => $qstat); $obj->setOrdersHistoryFilter($filter); switch (strtolower($attr)) { case 'quantity': $output = $obj->getOrdersCount(); break; case 'totalamount': $output = modApiFunc('Localization', 'currency_format', $obj->getOrdersAmount()); break; case 'totalfullypaidamount': $output = modApiFunc('Localization', 'currency_format', $obj->getOrdersFullyPaidAmount()); break; } } } } break; case 'subscription': loadClass('Subscriptions'); switch ($attr) { case 'active': if ($zone == 'CustomerZone') { $signed_in = modApiFunc('Customer_Account', 'getCurrentSignedCustomer') !== null; $topics = modApiFunc('Subscriptions', 'getCustomerTopics', $signed_in); $output = sizeof($topics) > 0 ? 'TRUE' : 'FALSE'; } } break; case 'unknown': switch ($attr) { case 'currentlanguage': $output = modApiFunc('MultiLang', 'getLanguage'); break; case 'resourcelanguage': $output = modApiFunc('MultiLang', 'getResourceLanguage'); break; case 'defaultlanguage': $output = modApiFunc('MultiLang', 'getDefaultLanguage'); break; } break; } echo $output; }
<?php include 'sidebar.php'; $second_resource = sizeof($uri) > 0 ? array_shift($uri) : ""; $third_resource = sizeof($uri) > 0 ? array_shift($uri) : ""; $forth_resource = sizeof($uri) > 0 ? array_shift($uri) : ""; switch ($second_resource) { case "post": echo '<h2 class="page_title_withside">Only Showing One Post</h2>'; printPost(getPost($third_resource)); break; case "tag": echo '<h2 class="page_title_withside">Posts Tagged:</h2>'; echo '<h1 class="page_title_withside">' . getTagName($third_resource) . '</h1>'; foreach (getPostsByTag($third_resource) as $post) { printPost($post); } break; case "all": echo '<h1 class="page_title_withside">All Blog Posts</h1>'; echo '<div class="page_content">'; foreach (getPosts(0, getPostCount()) as $post) { printPostSummary($post); } echo '</div>'; break; default: $page = $second_resource === "" ? 1 : $second_resource; foreach (getPosts(($page - 1) * $blogPageSize, $blogPageSize) as $post) { printPost($post); }
/** * Processes tags in the templates for the given view. * * @return string tag value, if tag has been processed. NULL, otherwise. */ function getTag($tag, $arg_list = array()) { global $application; $value = null; switch ($tag) { case 'Local_Columns': $value = $this->columns; break; case 'Local_ProductNumberToDisplay': $value = count($this->__product_list_to_display); break; case 'Local_NextProductIdToDisplay': if ($this->__index >= count($this->__product_list_to_display)) { $value = null; } else { $value = $this->__product_list_to_display[$this->__index]['product_id']; $this->__index++; } $this->__current_product_id_to_display = $value; break; case 'Local_CurrentProductIdToDisplay': return $this->__current_product_id_to_display; break; case 'Local_ProductDetails': $pid = $this->getTag('Local_NextProductIdToDisplay'); if ($pid == null) { $value = ''; } else { $value = $this->renderProductInfo($pid); } break; # override the PaginatorRows tag behavior # override the PaginatorRows tag behavior case 'PaginatorLine': $value = getPaginatorLine($this->__paginator_name, 'ProductList', $this->__filter_hash); // break; # override the PaginatorRows tag behavior # override the PaginatorRows tag behavior case 'PaginatorDropdown': $value = getPaginatorDropdown($this->__paginator_name, 'ProductList'); break; case 'CategoryName': $catobj = new CCategoryInfo($this->__tag_settings->filter->category_id); $value = $catobj->getCategoryTagValue('name'); break; case 'ProductOptionsForm': $value = getOptionsChoice($this->_Product_Info->getProductTagValue('ID')); break; case 'RelatedProducts': $value = getRelatedProducts($this->_Product_Info->getProductTagValue('ID')); break; case 'Local_JSfuncProductFormSubmit': $value = "<script type=\"text/javascript\">" . "function ProductFormSubmit_" . $this->_Product_Info->getProductTagValue('ID') . "()" . "{" . " document.forms['ProductForm_" . $this->_Product_Info->getProductTagValue('ID') . "'].submit();" . "};" . "</script>"; break; case 'Local_ProductFormStart': $value = '<form action="cart.php" name="ProductForm_' . $this->_Product_Info->getProductTagValue('ID') . '" id="ProductForm_' . $this->_Product_Info->getProductTagValue('ID') . '" method="post"> <input type="hidden" name="asc_action" value="AddToCart" /> <input type="hidden" name="prod_id" value="' . $this->_Product_Info->getProductTagValue('ID') . '" /> <script type="text/javascript"> function ProductFormSubmit_' . $this->_Product_Info->getProductTagValue('ID') . '() { document.forms[\'ProductForm_' . $this->_Product_Info->getProductTagValue('ID') . '\'].submit(); }; </script>'; break; case 'Local_ProductFormEnd': $value = '</form>'; break; case 'Local_ProductAddToCart': $value = 'javascript: ProductFormSubmit_' . $this->_Product_Info->getProductTagValue('ID') . '();'; break; case 'ProductDetailedImages': $value = getProductDetailedImages($this->_Product_Info->getProductTagValue('ID')); break; case 'Local_FormQuantityFieldName': $value = 'quantity_in_cart'; break; case 'Local_ProductQuantityOptions': $qty_in_cart = modApiFunc("Cart", "getProductQuantity", $this->_Product_Info->getProductTagValue('ID')); $value = modApiFunc("Cart", "getProductQuantityOptions", $qty_in_cart, $this->_Product_Info->getProductTagValue('ID')); break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'product' && is_object($this->_Product_Info)) { $value = $this->_Product_Info->getProductTagValue($tag); } break; } return $value; }
/** * @ describe the function ManageOrders->. */ function getTag($tag) { global $application; $value = null; switch ($tag) { case 'SearchCustomers': $application->registerAttributes(array('CustomersSearchByField', 'CustomersSearchByFieldValue', 'CustomersSearchByLetter')); $value = $this->TemplateFiller->fill("checkout/customers/", "search.tpl.html", array()); break; case 'CustomersSearchByLetter': $value = "<td style='vertical-align: bottom'><a href='customers.php?asc_action=CustomersSearchByLetter&letter='>" . $this->MessageResources->getMessage('CUSTOMERS_SEARCH_ALL') . "</a></td><td>"; for ($i = 65; $i <= 90; $i++) { $letter = _byte_chr($i); if ($this->_filter['search_by'] == 'letter' && !empty($this->_filter['letter'])) { if (_byte_chr($i + 32) == $this->_filter['letter']) { $letter = "<span class='required'>" . _byte_chr($i) . "</span>"; } } $value .= "<a href='customers.php?asc_action=CustomersSearchByLetter&letter=" . _byte_chr($i + 32) . "'><b>" . $letter . "</b></a> "; } $value .= "</td>"; break; case 'CustomersSearchByField': $value = "<OPTION value='name'>" . $this->MessageResources->getMessage("CUSTOMERS_SEARCH_BY_NAME") . "</OPTION>"; if ($this->_filter['search_by'] == 'field' && !empty($this->_filter['field_name']) && $this->_filter['field_name'] == 'Email') { $value .= "<OPTION value='Email' selected>" . $this->MessageResources->getMessage("CUSTOMERS_SEARCH_BY_EMAIL") . "</OPTION>"; } else { $value .= "<OPTION value='Email'>" . $this->MessageResources->getMessage("CUSTOMERS_SEARCH_BY_EMAIL") . "</OPTION>"; } break; case 'CustomersSearchByFieldValue': $value = ''; if ($this->_filter['search_by'] == 'field' && !empty($this->_filter['field_name']) && !empty($this->_filter['field_value'])) { $value = $this->_filter['field_value']; } break; case 'SearchResults': if (count($this->_customers) == 0) { $value = $this->TemplateFiller->fill("checkout/customers/", "empty.tpl.html", array()); } else { $value = $this->TemplateFiller->fill("checkout/customers/", "results.tpl.html", array()); } break; case 'Items': $value = $this->getCustomers(); break; case 'CustomerId': $value = getKeyIgnoreCase('Id', $this->_customer); break; case 'ResultCount': $from = modApiFunc("Paginator", "getCurrentPaginatorOffset") + 1; $to = modApiFunc("Paginator", "getCurrentPaginatorOffset") + modApiFunc("Paginator", "getPaginatorRowsPerPage", "Checkout_Customers"); $total = modApiFunc("Paginator", "getCurrentPaginatorTotalRows"); if ($to > $total) { $to = $total; } if ($total <= modApiFunc("Paginator", "getPaginatorRowsPerPage", "Checkout_Customers")) { $value = $this->MessageResources->getMessage(new ActionMessage(array("CUSTOMERS_RESULTS_LESS_THEN_ROWS_PER_PAGE_FOUND", $total))); } else { $value = $this->MessageResources->getMessage(new ActionMessage(array("CUSTOMERS_RESULTS_MORE_THEN_ROWS_PER_PAGE_FOUND", $from, $to, $total))); } break; case 'CustomerTotalOrders': $value = getKeyIgnoreCase('TotalOrders', $this->_customer); break; case 'CustomerTotalAmount': $value = modApiFunc("Localization", "currency_format", getKeyIgnoreCase('TotalAmount', $this->_customer)); break; case 'PaginatorLine': $obj =& $application->getInstance($tag); $value = $obj->output("Checkout_Customers", "Customers"); break; # PaginatorRows # PaginatorRows case 'PaginatorRows': $obj =& $application->getInstance($tag); $value = $obj->output("Checkout_Customers", 'Customers', 'PGNTR_CUST_ITEMS'); break; case 'CustomerRegStatus': $customerInfo = getKeyIgnoreCase('Customer', $this->_customer); $email = getKeyIgnoreCase('Email', $customerInfo['attr']); if (modApiFunc('Customer_Account', 'doesAccountExists', $email['value'])) { $value = 'reg'; } else { $value = 'not-reg'; } break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'customer') { $customerInfo = getKeyIgnoreCase('Customer', $this->_customer); if (!($tagvalue = getKeyIgnoreCase($tag, $customerInfo['attr']))) { break; } $value = $tagvalue['value']; } break; } return $value; }
/** * @ describe the function OrderInfo->. */ function getTag($tag) { global $application; $value = null; switch ($tag) { case 'CustomerInfo': $value = $this->getCustomerInfo(); break; case 'BillingInfo': $value = $this->getBillingInfo(); break; case 'ShippingInfo': $value = $this->getShippingInfo(); break; case 'CreditCardInfo': $value = $this->getCreditCardInfo(); break; case 'Orders': $value = $this->getOrders(); break; case 'LastOrderId': $value = $this->_customer['ID']; break; case 'CHECKOUT_ORDER_INFO_REMOVE_ENCRYPTED_PERSON_INFO_MSG': case 'CHECKOUT_ORDER_INFO_REMOVE_ENCRYPTED_PERSON_INFO_CONFIRM_MSG': $value = $this->_msg[$tag]; break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'group') { $value = getKeyIgnoreCase($tag, $this->_group); } elseif ($entity == 'attribute') { $value = getKeyIgnoreCase($tag, $this->_attr); } elseif ($entity == 'order') { if (_ml_strpos($tag, 'price') === 0) { $tag = _ml_strtolower(_ml_substr($tag, _ml_strlen('price'))); if ($tag == 'total') { $value = $this->_order['Total']; } elseif ($tag == 'subtotal') { $value = $this->_order['Subtotal']; } else { $prices = getKeyIgnoreCase('price', $this->_order); $value = getKeyIgnoreCase($tag, $prices); } } elseif (_ml_strpos($tag, 'customer') === 0) { $tag = _ml_strtolower(_ml_substr($tag, _ml_strlen('customer'))); $customer = getKeyIgnoreCase('customer', $this->_order); $value = $customer['attr'][$tag]['value']; } else { $value = getKeyIgnoreCase($tag, $this->_order); } } break; } return $value; }
/** * Processes tags in the templates for the given view. * * @return string tag value, if tag has been processed. NULL, otherwise. */ function getTag($tag, $arg_list = array()) { global $application; $value = null; switch ($tag) { case 'Local_Items': $skin = modApiFunc('Look_Feel', 'getCurrentSkin'); if ($skin == 'digiCenter' || $skin == 'foodCourt' || $skin == 'flowers') { $value = $this->getProductsList(); } else { $value = $this->getDefaultProductsList(); } break; case 'Local_Columns': $value = $this->columns; break; case 'Local_ItemCount': $value = $this->getProductsListCount(); break; # override the PaginatorRows tag behavior # override the PaginatorRows tag behavior case 'PaginatorLine': $value = getPaginatorLine($this->getPagName(), $this->getBlockName(), $this->getPagParam()); break; # override the PaginatorRows tag behavior # override the PaginatorRows tag behavior case 'PaginatorDropdown': $value = getPaginatorDropdown($this->getPagName(), $this->getBlockName()); break; case 'CategoryName': $catobj =& $application->getInstance('CCategoryInfo', $this->pl_tag_settings->filter->category_id); $value = $catobj->getCategoryTagValue('name'); break; case 'ProductOptionsForm': $value = getOptionsChoice($this->_Product_Info->getProductTagValue('ID')); break; case 'RelatedProducts': $value = getRelatedProducts($this->_Product_Info->getProductTagValue('ID')); break; case 'Local_JSfuncProductFormSubmit': $value = "<script type=\"text/javascript\">" . "function ProductFormSubmit_" . $this->_Product_Info->getProductTagValue('ID') . "()" . "{" . " document.forms['ProductForm_" . $this->_Product_Info->getProductTagValue('ID') . "'].submit();" . "};" . "</script>"; break; case 'Local_ProductFormStart': if (empty($this->_product_form_action)) { $this->_product_form_action = getpageurl('CartContent'); } $buy_link = $this->_Product_Info->getProductTagValue('BuyLink'); $redirect = modApiFunc('Configuration', 'getValue', SYSCONFIG_STORE_SHOW_CART); $script = $redirect ? $this->_product_form_action : $_SERVER["PHP_SELF"]; $pid = $this->_Product_Info->getProductTagValue('ID'); $value = '<form action="' . $script . '" name="ProductForm_' . $pid . '" id="ProductForm_' . $pid . '" method="post"> <input type="hidden" name="asc_action" value="AddToCart" /> <input type="hidden" name="prod_id" value="' . $pid . '" /> <script type="text/javascript"> function ProductFormSubmit_' . $pid . '() { document.forms[\'ProductForm_' . $pid . '\'].submit(); }; </script>'; break; case 'Local_ProductFormEnd': $value = '</form>'; break; case 'Local_ProductAddToCart': $value = 'javascript: ProductFormSubmit_' . $this->_Product_Info->getProductTagValue('ID') . '();'; break; case 'ProductDetailedImages': $value = getProductDetailedImages($this->_Product_Info->getProductTagValue('ID')); break; case 'Local_FormQuantityFieldName': $value = 'quantity_in_cart'; break; case 'Local_ProductQuantityOptions': $qty_in_cart = modApiFunc("Cart", "getProductQuantity", $this->_Product_Info->getProductTagValue('ID')); $value = modApiFunc("Cart", "getProductQuantityOptions", $qty_in_cart, $this->_Product_Info->getProductTagValue('ID')); break; case 'Local_Thumbnail': break; case 'Local_ThumbnailSide': $pi_settings = modApiFunc('Product_Images', 'getSettings'); $value = $pi_settings['MAIN_IMAGE_SIDE']; break; case 'ProductColorSwatchImages': $value = getColorSwatchImages($this->_Product_Info->getProductTagValue('ID')); break; default: list($entity, $tag) = getTagName($tag); if ($entity == 'product' && is_object($this->_Product_Info)) { $value = $this->_Product_Info->getProductTagValue($tag); } break; } return $value; }