Ejemplo n.º 1
0
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Ejemplo n.º 2
0
 /**
  * Class constructor
  */
 public function __construct()
 {
     parent::__construct('albumEditForm');
     $language = OW::getLanguage();
     // album id field
     $albumIdField = new HiddenField('id');
     $albumIdField->setRequired(true);
     $this->addElement($albumIdField);
     // album name Field
     $albumNameField = new TextField('albumName');
     $this->addElement($albumNameField->setLabel($language->text('photo', 'album')));
     // category
     $categoryField = new Selectbox('category');
     $categories = array();
     foreach (ADVANCEDPHOTO_BOL_CategoryService::getInstance()->getCategoriesList() as $key => $item) {
         $categories[$item->id] = $item->name;
     }
     $categoryField->setOptions($categories);
     $this->addElement($categoryField->setLabel($language->text('advancedphoto', 'category')));
     $submit = new Submit('save');
     $submit->setValue($language->text('photo', 'btn_edit'));
     $this->addElement($submit);
 }
Ejemplo n.º 3
0
 public function delete($params)
 {
     if (isset($params['id'])) {
         ADVANCEDPHOTO_BOL_CategoryService::getInstance()->deleteCategory((int) $params['id']);
     }
     $this->redirect(OW::getRouter()->urlForRoute('advancedphoto_categories'));
 }