<?php


class CatalyzActionControler {
	static function getDefaultActions()
	{
		$result = array() ;
		$result[] = self::getSaveAction();
		$result[] = self::getPreviewAction();
		$result[] = self::getCancelAction();
		return $result;
	}

	static function getSaveAction()
	{
		return self::getAction('Submit', __('Save', null, 'catalyz'));
	}
	static function getPreviewAction()
	{
		return self::getAction('Preview', __('Preview', null, 'catalyz'), '_blank');
	}
	static function getCancelAction()
	{
		return self::getAction('Cancel', __('Cancel', null, 'catalyz'));
	}
	static function getAction($name, $caption = null, $target = '_self')
	{
		return submit_tag(($caption == null)?$name:$caption, array('name' => $name, 'onclick' => 'this.form.target = \'' . $target . '\'; return true;'));
	}
}

?>