<?php /** @package catalog::admin::applications @author Loaded Commerce @copyright Copyright 2003-2014 Loaded Commerce, LLC @copyright Portions Copyright 2003 osCommerce @copyright Template built on Developr theme by DisplayInline http://themeforest.net/user/displayinline under Extended license @license https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt @version $Id: edit.php v1.0 2013-08-08 datazen $ */ if (is_numeric($_GET[$lC_Template->getModule()])) { $cInfo = lC_Categories_Admin::get($_GET[$lC_Template->getModule()]); } $assignedCategoryTree = new lC_CategoryTree(); $assignedCategoryTree->setBreadcrumbUsage(false); $assignedCategoryTree->setSpacerString(' ', 5); ?> <style scoped="scoped"> .qq-upload-drop-area { min-height: 100px; top: -200px; } .qq-upload-drop-area span { margin-top:-16px; } TD { padding: 5px 0 0 5px; } .legend { font-weight:bold; font-size: 1.1em; } </style> <!-- Main content --> <section role="main" id="main"> <hgroup id="main-title" class="thin"> <h1><?php echo isset($cInfo) && isset($cInfo[$lC_Language->getID()]['categories_name']) ? $cInfo[$lC_Language->getID()]['categories_name'] : $lC_Language->get('heading_title_new_category'); ?> </h1>
public static function formData($id = null, $parent = null) { global $lC_Language, $_module; $lC_Language->loadIniFile('categories.php'); $lC_CategoryTree = new lC_CategoryTree_Admin(); $result = array(); $categories_array = array('0' => $lC_Language->get('top_category')); foreach ($lC_CategoryTree->getArray() as $value) { $cid = explode('_', $value['id']); $count = count($cid); $cid = end($cid); $acArr = lC_Categories_Admin::getAllChildren($id); if ($cid != $id && !lC_Categories_Admin::in_array_r($cid, $acArr)) { $categories_array[$cid] = str_repeat(" ", $count - 1) . ' ' . $value['title']; } } $result['categoriesArray'] = $categories_array; if (isset($id) && is_numeric($id)) { $result['cData'] = lC_Categories_Admin::get($id, $lC_Language->getID()); $result['categoryImage'] = ''; $lC_ObjectInfo = new lC_ObjectInfo(lC_Categories_Admin::get($id)); if (!lc_empty($lC_ObjectInfo->get('categories_image'))) { $result['categoryImage'] = '<div><p>' . lc_image('../' . DIR_WS_IMAGES . 'categories/' . $lC_ObjectInfo->get('categories_image'), $lC_ObjectInfo->get('categories_name'), HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br />' . DIR_WS_CATALOG . 'images/categories/' . $lC_ObjectInfo->getProtected('categories_image') . '</p></div>'; } } $category_names = ''; foreach ($lC_Language->getAll() as $l) { if (isset($id) && is_numeric($id)) { $category_names .= '<span class="input" style="width:88%"><label for="categories_name[' . $l['id'] . ']" class="button silver-gradient glossy">' . $lC_Language->showImage($l['code']) . '</label>' . lc_draw_input_field('categories_name[' . $l['id'] . ']', $result['cData']['categories_name'], 'class="input-unstyled"') . '</span><br />'; } else { $category_names .= '<span class="input" style="width:88%"><label for="categories_name[' . $l['id'] . ']" class="button silver-gradient glossy">' . $lC_Language->showImage($l['code']) . '</label>' . lc_draw_input_field('categories_name[' . $l['id'] . ']', null, 'class="input-unstyled"') . '</span><br />'; } } $result['categoryNames'] = $category_names; $result['parentCategory'] = isset($parent) && $parent != null ? $parent : 0; return $result; }