/application/modules/geocontexter/controllers/ItemEditController.php
PHP | 1030 lines | 694 code | 203 blank | 133 comment | 81 complexity | 6161d1cd5d3f861966a2d1cfad8ee593 MD5 | raw file
- <?php
- /**
- * GeoContexter
- * @link http://code.google.com/p/geocontexter/
- * @package GeoContexter
- */
- /**
- * Edit list item
- *
- * @package GeoContexter
- * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
- * @author Armand Turpel <geocontexter@gmail.com>
- * @version $Rev: 828 $ / $LastChangedDate: 2011-02-27 10:30:28 +0100 (Sun, 27 Feb 2011) $ / $Author: armand.turpel $
- */
- class Geocontexter_ItemEditController extends Mozend_Controller_Action_AbstractAdmin
- {
- public function preDispatch()
- {
- $this->session = Zend_Registry::get('session');
- // set view. we keep allways the index view
- //
- $this->_helper->viewRenderer->setScriptAction('index');
- $this->id_list = $this->request->getParam('id_list');
- $this->id_item = $this->request->getParam('id_item');
- if((null === $this->id_item) || (0 == $this->id_item))
- {
- return $this->error( '0 or no id_item request parameter defined.', __file__, __line__ );
- }
- if((null === $this->id_list) || (0 == $this->id_list))
- {
- return $this->error( '0 or no id_list request parameter defined.', __file__, __line__ );
- }
- // fetch the active tab number for jquery ui tabs
- //
- $tab_number = $this->request->getParam('tab_number');
- if(null !== $tab_number)
- {
- $this->view->tab_number = (int)$tab_number;
- }
- else
- {
- $this->view->tab_number = 0;
- }
- $this->view->partialData['active_page'] = 'edit_item';
- $this->view->partialData['id_item'] = $this->id_item;
- $this->view->partialData['id_list'] = $this->id_list;
- $this->view->id_list = $this->id_list;
- $this->view->item_branch_result = array();
- $this->view->attribute_groups = array();
- $this->view->lists_result = array();
- $this->view->lists_childs_result = array();
- $this->view->item_result = array();
- $this->view->attribute_id_group = 0;
- $this->view->item_name = '';
- $this->view->item_description = '';
- $this->view->item_id_status = 100;
- $this->view->item_lang = 'en';
- $this->view->tabindex_after_attributes = 8;
- $this->view->error = array();
- $this->view->result = array();
- }
- public function indexAction()
- {
- // should we move an item list order
- //
- $this->move_item_list_order();
- $this->move_image_order();
- $this->move_file_order();
- $this->init_data();
- $this->delete_image();
- $this->delete_file();
- }
- /**
- * Delete item image
- *
- */
- public function delete_image()
- {
- // fetch vars to move attributes order up or down
- //
- $id_image = $this->request->getParam('deleteImage');
- if(null !== $id_image)
- {
- $image = new Geocontexter_Model_ItemImageDelete;
- $params = array('id_image' => $id_image,
- 'files_folder' => $this->view->item_result['files_folder']);
- $result = $image->delete( $params );
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- $this->view->error[] = 'Couldnt delete image';
- $this->view->headTitle('Couldnt delete image: ', 'PREPEND');
- $this->view->tab_number = 5;
- }
- else
- {
- $this->_redirect($this->view->adminAreaToken .
- '/geocontexter/item-edit/index/id_item/'.$this->id_item.'/id_list/'.$this->id_list.'/tab_number/' . $this->view->tab_number);
- }
- }
- }
- /**
- * Move order of an item image
- *
- */
- public function move_image_order()
- {
- // fetch vars to move attributes order up or down
- //
- $move_image_up = $this->request->getParam('imageMoveUp');
- $move_image_down = $this->request->getParam('imageMoveDown');
- $id_item = $this->request->getParam('id_item');
- if(null !== $move_image_up)
- {
- if(null === $id_item)
- {
- return $this->error( 'no id_item request parameter defined.', __file__, __line__ );
- }
- $image_order = new Geocontexter_Model_ItemImageMoveOrder;
- $result = $image_order->moveUp(array('id_item' => $id_item,
- 'id_image' => $move_image_up));
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->headTitle('Moved image up: ', 'PREPEND');
- }
- }
- if(null !== $move_image_down)
- {
- if(null === $id_item)
- {
- return $this->error( 'no id_item request parameter defined.', __file__, __line__ );
- }
- $image_order = new Geocontexter_Model_ItemImageMoveOrder;
- $result = $image_order->moveDown(array('id_item' => $id_item,
- 'id_image' => $move_image_down));
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->headTitle('Moved image down: ', 'PREPEND');
- }
- }
- }
- /**
- * Delete item file
- *
- */
- public function delete_file()
- {
- // fetch vars to move attributes order up or down
- //
- $id_file = $this->request->getParam('deleteFile');
- if(null !== $id_file)
- {
- $file = new Geocontexter_Model_ItemFileDelete;
- $params = array('id_file' => $id_file,
- 'files_folder' => $this->view->item_result['files_folder']);
- $result = $file->delete( $params );
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- $this->view->error[] = 'Couldnt delete image';
- $this->view->headTitle('Couldnt delete image: ', 'PREPEND');
- $this->view->tab_number = 6;
- }
- else
- {
- $this->_redirect($this->view->adminAreaToken .
- '/geocontexter/item-edit/index/id_item/'.$this->id_item.'/id_list/'.$this->id_list.'/tab_number/' . $this->view->tab_number);
- }
- }
- }
- /**
- * Move order of an item file
- *
- */
- public function move_file_order()
- {
- // fetch vars to move file order up or down
- //
- $move_file_up = $this->request->getParam('fileMoveUp');
- $move_file_down = $this->request->getParam('fileMoveDown');
- $id_item = $this->request->getParam('id_item');
- if(null !== $move_file_up)
- {
- if(null === $id_item)
- {
- return $this->error( 'no id_item request parameter defined.', __file__, __line__ );
- }
- $file_order = new Geocontexter_Model_ItemFileMoveOrder;
- $result = $file_order->moveUp(array('id_item' => $id_item,
- 'id_file' => $move_file_up));
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->headTitle('Moved file up: ', 'PREPEND');
- }
- }
- if(null !== $move_file_down)
- {
- if(null === $id_item)
- {
- return $this->error( 'no id_item request parameter defined.', __file__, __line__ );
- }
- $file_order = new Geocontexter_Model_ItemFileMoveOrder;
- $result = $file_order->moveDown(array('id_item' => $id_item,
- 'id_file' => $move_file_down));
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->headTitle('Moved file down: ', 'PREPEND');
- }
- }
- }
- /**
- * Move order of an item list
- *
- */
- public function move_item_list_order()
- {
- // fetch vars to move attributes order up or down
- //
- $move_list_up = $this->request->getParam('moveUp');
- $move_list_down = $this->request->getParam('moveDown');
- $id_list_item = $this->request->getParam('id_list_item');
- $id_item = $this->request->getParam('id_item');
- if(null !== $move_list_up)
- {
- if(null === $id_item)
- {
- return $this->error( 'no id_item request parameter defined.', __file__, __line__ );
- }
- if(null === $id_list_item)
- {
- return $this->error( 'no id_list_item request parameter defined.', __file__, __line__ );
- }
- $list_order = new Geocontexter_Model_ListItemMoveOrder;
- $result = $list_order->moveUp(array('id_item' => $id_item,
- 'id_list_item' => $id_list_item));
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->headTitle('Moved list up of item: ', 'PREPEND');
- }
- }
- if(null !== $move_list_down)
- {
- if(null === $id_item)
- {
- return $this->error( 'no id_item request parameter defined.', __file__, __line__ );
- }
- if(null === $id_list_item)
- {
- return $this->error( 'no id_list_item request parameter defined.', __file__, __line__ );
- }
- $list_order = new Geocontexter_Model_ListItemMoveOrder;
- $result = $list_order->moveDown(array('id_item' => $id_item,
- 'id_list_item' => $id_list_item));
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->headTitle('Moved list down of item: ', 'PREPEND');
- }
- }
- }
- /**
- * update item data
- */
- public function updateAction()
- {
- $save = $this->request->getPost('save');
- // check on cancel action
- //
- $cancel = $this->request->getPost('cancel');
- if($cancel !== null)
- {
- $this->_redirect($this->view->adminAreaToken .
- '/geocontexter/list/index/id_list/' . $this->id_list);
- }
- $this->init_data();
- $params = array();
- $this->view->error = array();
- // check if upload image action
- //
- if(isset($_FILES['item_image']['name']) && !empty($_FILES['item_image']['name']))
- {
- // check if a files folder entry for the current item exists
- //
- if(empty($this->view->item_result['files_folder']))
- {
- $params['data']['files_folder'] = $data_folder_name = md5(uniqid($this->view->item_result['id_item'], true));
- }
- else
- {
- $data_folder_name = $this->view->item_result['files_folder'];
- }
- $image_file = new Geocontexter_Model_ImageUpload;
- $upload_params = array('post_name' => 'item_image',
- 'data_folder' => DATA_PATH . '/gc_item/' . $data_folder_name);
- $image_result = $image_file->upload( $upload_params );
- if($image_result instanceof Mozend_ModelError)
- {
- $this->error( $image_result->getErrorString(), __file__, __line__, true );
- // assign view error
- //
- $__error = $image_result->getErrorArray();
- foreach($__error as $key => $val)
- {
- if(is_array($val))
- {
- foreach($val as $err)
- {
- $this->view->error[] = $err;
- }
- }
- else
- {
- $this->view->error[] = $val;
- }
- }
- $save = false;
- }
- else
- {
- // add item image entry in geocontexter.gc_item_image
- //
- $image_params = array('id_item' => $this->view->item_result['id_item'],
- 'file_mime' => $image_result['type'],
- 'file_name' => $image_result['name'],
- 'file_size' => $image_result['size'],
- 'file_width' => $image_result['image_width'],
- 'file_height' => $image_result['image_height']
- );
- $image = new Geocontexter_Model_ItemImageAdd();
- $result = $image->add($image_params);
- if($result instanceof Mozend_ModelError)
- {
- $image_file->removeFile();
- $this->view->error[] = $result->getErrorArray();
- return $this->error( $result->getErrorString(), __file__, __line__, true );
- }
- $save = true;
- }
- $this->view->tab_number = 5;
- }
- else if(isset($_FILES['item_file']['name']) && !empty($_FILES['item_file']['name']))
- {
- // check if a files folder entry for the current item exists
- //
- if(empty($this->view->item_result['files_folder']))
- {
- $params['data']['files_folder'] = $data_folder_name = md5(uniqid($this->view->item_result['id_item'], true));
- }
- else
- {
- $data_folder_name = $this->view->item_result['files_folder'];
- }
- $file_file = new Geocontexter_Model_FileUpload;
- $upload_params = array('post_name' => 'item_file',
- 'data_folder' => DATA_PATH . '/gc_item/' . $data_folder_name);
- $file_result = $file_file->upload( $upload_params );
- if($file_result instanceof Mozend_ModelError)
- {
- $this->error( $file_result->getErrorString(), __file__, __line__, true );
- // assign view error
- //
- $__error = $file_result->getErrorArray();
- foreach($__error as $key => $val)
- {
- if(is_array($val))
- {
- foreach($val as $err)
- {
- $this->view->error[] = $err;
- }
- }
- else
- {
- $this->view->error[] = $val;
- }
- }
- $save = false;
- }
- else
- {
- // add item image entry in geocontexter.gc_item_file
- //
- $file_params = array('id_item' => $this->view->item_result['id_item'],
- 'title' => '',
- 'description' => '',
- 'file_mime' => $file_result['type'],
- 'file_name' => $file_result['name'],
- 'file_size' => $file_result['size']
- );
- $file = new Geocontexter_Model_ItemFileAdd();
- $result = $file->add($file_params);
- if($result instanceof Mozend_ModelError)
- {
- $file_file->removeFile();
- $this->view->error[] = $result->getErrorArray();
- return $this->error( $result->getErrorString(), __file__, __line__, true );
- }
- $save = true;
- }
- $this->view->tab_number = 6;
- }
- $attribute_id_group = $this->request->getPost('id_attribute_group');
- // fetch addditional attributes values if set
- //
- if($attribute_id_group !== null)
- {
- $this->view->attribute_id_group = $attribute_id_group;
- $attributes = new Geocontexter_Model_AttributeJsonEncode;
- $serialized_attributes = $attributes->encode( $attribute_id_group, $this->request->getPost() );
- if($serialized_attributes instanceof Mozend_ModelError)
- {
- return $this->error( $serialized_attributes->getErrorString(), __file__, __line__ );
- }
- else
- {
- $params['data']['attribute_value'] = $serialized_attributes;
- $params['data']['id_attribute_group'] = $attribute_id_group;
- $this->view->additionalAttributes['id_attribute_group'] = $attribute_id_group;
- $this->view->additionalAttributes['tabindex'] = 7;
- // get tabindex after the additional attribute fields
- //
- $this->view->tabindex_after_attributes += $attributes->numAttributes - 1;
- $attributes_values = new Geocontexter_Model_AttributeJsonDecode;
- $this->view->additionalAttributes['attributes'] = $attributes_values->decode( $serialized_attributes,
- $attribute_id_group );
- }
- }
- $params['id_item'] = $this->id_item;
- $remove_item_list = $this->request->getPost('delete_id_list');
- if(($remove_item_list !== null) && is_array($remove_item_list))
- {
- $params['remove_item_list'] = $remove_item_list;
- }
- $this->view->result['title'] =
- $params['data']['title'] = $this->request->getPost('item_name');
- $this->view->result['description'] =
- $params['data']['description'] = $this->request->getPost('item_description');
- $this->view->result['id_status'] =
- $params['data']['id_status'] = $this->request->getPost('item_id_status');
- $this->view->result['lang'] =
- $params['data']['lang'] = $this->request->getPost('item_lang');
- $preferred_list = $this->request->getPost('preferred_id_list');
- if(null !== $preferred_list)
- {
- $params['preferred_list'] = $preferred_list;
- }
- $remove_synonym_of = trim($this->request->getPost('remove_synonym_of'));
- if(!empty($remove_synonym_of))
- {
- $params['data']['synonym_of'] = null;
- }
- $delete_id_keyword = $this->request->getPost('delete_id_keyword');
- if(($delete_id_keyword !== null) && (count($delete_id_keyword) > 0))
- {
- $params['remove_id_keyword'] = $delete_id_keyword;
- }
- $delete_list_id_keyword = $this->request->getPost('delete_item_list_id_keyword');
- if(($delete_list_id_keyword !== null) && (count($delete_list_id_keyword) > 0))
- {
- $params['remove_list_id_keyword'] = $delete_list_id_keyword;
- $params['id_list_item'] = $this->item_list['id_list_item'];
- }
- if(empty($params['data']['title']))
- {
- $this->view->error[] = 'Item name is empty';
- $this->view->headTitle('Error: Item name field is empty', 'PREPEND');
- }
- if(count($this->view->error) > 0)
- {
- return;
- }
- $this->update_images();
- $this->update_files();
- // add item attribute
- //
- $item = new Geocontexter_Model_ItemUpdate;
- $result = $item->update( $params );
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- }
- else if($save === null)
- {
- $this->_redirect($this->view->adminAreaToken .
- '/geocontexter/list/index/id_list/' . $this->id_list);
- }
- else
- {
- $this->_redirect($this->view->adminAreaToken .
- '/geocontexter/item-edit/index/id_item/'.$this->id_item.'/id_list/'.$this->id_list.'/tab_number/' . $this->view->tab_number);
- }
- }
- /**
- * update image
- *
- */
- private function update_images()
- {
- $id_image = $this->request->getPost('id_image');
- $image_title = $this->request->getPost('image_title');
- $image_description = $this->request->getPost('image_description');
- $x = 0;
- $item_image = new Geocontexter_Model_ItemImageUpdate;
- foreach($image_title as $title)
- {
- $params = array('id_image' => $id_image[$x],
- 'data' => array('title' => strip_tags($title),
- 'description' => strip_tags($image_description[$x])));
- $result = $item_image->update( $params );
- if($result instanceof Mozend_ModelError)
- {
- $this->error( $result->getErrorString(), __file__, __line__, true );
- $this->view->error[] = 'error updating image';
- }
- $x++;
- }
- }
- /**
- * update files
- *
- */
- private function update_files()
- {
- $id_file = $this->request->getPost('id_file');
- $file_title = $this->request->getPost('file_title');
- $file_description = $this->request->getPost('file_description');
- $x = 0;
- $item_file = new Geocontexter_Model_ItemFileUpdate;
- foreach($file_title as $title)
- {
- $params = array('id_file' => $id_file[$x],
- 'data' => array('title' => strip_tags($title),
- 'description' => strip_tags($file_description[$x])));
- $result = $item_file->update( $params );
- if($result instanceof Mozend_ModelError)
- {
- $this->error( $result->getErrorString(), __file__, __line__, true );
- $this->view->error[] = 'error updating file';
- }
- $x++;
- }
- }
- /**
- * get item synonym
- *
- * @param bigint $synonym_of
- * @return array
- */
- private function get_item_synonym_of( $synonym_of )
- {
- $synonym_result = array();
- if(!empty($synonym_of))
- {
- $synonym_item = new Geocontexter_Model_ListGetItemRelated;
- $params = array('id_item' => $synonym_of,
- 'order_by_preferred_order' => true);
- $synonym_result = $synonym_item->get( $params );
- if($synonym_result instanceof Mozend_ModelError)
- {
- return $this->error( $synonym_result->getErrorString(), __file__, __line__ );
- }
- }
- return $synonym_result;
- }
- private function init_data()
- {
- $item = new Geocontexter_Model_ItemGet;
- $params = array('id_item' => $this->id_item,
- 'default_display' => 0,
- 'system_serial' => true);
- $item_result = $item->get( $params );
- if($item_result instanceof Mozend_ModelError)
- {
- return $this->error( $item_result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->item_result = $item_result;
- // assign item attributes
- //
- if($item_result['id_attribute_group'] != null)
- {
- $attributes_values = new Geocontexter_Model_AttributeJsonDecode;
- // we pass this array to the partial view helper "_additional_attributes.phtml"
- //
- $this->view->additionalAttributes = array();
- $this->view->additionalAttributes['attributes'] = $attributes_values->decode( $item_result['attribute_value'],
- $item_result['id_attribute_group'] );
- $this->view->additionalAttributes['id_attribute_group'] = $item_result['id_attribute_group'];
- $this->view->additionalAttributes['tabindex'] = 7;
- // get tabindex after the aaditional attribute fields
- //
- $this->view->tabindex_after_attributes += count($this->view->additionalAttributes['attributes']) - 1;
- }
- }
- // fetch the synonym of the requested item
- //
- $this->view->synonym_result = $this->get_item_synonym_of( $item_result['synonym_of'] );
- // get item images
- //
- $item_images = new Geocontexter_Model_ItemImageGetAll;
- $params = array('id_item' => $this->id_item);
- $images = $item_images->get( $params );
- if($images instanceof Mozend_ModelError)
- {
- return $this->error( $images->getErrorString(), __file__, __line__ );
- }
- $this->view->item_images = $images;
- // get item files
- //
- $item_files = new Geocontexter_Model_ItemFileGetAll;
- $params = array('id_item' => $this->id_item);
- $files = $item_files->get( $params );
- if($files instanceof Mozend_ModelError)
- {
- return $this->error( $files->getErrorString(), __file__, __line__ );
- }
- $this->view->item_files = $files;
- // get item lists
- //
- $lists = new Geocontexter_Model_ListGetItemRelated;
- $params = array('id_item' => $this->id_item,
- 'order_by_preferred_order' => true,
- 'system_serial' => true);
- $result = $lists->get( $params );
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->lists_result = $result;
- }
- // get availaible languages
- //
- $languages = new Geocontexter_Model_LanguagesGet;
- // optional
- $params = array('enable' => 'true');
- $lang_result = $languages->get( $params );
- if($lang_result instanceof Mozend_ModelError)
- {
- return $this->error( $lang_result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->languages = $lang_result;
- }
- // get all list related attribute groups
- //
- $attribute_groups = new Geocontexter_Model_AttributeGroupsGet;
- $params = array('id_table' => 3);
- $result = $attribute_groups->get( $params );
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->attribute_groups = $result;
- }
- // get current item list
- //
- $list = new Geocontexter_Model_ItemListGet;
- $params = array('id_list' => $this->id_list,
- 'id_item' => $this->id_item);
- $this->item_list = $list->get( $params );
- if($this->item_list instanceof Mozend_ModelError)
- {
- return $this->error( $this->item_list->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->list_result = $this->item_list;
- }
- $item_childs = new Geocontexter_Model_ListGetChilds;
- $params = array('id_parent' => 0) ;
- $item_childs_result = $item_childs->get( $params );
- if($item_childs_result instanceof Mozend_ModelError)
- {
- return $this->error( $item_childs_result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->lists_childs_result = $item_childs_result;
- }
- $key_branches = new Geocontexter_Model_ItemGetKeywordBranches;
- $params = array('id_item' => $this->id_item);
- $result = $key_branches->get( $params );
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->keywords_result = $result;
- }
- $key_branches = new Geocontexter_Model_ItemListGetKeywordBranches;
- $params = array('id_item' => $this->id_item,
- 'id_list' => $this->id_list);
- $result = $key_branches->get( $params );
- if($result instanceof Mozend_ModelError)
- {
- return $this->error( $result->getErrorString(), __file__, __line__ );
- }
- else
- {
- $this->view->item_list_keywords_result = $result;
- }
- // assign html head title
- //
- $this->view->headTitle('Edit item ' . $item_result['title'], 'PREPEND');
- // init of model callbacks. used for new window model calls.
- //
- $this->register_model_callbacks( $this->session );
- }
- /**
- * Register of model callback classes
- *
- *
- *
- * @param object $session
- */
- private function register_model_callbacks( & $session )
- {
- $action_callback = new Geocontexter_Model_ModelCallback( $session );
- // url to reload after a model callback was done
- //
- $this->opener_url = $this->view->baseUrl().'/'.$this->view->adminAreaToken.'/geocontexter/itemEdit/index/id_item/'.$this->id_item.'/id_list/'.$this->id_list;
- if(false !== $this->item_list)
- {
- //
- // item_list_keywords
- //
- $params_item_list_keyword =
- array('model_class' => 'Geocontexter_Model_ItemListAddKeyword',
- 'model_class_methode' => 'add',
- 'model_field' => 'id_keyword',
- 'id_name' => 'id_list_item',
- 'id_value' => $this->item_list['id_list_item'],
- 'input_type' => 'checkbox',
- 'opener_url' => $this->opener_url . '/tab_number/3');
- $callback_number = $action_callback->register( $params_item_list_keyword );
- if($callback_number instanceof Mozend_ModelError)
- {
- return $this->error( $callback_number->getErrorString(), __file__, __line__ );
- }
- $this->view->item_list_keyword_callback_number = $callback_number;
- }
- else
- {
- $this->view->item_list_keyword_callback_number = false;
- }
- //
- // item_keywords
- //
- $params_item_keyword =
- array('model_class' => 'Geocontexter_Model_ItemAddKeywords',
- 'model_class_methode' => 'add',
- 'model_field' => 'id_keyword',
- 'id_name' => 'id_item',
- 'id_value' => $this->id_item,
- 'input_type' => 'checkbox',
- 'opener_url' => $this->opener_url . '/tab_number/2');
- $callback_number = $action_callback->register( $params_item_keyword );
- if($callback_number instanceof Mozend_ModelError)
- {
- return $this->error( $callback_number->getErrorString(), __file__, __line__ );
- }
- $this->view->item_keyword_callback_number = $callback_number;
- // item synonym
- //
- $params_item_synonym =
- array('model_class' => 'Geocontexter_Model_ItemChangeSynonym',
- 'model_class_methode' => 'change',
- 'model_field' => 'synonym_of',
- 'id_name' => 'id_item',
- 'id_value' => $this->id_item,
- 'input_type' => 'radio',
- 'opener_url' => $this->opener_url . '/tab_number/0');
- $callback_number = $action_callback->register( $params_item_synonym );
- if($callback_number instanceof Mozend_ModelError)
- {
- return $this->error( $callback_number->getErrorString(), __file__, __line__ );
- }
- $this->view->item_synonym_callback_number = $callback_number;
- //
- // item_lists
- //
- $params_item_list =
- array('model_class' => 'Geocontexter_Model_ItemAddList',
- 'model_class_methode' => 'addList',
- 'model_field' => 'id_list',
- 'id_name' => 'id_item',
- 'id_value' => $this->id_item,
- 'input_type' => 'checkbox',
- 'opener_url' => $this->opener_url . '/tab_number/1');
- $callback_number = $action_callback->register( $params_item_list );
- if($callback_number instanceof Mozend_ModelError)
- {
- return $this->error( $callback_number->getErrorString(), __file__, __line__ );
- }
- $this->view->item_list_callback_number = $callback_number;
- }
- }