$save_btn->setAttrib('onclick', 'saveCategory(' . $poi_id . ',$("#CategoryChild' . $poi_id . '").val(),' . $index . ');');
             $save_btn->removeDecorator('HtmlTag');
             $save_btn->removeDecorator('DtDdWrapper');
             $save_btn->removeDecorator('Label');
             $save_btn->setAttrib('class', 'btn radius');
             $this->view->savebutton = $save_btn;
             $cancel_btn = new Zend_Form_Element_Button('CancelCategory' . $poi_id, 'cancel');
             $cancel_btn->setAttrib('onclick', 'CancelCategory(' . $index . ',' . $poi_id . ',' . $index . ')');
             $cancel_btn->removeDecorator('HtmlTag');
             $cancel_btn->removeDecorator('DtDdWrapper');
             $cancel_btn->removeDecorator('Label');
             $cancel_btn->setAttrib('class', 'btn radius');
             $this->view->cancelbutton = $cancel_btn;
         } else {
             $this->view->list = FALSE;
         }
     } else {
         $Category = new Zend_Form_Element_Select('CategoryChild', $data);
     }
     $Category->removeDecorator('HtmlTag');
     $Category->removeDecorator('DtDdWrapper');
     $Category->removeDecorator('Label');
     $this->view->selectbox = $Category;
     $this->view->category_id = $cat_id;
 }
 public function childcategoryselectindoAction()
 {
     $language_id = 2;
     $cat_id = $this->_getParam('catid');
     $tablecategory = new Model_DbTable_Category();
     $data = $tablecategory->getAllChildIdNameByParentIdLangId($cat_id, $language_id);
     $type = $this->_getParam('type');
     if (isset($type)) {
         $poi_id = $this->_getParam('poi');
         $index = $this->_getParam('index');
         if ($type == 'list') {
             $this->view->list = TRUE;
             $Category = new Zend_Form_Element_Select('CategoryChild' . $poi_id, $data);
             $save_btn = new Zend_Form_Element_Button('SaveCategory' . $poi_id, 'save');
 public function init()
 {
     $tableArea = new Model_DbTable_Area();
     $tableCategory = new Model_DbTable_Category();
     $this->Poi_Name = $this->createElement('text', 'PoiName');
     $this->Poi_Name->removeDecorator('HtmlTag');
     $this->Poi_Name->removeDecorator('DtDdWrapper');
     $this->Poi_Name->removeDecorator('Label');
     $this->Poi_Name->setRequired(TRUE);
     $this->Poi_Name->setAttrib('class', 'mediumele');
     $popular = array("multiOptions" => array(0 => "No", 1 => "Yes"));
     $this->Popular_Select = $this->createElement('select', 'PopularSelect', $popular);
     $this->Popular_Select->removeDecorator('HtmlTag');
     $this->Popular_Select->removeDecorator('DtDdWrapper');
     $this->Popular_Select->removeDecorator('Label');
     $this->Poi_TagLine = $this->createElement('text', 'PoiTagline');
     $this->Poi_TagLine->removeDecorator('HtmlTag');
     $this->Poi_TagLine->removeDecorator('DtDdWrapper');
     $this->Poi_TagLine->removeDecorator('Label');
     $this->Poi_TagLine->setAttrib('class', 'mediumele');
     $this->Poi_Address = $this->createElement('text', 'PoiAddress');
     $this->Poi_Address->setAttrib('class', 'tableFormInputLong');
     $this->Poi_Address->removeDecorator('HtmlTag');
     $this->Poi_Address->removeDecorator('DtDdWrapper');
     $this->Poi_Address->removeDecorator('Label');
     $this->Poi_Address->setAttrib('class', 'mediumele');
     $this->Poi_Phone = $this->createElement('text', 'PoiPhone');
     $this->Poi_Phone->removeDecorator('HtmlTag');
     $this->Poi_Phone->removeDecorator('DtDdWrapper');
     $this->Poi_Phone->removeDecorator('Label');
     $this->Poi_Phone->setAttrib('class', 'mediumele');
     $this->Poi_Website = $this->createElement('text', 'PoiWebsite');
     $this->Poi_Website->removeDecorator('HtmlTag');
     $this->Poi_Website->removeDecorator('DtDdWrapper');
     $this->Poi_Website->removeDecorator('Label');
     $this->Poi_Website->setAttrib('class', 'mediumele');
     $this->SpecialDestination = $this->createElement('checkbox', 'SpecialDestination');
     $this->SpecialDestination->removeDecorator('HtmlTag');
     $this->SpecialDestination->removeDecorator('DtDdWrapper');
     $this->SpecialDestination->removeDecorator('Label');
     $this->SpecialDestination->setCheckedValue(1);
     $this->SpecialDestination->setUncheckedValue(0);
     $this->SpecialDestination->setAttrib('onclick', 'showHeaderImage($(this));');
     $this->HeaderImage = $this->createElement('text', 'HeaderImage');
     $this->HeaderImage->removeDecorator('HtmlTag');
     $this->HeaderImage->removeDecorator('DtDdWrapper');
     $this->HeaderImage->removeDecorator('Label');
     $this->HeaderImage->setAttrib('class', 'disabled');
     $category = $tableCategory->getAllParentIdNameForSelectByLangId(2);
     $this->Category_Select = $this->createElement('select', 'CategorySelect', $category);
     $this->Category_Select->removeDecorator('HtmlTag');
     $this->Category_Select->removeDecorator('DtDdWrapper');
     $this->Category_Select->removeDecorator('Label');
     $this->Category_Select->setAttrib('onchange', 'getChildCategoryIndo(this.value);');
     $category_child = $tableCategory->getAllChildIdNameByParentIdLangId(null, 2);
     $this->Category_Child = $this->createElement('select', 'CategoryChild', $category_child);
     $this->Category_Child->removeDecorator('HtmlTag');
     $this->Category_Child->removeDecorator('DtDdWrapper');
     $this->Category_Child->removeDecorator('Label');
     $data = $tableArea->setAreaForSelectElement(1);
     $temp = array(0 => 'select Island');
     $area_data = $temp + $data;
     $data = array("multiOptions" => $area_data);
     $this->Island_Select = $this->createElement('select', 'IslandListOptions', $data);
     $this->Island_Select->removeDecorator('HtmlTag');
     $this->Island_Select->removeDecorator('DtDdWrapper');
     $this->Island_Select->removeDecorator('Label');
     $this->Island_Select->setAttrib('onchange', 'getAreaList(this.value,0);');
     $this->Poi_x = $this->createElement('text', 'pointx');
     $this->Poi_x->removeDecorator('HtmlTag');
     $this->Poi_x->setAttrib('class', 'required');
     $this->Poi_x->removeDecorator('DtDdWrapper');
     $this->Poi_x->removeDecorator('Label');
     $this->Poi_x->setAttrib('onkeyup', 'UpdatePosition();');
     $this->Poi_x->setAttrib('class', 'smallele');
     $this->Poi_x->setRequired(TRUE);
     $this->Poi_y = $this->createElement('text', 'pointy');
     $this->Poi_y->removeDecorator('HtmlTag');
     $this->Poi_y->setAttrib('class', 'required');
     $this->Poi_y->removeDecorator('DtDdWrapper');
     $this->Poi_y->removeDecorator('Label');
     $this->Poi_y->setAttrib('onkeyup', 'UpdatePosition();');
     $this->Poi_y->setAttrib('class', 'smallele');
     $this->Poi_y->setRequired(TRUE);
     $this->Poi_Information = $this->createElement('textarea', 'PoiInformation');
     $this->Poi_Information->removeDecorator('HtmlTag');
     $this->Poi_Information->removeDecorator('DtDdWrapper');
     $this->Poi_Information->removeDecorator('Label');
     $this->Poi_Information->setAttribs(array('cols' => 5, 'rows' => 5));
     $this->Poi_HowToGetThere = $this->createElement('textarea', 'PoiHowToGetThere');
     $this->Poi_HowToGetThere->removeDecorator('HtmlTag');
     $this->Poi_HowToGetThere->removeDecorator('DtDdWrapper');
     $this->Poi_HowToGetThere->removeDecorator('Label');
     $this->Poi_HowToGetAround = $this->createElement('textarea', 'PoiHowToGetAround');
     $this->Poi_HowToGetAround->removeDecorator('HtmlTag');
     $this->Poi_HowToGetAround->removeDecorator('DtDdWrapper');
     $this->Poi_HowToGetAround->removeDecorator('Label');
     $this->Poi_WhatToDo = $this->createElement('textarea', 'PoiWhatToDo');
     $this->Poi_WhatToDo->removeDecorator('HtmlTag');
     $this->Poi_WhatToDo->removeDecorator('DtDdWrapper');
     $this->Poi_WhatToDo->removeDecorator('Label');
     $this->Poi_WhereToEat = $this->createElement('textarea', 'PoiWhereToEat');
     $this->Poi_WhereToEat->removeDecorator('HtmlTag');
     $this->Poi_WhereToEat->removeDecorator('DtDdWrapper');
     $this->Poi_WhereToEat->removeDecorator('Label');
     $this->Poi_WhereToStay = $this->createElement('textarea', 'PoiWhereToStay');
     $this->Poi_WhereToStay->removeDecorator('HtmlTag');
     $this->Poi_WhereToStay->removeDecorator('DtDdWrapper');
     $this->Poi_WhereToStay->removeDecorator('Label');
     $this->Poi_WhatToBuy = $this->createElement('textarea', 'PoiWhatToBuy');
     $this->Poi_WhatToBuy->removeDecorator('HtmlTag');
     $this->Poi_WhatToBuy->removeDecorator('DtDdWrapper');
     $this->Poi_WhatToBuy->removeDecorator('Label');
     $this->Poi_Tips = $this->createElement('textarea', 'PoiTips');
     $this->Poi_Tips->removeDecorator('HtmlTag');
     $this->Poi_Tips->removeDecorator('DtDdWrapper');
     $this->Poi_Tips->removeDecorator('Label');
     /*hidden element*/
     $this->relPoi_counter = $this->createElement('hidden', 'relPoi_counter');
     $this->relPoi_counter->removeDecorator('HtmlTag');
     $this->relPoi_counter->removeDecorator('DtDdWrapper');
     $this->relPoi_counter->removeDecorator('Label');
     $this->relPoi_counter->setValue(0);
     $this->SaveStatus = $this->createElement('hidden', 'SaveStatus');
     $this->SaveStatus->removeDecorator('HtmlTag');
     $this->SaveStatus->removeDecorator('DtDdWrapper');
     $this->SaveStatus->removeDecorator('Label');
     $this->SaveStatus->setValue(1);
     /**
      * This element will be used for maximum area counter storage, 
      * when you remove an area this counter number wont be decreased
      */
     $this->Count_area = $this->createElement('hidden', 'MaxArea');
     $this->Count_area->removeDecorator('HtmlTag');
     $this->Count_area->removeDecorator('DtDdWrapper');
     $this->Count_area->removeDecorator('Label');
     $this->Count_area->setValue(0);
     /**
      * This element will be used for maximum category counter storage, 
      * when you remove a category this counter number wont be decreased
      */
     $this->Count_category = $this->createElement('hidden', 'MaxCategory');
     $this->Count_category->removeDecorator('HtmlTag');
     $this->Count_category->removeDecorator('DtDdWrapper');
     $this->Count_category->removeDecorator('Label');
     $this->Count_category->setValue(0);
     $this->Area_counter = $this->createElement('hidden', 'AreaCounter');
     $this->Area_counter->removeDecorator('HtmlTag');
     $this->Area_counter->removeDecorator('DtDdWrapper');
     $this->Area_counter->removeDecorator('Label');
     $this->Area_counter->setValue(0);
     $this->Category_counter = $this->createElement('hidden', 'CategoryCounter');
     $this->Category_counter->removeDecorator('HtmlTag');
     $this->Category_counter->removeDecorator('DtDdWrapper');
     $this->Category_counter->removeDecorator('Label');
     $this->Category_counter->setValue(0);
     $this->Main_category = $this->createElement('hidden', 'MainCategory');
     $this->Main_category->removeDecorator('HtmlTag');
     $this->Main_category->removeDecorator('DtDdWrapper');
     $this->Main_category->removeDecorator('Label');
     $this->Main_category->setValue(0);
 }
Пример #3
0
 public function init()
 {
     $tableArea = new Model_DbTable_Area();
     $tableCategory = new Model_DbTable_Category();
     $dateValidator = new Zend_Validate_Date();
     $this->name = new Zend_Form_Element_Text('Name');
     $this->name->setRequired(true)->setAttrib('class', 'span7')->setAttrib('placeholder', 'Masukan Nama Kebudayaan Disini...')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label');
     $this->featured = new Zend_Form_Element_Checkbox('Featured');
     $this->featured->setAttrib('class', 'checkbox')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label');
     $this->description = new Zend_Form_Element_Textarea('Description');
     $this->description->setAttrib('style', 'width:100%')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label');
     $this->header_image = new Zend_Form_Element_File('Header_image');
     $this->header_image->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label');
     $this->submit = new Zend_Form_Element_Submit('Submit');
     $this->submit->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label')->setAttribs(array('class' => 'btn btn-success', 'id' => 'submit-btn'));
     $this->draft = new Zend_Form_Element_Submit('Draft');
     $this->draft->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label')->setAttribs(array('class' => 'btn', 'id' => 'draft-btn'));
     $this->videos = new Zend_Form_SubForm();
     $category = $tableCategory->getAllParentIdNameForSelectByLangId(1);
     $this->Category_Select = $this->createElement('select', 'CategorySelect', $category);
     $this->Category_Select->removeDecorator('HtmlTag');
     $this->Category_Select->removeDecorator('DtDdWrapper');
     $this->Category_Select->removeDecorator('Label');
     $this->Category_Select->setAttrib('onchange', 'getChildCategory(this.value);');
     $category_child = $tableCategory->getAllChildIdNameByParentIdLangId();
     $this->Category_Child = $this->createElement('select', 'CategoryChild', $category_child);
     $this->Category_Child->removeDecorator('HtmlTag');
     $this->Category_Child->removeDecorator('DtDdWrapper');
     $this->Category_Child->removeDecorator('Label');
     $data = $tableArea->setAreaForSelectElement(1);
     $temp = array(0 => 'Pilih Area');
     $area_data = $temp + $data;
     $data = array("multiOptions" => $area_data);
     $this->Island_Select = $this->createElement('select', 'IslandListOptions', $data);
     $this->Island_Select->removeDecorator('HtmlTag');
     $this->Island_Select->removeDecorator('DtDdWrapper');
     $this->Island_Select->removeDecorator('Label');
     $this->Island_Select->setAttrib('onchange', 'getAreaList(this.value,0);');
     $this->Poi_x = $this->createElement('hidden', 'pointx');
     $this->Poi_x->removeDecorator('HtmlTag');
     $this->Poi_x->setAttrib('class', 'required');
     $this->Poi_x->removeDecorator('DtDdWrapper');
     $this->Poi_x->removeDecorator('Label');
     $this->Poi_x->setAttrib('onkeyup', 'updatePosition();');
     $this->Poi_x->setAttrib('class', 'smallele');
     $this->Poi_x->setRequired(TRUE);
     $this->Poi_y = $this->createElement('hidden', 'pointy');
     $this->Poi_y->removeDecorator('HtmlTag');
     $this->Poi_y->setAttrib('class', 'required');
     $this->Poi_y->removeDecorator('DtDdWrapper');
     $this->Poi_y->removeDecorator('Label');
     $this->Poi_y->setAttrib('onkeyup', 'updatePosition();');
     $this->Poi_y->setAttrib('class', 'smallele');
     $this->Poi_y->setRequired(TRUE);
     /* hidden element */
     $this->relPoi_counter = $this->createElement('hidden', 'relPoi_counter');
     $this->relPoi_counter->removeDecorator('HtmlTag');
     $this->relPoi_counter->removeDecorator('DtDdWrapper');
     $this->relPoi_counter->removeDecorator('Label');
     $this->relPoi_counter->setValue(0);
     $this->SaveStatus = $this->createElement('hidden', 'SaveStatus');
     $this->SaveStatus->removeDecorator('HtmlTag');
     $this->SaveStatus->removeDecorator('DtDdWrapper');
     $this->SaveStatus->removeDecorator('Label');
     $this->SaveStatus->setValue(1);
     /**
      * This element will be used for maximum area counter storage, 
      * when you remove an area this counter number wont be decreased
      */
     $this->Count_area = $this->createElement('hidden', 'MaxArea');
     $this->Count_area->removeDecorator('HtmlTag');
     $this->Count_area->removeDecorator('DtDdWrapper');
     $this->Count_area->removeDecorator('Label');
     $this->Count_area->setValue(0);
     /**
      * This element will be used for maximum category counter storage, 
      * when you remove a category this counter number wont be decreased
      */
     $this->Count_category = $this->createElement('hidden', 'MaxCategory');
     $this->Count_category->removeDecorator('HtmlTag');
     $this->Count_category->removeDecorator('DtDdWrapper');
     $this->Count_category->removeDecorator('Label');
     $this->Count_category->setValue(0);
     $this->Area_counter = $this->createElement('hidden', 'AreaCounter');
     $this->Area_counter->removeDecorator('HtmlTag');
     $this->Area_counter->removeDecorator('DtDdWrapper');
     $this->Area_counter->removeDecorator('Label');
     $this->Area_counter->setValue(0);
     $this->Category_counter = $this->createElement('hidden', 'CategoryCounter');
     $this->Category_counter->removeDecorator('HtmlTag');
     $this->Category_counter->removeDecorator('DtDdWrapper');
     $this->Category_counter->removeDecorator('Label');
     $this->Category_counter->setValue(0);
     $this->Main_category = $this->createElement('hidden', 'MainCategory');
     $this->Main_category->removeDecorator('HtmlTag');
     $this->Main_category->removeDecorator('DtDdWrapper');
     $this->Main_category->removeDecorator('Label');
     $this->Main_category->setValue(0);
 }