public function indexAction()
 {
     $layout_id = null;
     $base = true;
     if (!$this->getRequest()->isApplication()) {
         if ($this->getRequest()->isInstalling()) {
             $layout_id = 'installer_installation_index';
         } else {
             if (!$this->getSession()->isLoggedIn()) {
                 $layout_id = 'admin_account_login';
             } else {
                 $layout_id = 'application_customization_design_style_edit';
             }
         }
         $module = substr($layout_id, 0, stripos($layout_id, '_'));
         Core_Model_Translator::addModule($module);
     } else {
         if ($this->getApplication()->getLayoutVisibility() != Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE and !$this->hasParam("value_id")) {
             $page = $this->getApplication()->getFirstActivePage();
             if (!$page->getId()) {
                 $page = Application_Model_Option_Value::getDummy();
             }
             $this->_redirect($page->getMobileUri(), array('value_id' => $page->getId()));
             return $this;
         } else {
             Core_Model_Translator::addModule("padlock");
         }
     }
     //        } else if($this->getRequest()->isXmlHttpRequest()) {
     //            $base = false;
     //        }
     $this->loadPartials($layout_id);
 }
 public function getPages($samples = 0)
 {
     if (empty($this->_pages)) {
         $option = new Application_Model_Option_Value();
         $this->_pages = $option->findAll(array("a.app_id" => $this->getId(), 'remove_folder' => new Zend_Db_Expr('folder_category_id IS NULL'), 'is_visible' => 1));
     }
     if ($this->_pages->count() == 0 and $samples > 0) {
         $dummy = Application_Model_Option_Value::getDummy();
         for ($i = 0; $i < $samples; $i++) {
             $this->_pages->addRow($this->_pages->count(), $dummy);
         }
     }
     return $this->_pages;
 }