<?php

/**
 * Ahead WebSoft Technologies Pvt Ltd.
 * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
 * @license    https://www.socialengine.com/policies
 */

class Core_Form_Savecollection_Create extends Engine_Form
{
	public function init()
	{
		$this->setTitle('Create Collection')
			->setAttrib('class', 'global_form');

		$translate = Zend_Registry::get('Zend_Translate');

		// Collection Name element
		$this->addElement('Text', 'name', array(
			'label' => 'Collection Name',
			'required' => true,
			'allowEmpty' => false,
			'filters' => array(
				'StringTrim',
				'StripTags',
			),
			'validators' => array(
				array('NotEmpty', true),
				array('StringLength', false, array('max' => 50)),
			),
			'attribs' => array(
				'maxlength' => 50,
				'placeholder' => $translate->translate('Enter collection name'),
			),
		));

		// Submit button
		$this->addElement('Button', 'submit', array(
			'label' => 'Create',
			'type' => 'submit',
			'ignore' => true,
			'decorators' => array(
				'ViewHelper',
			),
		));

		// Cancel button
		$this->addElement('Cancel', 'cancel', array(
			'label' => 'cancel',
			'link' => true,
			'prependText' => ' or ',
			'decorators' => array(
				'ViewHelper',
			),
		));

		// Button group
		$this->addDisplayGroup(array('submit', 'cancel'), 'buttons', array(
			'decorators' => array(
				'FormElements',
				'DivDivDivWrapper',
			),
		));
	}
}
