Skip to content
Browse files

Signed-off-by: Marijan Greguric <marijan.greguric@gmail.com>

  • Loading branch information...
1 parent cb7ddc4 commit 2e0d14e0bf08227b753c73562bf5b7f01ebe62c4 @marijang marijang committed
View
4 .settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,4 @@
+#Wed Feb 08 19:39:26 CET 2012
+eclipse.preferences.version=1
+encoding//views/admin/attributes/form.php=UTF-8
+encoding/details.php=UTF-8
View
53 controllers/admin_attributes.php
@@ -193,6 +193,59 @@ public function delete($attributes_id)
endif;
redirect('admin/store/attributes');
}
+
+
+ public function add_category($ajax = FALSE)
+ {
+ $this->form_validation->set_rules($this->item_validation_rules);
+
+ if($this->form_validation->run()):
+
+ if($this->attributes_m->add_attribute($this->input->post())):
+
+ // ON SUCCESS
+ $this->session->set_flashdata('success', sprintf(lang('store:attributes:messages:success:add'), $this->input->post('name')));
+ redirect('admin/store/attributes');
+
+ else:
+
+ // ON ERROR
+ $this->session->set_flashdata(array('error'=> lang('store:attributes:messages:error:add')));
+ redirect('admin/store/attributes/add');
+
+ endif;
+
+ else:
+
+ foreach ($this->item_validation_rules AS $rule):
+
+ //$this->data->{$rule['field']} = $this->input->post($rule['field']);
+ $this->data->attribute->{$rule['field']} = $this->input->post($rule['field']);
+
+ endforeach;
+
+ if($ajax):
+
+ $wysiwyg = $this->load->view('fragments/wysiwyg', $this->data, TRUE);
+ $form = $this->load->view('admin/attributes/form', $this->data, TRUE);
+
+ echo $wysiwyg . $form;
+
+ else:
+
+ $this->template
+ ->title($this->module_details['name'], lang('store:attributes:title') . " - " . lang('store:attributes:title:add'))
+ ->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))
+ ->build('admin/attributes/form', $this->data);
+
+ endif;
+
+ endif;
+ }
+
+
+
+
}
/* End of file admin_attributes.php */
/* Location: ./store/controllers/admin_attributes.php */
View
13 details.php
@@ -31,7 +31,7 @@ public function info()
'backend' => TRUE,
'skip_xss' => TRUE,
'menu' => 'content',
- 'author' => 'Jaap Jolman - Kevin Meier - Rudolph Arthur Hernandez - Gary Hussey',
+ 'author' => 'Jaap Jolman - Kevin Meier - Rudolph Arthur Hernandez - Gary Hussey - Marijan Greguric',
'roles' => array(
'admin_store'
@@ -137,6 +137,17 @@ public function info()
'uri' => 'admin/store/attributes/add',
'class' => 'add'
)
+ ,
+ array(
+ 'name' => 'store:attributes:shortcut:add:category',
+ 'uri' => 'admin/store/attributes/add_category',
+ 'class' => 'add'
+ ),
+ array(
+ 'name' => 'store:attributes:shortcut:list:category',
+ 'uri' => 'admin/store/attributes/category',
+ 'class' => 'list'
+ )
)
)
)
View
2 language/english/attributes_lang.php
@@ -19,6 +19,8 @@
$lang['store:attributes:shortcut:list'] = 'List Attributes';
$lang['store:attributes:shortcut:add'] = 'Add Attributes';
+$lang['store:attributes:shortcut:list:category'] = 'List Category';
+$lang['store:attributes:shortcut:add:category'] = 'Add Category';
// TITLES ----------------------------------------------------------------------------------------
View
54 language/english/messages_lang.php
@@ -0,0 +1,54 @@
+<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
+
+/**
+ * This is a store module for PyroCMS
+ *
+ * @author pyrocms-store Team - Jaap Jolman - Kevin Meier - Rudolph Arthur Hernandez - Gary Hussey
+ * @website http://www.odin-ict.nl/
+ * @package pyrocms-store
+ * @subpackage Store Module
+**/
+
+/* =========================================== STORE =========================================== */
+
+// MESSAGES --------------------------------------------------------------------------------------
+
+//** SETTINGS **//
+$lang['store_messages_edit_success'] = 'Settings sucessfully edited';
+$lang['store_messages_edit_error'] = 'Settings editing failed';
+
+//** CATEGORIES **//
+$lang['store_messages_category_no_items'] = 'No Categories created';
+$lang['store_messages_category_success_create'] = 'Category sucessfully created';
+$lang['store_messages_category_success_edit'] = 'Category sucessfully edited';
+$lang['store_messages_category_success_delete'] = 'Category sucessfully deleted';
+$lang['store_messages_category_error_create'] = 'Category creation failed';
+$lang['store_messages_category_error_edit'] = 'Category editing failed';
+$lang['store_messages_category_error_delete'] = 'Category deletion failed';
+
+//** PRODUCTS **//
+$lang['store_messages_product_no_items'] = 'No Products created';
+$lang['store_messages_product_success_create'] = 'Product sucessfully created';
+$lang['store_messages_product_success_edit'] = 'Product sucessfully edited';
+$lang['store_messages_product_success_delete'] = 'Product sucessfully deleted';
+$lang['store_messages_product_error_create'] = 'Product creation failed';
+$lang['store_messages_product_error_edit'] = 'Product editing failed';
+$lang['store_messages_product_error_delete'] = 'Product deletion failed';
+
+//** ATTRIBUTES **//
+$lang['store_messages_attributes_no_items'] = 'No Attributes created';
+$lang['store_messages_attributes_success_create'] = 'Attribute sucessfully created';
+$lang['store_messages_attributes_success_edit'] = 'Attribute sucessfully edited';
+$lang['store_messages_attributes_success_delete'] = 'Attribute sucessfully deleted';
+$lang['store_messages_attributes_error_create'] = 'Attribute creation failed';
+$lang['store_messages_attributes_error_edit'] = 'Attribute editing failed';
+$lang['store_messages_attributes_error_delete'] = 'Attribute deletion failed';
+
+//** TAGS **//
+$lang['store_messages_tags_no_items'] = 'No Tags created';
+$lang['store_messages_tags_success_create'] = 'Tag sucessfully created';
+$lang['store_messages_tags_success_edit'] = 'Tag sucessfully edited';
+$lang['store_messages_tags_success_delete'] = 'Tag sucessfully deleted';
+$lang['store_messages_tags_error_create'] = 'Tag creation failed';
+$lang['store_messages_tags_error_edit'] = 'Tag editing failed';
+$lang['store_messages_tags_error_delete'] = 'Tag deletion failed';

0 comments on commit 2e0d14e

Please sign in to comment.
Something went wrong with that request. Please try again.