Ejemplo n.º 1
0
 public function show()
 {
     if (!$this->isSubmitted) {
         if (!$this->controls['preview']->getValue()) {
             $this->controls['preview']->setValue(0);
         }
     }
     parent::show();
 }
Ejemplo n.º 2
0
 public function show()
 {
     if (!$this->isSubmitted) {
         if (!$this->controls['title']->getValue()) {
             $maxId = $this->getMaxId();
             $this->controls['title']->setValue('Application #' . ($maxId ? $maxId + 1 : 1));
         }
     }
     parent::show();
 }
Ejemplo n.º 3
0
 public function show()
 {
     if (!$this->isSubmitted) {
         if (!$this->controls['preview']->getValue()) {
             $this->controls['preview']->setValue(0);
         }
     }
     if ($this->primaryKeyValue) {
         $oApplication = AM_Model_Db_Table_Abstract::factory('application')->findOneBy('id', $this->primaryKeyValue);
         if ($oApplication->newsstand_cover_image) {
             $sIssueImageUri = AM_Tools::getImageUrl('270-150', AM_Model_Db_Application::PRESET_APPLICATION_IMAGE, $this->primaryKeyValue, $oApplication->newsstand_cover_image, 'png');
             if (!empty($oApplication->updated)) {
                 $sIssueImageUri .= '?' . strtotime($oApplication->updated);
             }
         }
     }
     $aRecord = array('imageUri' => isset($sIssueImageUri) ? $sIssueImageUri : null);
     if (isset($this->view->{$this->getName()})) {
         $aRecord = array_merge($aRecord, $this->view->{$this->getName()});
     }
     $this->view->{$this->getName()} = $aRecord;
     parent::show();
 }