Example #1
0
	/**
	 * Return the comment widget as object
	 * @param mixed
	 * @return Widget
	 */
	protected function getCommentWidget($value=null)
	{
		$widget = new TextArea();

		$widget->id = 'comment';
		$widget->name = 'comment';
		$widget->mandatory = true;
		$widget->decodeEntities = true;
		$widget->style = 'height:120px;';
		$widget->value = $value;

		$widget->label = $GLOBALS['TL_LANG']['tl_task']['comment'][0];

		if ($GLOBALS['TL_CONFIG']['showHelp'] && $GLOBALS['TL_LANG']['tl_task']['comment'][1] != '')
		{
			$widget->help = $GLOBALS['TL_LANG']['tl_task']['comment'][1];
		}

		// Valiate input
		if ($this->Input->post('FORM_SUBMIT') == 'tl_tasks')
		{
			$widget->validate();

			if ($widget->hasErrors())
			{
				$this->blnSave = false;
			}
		}

		return $widget;
	}