Пример #1
0
 private function addToolBar()
 {
     switch ($this->getLayout()) {
         case 'edit':
             JToolbarHelper::title(JText::_('COM_JEPROSHOP_PRODUCT_EDIT_PRODUCT_TITLE'), 'product-jeproshop');
             JToolbarHelper::apply('update', JText::_('COM_JEPROSHOP_UPDATE_LABEL'));
             /*JToolbarHelper::custom('association', 'association.png', 'association.png', JText::_('COM_JEPROSHOP_SAVE_ASSOCIATION_LABEL'), true);
               JToolbarHelper::custom('price', 'price.png', 'price.png', JText::_('COM_JEPROSHOP_SAVE_PRICE_LABEL'), true);
               JToolbarHelper::custom('declination', 'declination.png', 'declination.png', JText::_('COM_JEPROSHOP_SAVE_DECLINATION_LABEL'), true);
               JToolbarHelper::custom('quantities', 'quantities.png', 'quantities.png', JText::_('COM_JEPROSHOP_SAVE_QUANTITIES_LABEL'), true);
               JToolbarHelper::custom('images', '.png', 'images.png', JText::_('COM_JEPROSHOP_SAVE_IMAGES_LABEL'), true);
               JToolbarHelper::custom('feature', 'features.png', 'features.png', JText::_('COM_JEPROSHOP_SAVE_FEATURES_LABEL'), true);
               JToolbarHelper::custom('customization', 'customization.png', 'customization.png', JText::_('COM_JEPROSHOP_SAVE_CUSTOMIZATION_LABEL'), true);
               JToolbarHelper::custom('attachment', 'attachment.png', 'attachment.png', JText::_('COM_JEPROSHOP_SAVE_ATTACHMENT_LABEL'), true);
               JToolbarHelper::custom('shipping', 'shipping.png', 'shipping.png', JText::_('COM_JEPROSHOP_SAVE_SHIPPING_LABEL'), true);
               JToolbarHelper::custom('supplier', 'supplier.png', 'supplier.png', JText::_('COM_JEPROSHOP_SAVE_SUPPLIER_LABEL'), true);
               JToolbarHelper::custom('developer', 'product_developer.png', 'preview_product_1.png', JText::_('COM_JEPROSHOP_SAVE_DEVELOPER_LABEL'), true);
               JToolbarHelper::custom('preview', 'preview_product.png', 'preview_product_1.png', JText::_('COM_JEPROSHOP_PREVIEW_LABEL'), true); */
             JToolbarHelper::custom('sales', 'sales.png', 'sales.png', JText::_('COM_JEPROSHOP_SALES_LABEL'), true);
             JToolbarHelper::deleteList('delete');
             JToolbarHelper::cancel('cancel');
             break;
         case 'add':
             JToolbarHelper::title(JText::_('COM_JEPROSHOP_PRODUCT_ADD_PRODUCT_TITLE'), 'jeproshop-product');
             JToolbarHelper::apply('save');
             JToolbarHelper::save('save_close');
             JToolbarHelper::save2new('add2new');
             JToolbarHelper::cancel('cancel');
             break;
         default:
             JToolbarHelper::title(JText::_('COM_JEPROSHOP_PRODUCTS_LIST_TITLE'), 'product-jeproshop');
             JToolbarHelper::addNew('add');
             JToolbarHelper::editList('edit');
             JToolbarHelper::publish('publish');
             JToolbarHelper::unpublish('unpublish');
             JToolbarHelper::trash('delete');
             JToolbarHelper::preferences('com_jeproshop');
             JToolbarHelper::help('COM_JEPROSHOP_PRODUCT_MANAGER');
             $filter_product_type_options = '<option value="1" >' . JText::_('COM_JEPROSHOP_PRODUCT_SIMPLE_PRODUCT_LABEL') . '</option>';
             $filter_product_type_options .= '<option value="2" >' . JText::_('COM_JEPROSHOP_PRODUCT_PACKAGE_LABEL') . '</option>';
             $filter_product_type_options .= '<option value="3" >' . JText::_('COM_JEPROSHOP_PRODUCT_VIRTUAL_LABEL') . '</option>';
             JHtmlSidebar::addFilter(JText::_('COM_JEPROSHOP_SELECT_PRODUCT_TYPE_LABEL'), 'jform[filter_product_type]', $filter_product_type_options, FALSE);
             $filter_state_options = '<option value="1" >' . JText::_('COM_JEPROSHOP_FILTER_LABEL') . '</option>';
             JHtmlSidebar::addFilter(JText::_('COM_JEPROSHOP_SELECT_STATUS_LABEL'), 'jform[filter_state]', $filter_state_options, FALSE);
             $categories = JeproshopCategoryModelCategory::getCategories();
             $filter_category_options = '';
             foreach ($categories as $category) {
                 $filter_category_options .= '<option value="' . $category->category_id . '" >' . ucfirst($category->name) . '</option>';
             }
             JHtmlSidebar::addFilter(JText::_('COM_JEPROSHOP_SELECT_CATEGORY_LABEL'), 'jform[filter_category]', $filter_category_options, FALSE);
             $manufacturers = JeproshopManufacturerModelManufacturer::getManufacturers();
             $filter_manufacturers_options = '';
             foreach ($manufacturers as $manufacturer) {
                 $filter_manufacturers_options .= '<option value="' . (int) $manufacturer->manufacturer_id . '" >' . ucfirst($manufacturer->name) . '</option>';
             }
             JHtmlSidebar::addFilter(JText::_('COM_JEPROSHOP_SELECT_MANUFACTURER_LABEL'), 'jform[filter_manufacturer]', $filter_manufacturers_options, FALSE);
             $suppliers = JeproshopSupplierModelSupplier::getSuppliers();
             $filter_suppliers_options = '';
             foreach ($suppliers as $supplier) {
                 $filter_suppliers_options .= '<option value="' . (int) $supplier->supplier_id . '" >' . ucfirst($supplier->name) . '</option>';
             }
             JHtmlSidebar::addFilter(JText::_('COM_JEPROSHOP_SELECT_SUPPLIER_LABEL'), 'jform[filter_supplier]', $filter_suppliers_options, FALSE);
             break;
     }
     JHtmlSidebar::addEntry(JText::_('COM_JEPROSHOP_DASHBOARD_LABEL'), 'index.php?option=com_jeproshop');
     JHtmlSidebar::addEntry(JText::_('COM_JEPROSHOP_CATALOG_LABEL'), 'index.php?option=com_jeproshop&task=catalog', true);
     JHtmlSidebar::addEntry(JText::_('COM_JEPROSHOP_ORDERS_LABEL'), 'index.php?option=com_jeproshop&task=orders');
     JHtmlSidebar::addEntry(JText::_('COM_JEPROSHOP_CUSTOMERS_LABEL'), 'index.php?option=com_jeproshop&task=customers');
     JHtmlSidebar::addEntry(JText::_('COM_JEPROSHOP_PRICE_RULES_LABEL'), 'index.php?option=com_jeproshop&task=price_rules');
     JHtmlSidebar::addEntry(JText::_('COM_JEPROSHOP_SHIPPING_LABEL'), 'index.php?option=com_jeproshop&task=shipping');
     JHtmlSidebar::addEntry(JText::_('COM_JEPROSHOP_LOCALIZATION_LABEL'), 'index.php?option=com_jeproshop&task=localization');
     JHtmlSidebar::addEntry(JText::_('COM_JEPROSHOP_SETTINGS_LABEL'), 'index.php?option=com_jeproshop&task=settings');
     JHtmlSidebar::addEntry(JText::_('COM_JEPROSHOP_ADMINISTRATION_LABEL'), 'index.php?option=com_jeproshop&task=administration');
     JHtmlSidebar::addEntry(JText::_('COM_JEPROSHOP_STATS_LABEL'), 'index.php?option=com_jeproshop&task=stats');
 }