AnonSec Team
Server IP : 10.2.73.233  /  Your IP : 216.73.216.59
Web Server : Apache/2.4.59 (Debian)
System : Linux polon 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64
User : www-data ( 33)
PHP Version : 5.6.40-64+0~20230107.71+debian10~1.gbp673146
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/leksykografia/application/forms/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/leksykografia/application/forms/Page.php
<?php 
class Application_Form_Page extends Zend_Form
{
    public function init()
    {
        $pageTypeMapper = new Application_Model_PageTypeMapper();
        $pageTypes = $pageTypeMapper->fetchAll();
        // Set the method for the display form to POST
        $this->setMethod('post');
        $this->setEnctype(Zend_Form::ENCTYPE_MULTIPART);
        
 
        // Add an email element
        
        $this->addElement('checkbox', 'active', array(
            'label'      => 'Aktywny:',
            'required'   => true,
        ));
        
        $this->addElement('checkbox', 'excludeTitle', array(
            'label'      => 'Nie pokazuj nazwy artykułu:',
            'required'   => true,
        ));
        
        $pageTypeSelect = new Zend_Form_Element_Select('pageType', array(
            'label'      => 'Typ artykułu:',
            'required'   => true,
        	'validators' => array(
             array( 'NotEmpty', true, array(
                    'messages' => array(
                       'isEmpty' => 'Pole nie może by puste.'
                 ))),
             )
        ));
        
        foreach($pageTypes as $pageType)
            $pageTypeSelect->addMultiOption($pageType->getId(), $pageType->getName());
        
        $this->addElement($pageTypeSelect);
        $this->addElement('text', 'title', array(
            'label'      => 'Nazwa artykułu:',
            'required'   => false,
        	'validators' => array(
             array( 'NotEmpty', true, array(
                    'messages' => array(
                       'isEmpty' => 'Pole nie może by puste.'
                 ))),
             )
        ));
        
        $this->addElement('text', 'titleSmall', array(
            'label'      => 'Dodatkowa nazwa artykułu:',
            'required'   => false,
        ));

        $this->addElement('textarea', 'text', array(
            'label'      => 'Treść:',
            'required'   => true,
            'cols' => 70,
            'validators' => array(
             array( 'NotEmpty', true, array(
                    'messages' => array(
                       'isEmpty' => 'Pole nie może by puste.'
                 ))),
             )
        ));
             
        $image = new Zend_Form_Element_File('image');
        $image->setLabel('Obrazek:')
              ->setDestination(realpath(APPLICATION_PATH . '/../public/uploads'))
              ->setRequired(false)
              ->setMaxFileSize(2097152); // limits the filesize on the client side
        $image->addValidator('Count', false, 1);                // ensure only 1 file
        $image->addValidator('Size', false, 2097152);            // limit to 10 meg
        $image->addValidator('Extension', false, 'jpg,jpeg,png,gif');// only JPEG, PNG, and GIFs
        $this->addElement($image);
        
        
      
        
        $this->addElement('text', 'trailer', array(
            'label'      => 'Trailer:',
            'required'   => false,
        ));
 
        // Add the submit button
        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Zatwierdź',
        ));
 
    }
}

AnonSec - 2021