コード例 #1
0
ファイル: LogoMainMenu.php プロジェクト: hoalangoc/ftf
 public function init()
 {
     parent::init();
     // Set form attributes
     $this->setTitle('Edit Logo & Site Name')->setDescription('Shows your site-wide main logo or title. Images are uploaded via the File Media Manager.');
     // Get available files
     $logoOptions = array('' => 'Text-only (No logo)');
     $imageExtensions = array('gif', 'jpg', 'jpeg', 'png');
     $it = new DirectoryIterator(APPLICATION_PATH . '/public/admin/');
     foreach ($it as $file) {
         if ($file->isDot() || !$file->isFile()) {
             continue;
         }
         $basename = basename($file->getFilename());
         if (!($pos = strrpos($basename, '.'))) {
             continue;
         }
         $ext = strtolower(ltrim(substr($basename, $pos), '.'));
         if (!in_array($ext, $imageExtensions)) {
             continue;
         }
         $logoOptions['public/admin/' . $basename] = $basename;
     }
     $this->addElement('Select', 'logo', array('label' => 'Site Logo', 'multiOptions' => $logoOptions));
     $this->addElement('Text', 'logo_link', array('label' => 'Link of Logo'));
     $this->addElement('Text', 'site_name', array('label' => 'Site Name'));
     $this->addElement('Text', 'site_link', array('label' => 'Link of Site Name'));
 }
コード例 #2
0
ファイル: HomePoll.php プロジェクト: robeendey/ce
 public function init()
 {
     parent::init();
     // Set form attributes
     $this->setTitle('Home Poll')->setDescription('Please choose a poll.');
     // Element: poll_id
     $this->addElement('Hidden', 'poll_id', array('allowEmpty' => false, 'required' => true));
 }
コード例 #3
0
 public function init()
 {
     parent::init();
     // Set form attributes
     $this->setTitle('Generic Menu')->setDescription('Please choose a menu.');
     // Element: name
     $this->addElement('Select', 'menu', array('label' => 'Menu'));
     foreach (Engine_Api::_()->getDbtable('menus', 'core')->fetchAll() as $menu) {
         $this->menu->addMultiOption($menu->name, $menu->title);
     }
     // Element: ulClass
     $this->addElement('Text', 'ulClass', array('label' => 'List CSS Class'));
 }
コード例 #4
0
 public function init()
 {
     parent::init();
     // Set form attributes
     $this->setTitle('Ad Campaign')->setDescription('Please choose an advertisement campaign.')->setAttrib('id', 'form-upload');
     $campaigns = Engine_Api::_()->getDbtable('adcampaigns', 'core')->fetchAll();
     if (count($campaigns) > 0) {
         // Element: adcampaign_id
         $this->addElement('Select', 'adcampaign_id', array('label' => 'Ad Campaign'));
         $this->adcampaign_id->addMultiOption(0, '');
         foreach ($campaigns as $campaign) {
             $this->adcampaign_id->addMultiOption($campaign->adcampaign_id, $campaign->name);
         }
     }
 }
コード例 #5
0
ファイル: PlayersOfWeek.php プロジェクト: hoalangoc/ftf
  	public function init() {
    	parent::init();
    
    	// Set form attributes
    	$this->setTitle('Players of the Week/Day');
		
		$this->addElement('Text', 'title', array(
			'label' => 'Title',
			'description' => 'Maximum 64 characters',
      		'validators' => array(
        		array('StringLength', false, array(0, 64)),
      		),
      		'filters' => array(
        			'StripTags',
        		new Engine_Filter_Censor(),
      		),
		));
		$this->title->getDecorator("Description")->setOption("placement", "append");
		
		$this->addElement('Integer', 'numberOfVideos', array(
			'label' => 'Number of videos will show',
			'validators' => array(
                new Engine_Validate_AtLeast(1),
            ),
            'value' => 5
		));
		
		$this->addElement('Select', 'type', array(
			'label' => 'Type of the widget',
			'multiOptions' => array(
				'week' => 'Week',
				'day' => 'Day'
			),
			'value' => 'week'
		));
		
		$this->addElement('Select', 'weekDay', array(
			'label' => 'Day for resetting widget',
			'multiOptions' => array(
				'sunday' => 'Sunday',
				'monday' => 'Monday',
				'tuesday' => 'Tuesday',
				'wednesday' => 'Wednesday',
				'thursday' => 'Thursday',
				'friday' => 'Friday',
				'saturday' => 'Saturday'
			),
			'value' => 'sunday'
		));
		
		$hour = array();
		for ($i = 0; $i < 24; $i++) {
			$hour[$i] = $i.':00';
		};
		
		$this->addElement('Select', 'dayHour', array(
			'label' => 'Time for resetting widget',
			'multiOptions' => $hour,
			'value' => 0
		));
		
		$this->addElement('Integer', 'share_internal', array(
			'label' => 'Point for each internal share',
            'value' => 2
		));
		
		$this->addElement('Integer', 'like', array(
			'label' => 'Point for each like',
            'value' => 3
		));
		
		$this->addElement('Integer', 'comment', array(
			'label' => 'Point for each comment',
            'value' => 2
		));
		
		$this->addElement('Integer', 'view', array(
			'label' => 'Point for each view',
            'value' => 1
		));
		
		$this->addElement('Integer', 'dislike', array(
			'label' => 'Point for each dislike',
            'value' => -1
		));
		
		// $this->addElement('Integer', 'unsure', array(
			// 'label' => 'Point for each unsure',
            // 'value' => 0
		// ));
				
		$view = Zend_Registry::get('Zend_View');
		$view -> headScript() -> appendFile($view -> baseUrl() . '/application/modules/Ynvideo/externals/scripts/players_of_week.js');		
	}