Source of file AdminHelpField.php
Size: 1,686 Bytes - Last Modified: 2021-12-23T10:59:16+00:00
/var/www/docs.ssmods.com/process/src/code/forms/AdminHelpField.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | <?php /** * Created by PhpStorm. * User: Conrad * Date: 14/08/2015 * Time: 10:06 AM */ class AdminHelpField extends FormField { /** * Whether help items should open in a new window by default * @var boolean **/ private static $new_window_default = false; /** * Whether this help item should open in a new window * @var string|boolean **/ protected $newWindow; protected $text; protected $uid; /** * @param string $name Field name * @param null|string $text Short help link description * @param string $uid UniqueIdentifier for AdminHelp */ public function __construct($name, $text, $uid, $newWindow='default') { $this->text = $text; $this->uid = $uid; $this->newWindow = $newWindow; parent::__construct($name); } public function FieldHolder($properties = array()) { return $this->Field($properties); } public function Field($properties = array()) { return $this->renderWith('AdminHelpField'); } public function HelpItem() { return AdminHelp::by_uid($this->uid); } public function HelpText() { return $this->text; } public function HelpLink() { return AdminHelp::by_uid($this->uid)->Link(); } public function getUID() { return $this->uid; } /** * Check if this help item should open in a new window * or inline in a dropdown * @return boolean **/ public function OpenInNewWindow() { return $this->newWindow == 'default' ? $this->config()->new_window_default : $this->newWindow; } } |