Esempio n. 1
0
 public function indexAction()
 {
     $blogForm = new Blog_Form();
     $blogForm->setAction($this->baseUrl . '/mod_blog/blog/create');
     $submit = $blogForm->getElement('submit');
     $submit->setLabel($this->view->getTranslation('Create Blog'));
     $this->view->form = $blogForm;
     $mdlBlog = new Blog_Blog();
     $this->view->blogs = $mdlBlog->getBlogs();
 }
Esempio n. 2
0
 /**
  *
  */
 public function selectBlog($name, $value)
 {
     $mdlBlog = new Blog_Blog();
     $blogs = $mdlBlog->getBlogs();
     if ($blogs == null) {
         return $this->view->getTranslation('There are no blogs to view!');
     } else {
         $options[] = $this->view->getTranslation('Select One');
         foreach ($blogs as $blog) {
             $options[$blog->id] = $blog->name;
         }
         $form = new Digitalus_Form();
         $select = $form->createElement('select', $name, array('multiOptions' => $options, 'belongsTo' => 'module'));
         return $select;
     }
 }