/**
  * @param string $name
  * @param string $title
  * @param Form $form
  */
 public function __construct($name, $title, $id)
 {
     if ($id) {
         $this->id = $id;
     }
     //css requirements
     Requirements::css('metapreview/css/metapreviewfield.css');
     parent::__construct($name, $title);
 }
Exemplo n.º 2
0
 /**
  * @param string $name
  * @param string $title
  * @param Form $form
  */
 public function __construct($name, $title)
 {
     // legacy handling for old parameters: $title, $heading, ...
     // instead of new handling: $name, $title, $heading, ...
     $args = func_get_args();
     if (!isset($args[1])) {
         $title = isset($args[0]) ? $args[0] : null;
         $name = $title;
         $form = isset($args[3]) ? $args[3] : null;
     }
     parent::__construct($name, $title);
 }
 /**
  * @param String $name
  * @param Order $order
  * @param Member $member
  */
 function __construct($name, Order $order, Member $member = null)
 {
     if (!$member) {
         $member = $order->Member();
     }
     if (!$member) {
         $member = new Member();
     }
     $orderSteps = OrderStep::get();
     $where = "\"HideStepFromCustomer\" = 0";
     $currentStep = $order->CurrentStepVisibleToCustomer();
     if ($member->IsShopAdmin()) {
         $where = "";
         $currentStep = $order->MyStep();
     } else {
         $currentStep = $order->CurrentStepVisibleToCustomer();
         $orderSteps->filter(array("HideStepFromCustomer" => 0));
     }
     $future = false;
     $html = "\r\n\t\t<div class=\"orderStepField\">\r\n\t\t\t<ol>";
     if ($orderSteps->count()) {
         foreach ($orderSteps as $orderStep) {
             $description = "";
             if ($member->IsShopAdmin()) {
                 if ($orderStep->Description) {
                     $description = " title=\"" . Convert::raw2att($orderStep->Description) . "\" ";
                 }
             }
             $class = "";
             if ($orderStep->ID == $currentStep->ID) {
                 $future = true;
                 $class .= " current";
             } elseif ($future) {
                 $class .= " todo";
             } else {
                 $class .= " done";
             }
             $html .= '<li class="' . $class . '" ' . $description . '>' . $orderStep->Title . '</li>';
         }
     } else {
         $html .= "no steps";
     }
     $html .= "</ol><div class=\"clear\"></div></div>";
     if ($currentStep->Description) {
         $html .= "\r\n\t\t\t\t<p>" . "<strong>" . $currentStep->Title . "</strong> " . _t("OrderStepField.STEP", "step") . ": " . "<i>" . $currentStep->Description . "</i>" . "</p>";
     }
     $this->content = $html;
     Requirements::themedCSS("OrderStepField", 'ecommerce');
     parent::__construct($name);
 }
 /**
  * @param string $name
  * @param string $title
  * @param string $className (Deprecated: use addExtraClass())
  * @param bool $allowHTML (Deprecated: use setAllowHTML())
  * @param Form $form
  */
 function __construct($name, $title, $className = null, $allowHTML = false, $form = null)
 {
     // legacy handling for old parameters: $title, $heading, ...
     // instead of new handling: $name, $title, $heading, ...
     $args = func_get_args();
     if (!isset($args[1])) {
         $title = isset($args[0]) ? $args[0] : null;
         $name = $title;
         $classname = isset($args[1]) ? $args[1] : null;
         $allowHTML = isset($args[2]) ? $args[2] : null;
         $form = isset($args[3]) ? $args[3] : null;
     }
     parent::__construct($name, $title, null, $allowHTML, $form);
 }
Exemplo n.º 5
0
 /**
  * @param string $name
  * @param null|string $title
  */
 public function __construct($name, $title = null)
 {
     // legacy handling:
     // $title, $headingLevel...
     $args = func_get_args();
     if (!isset($args[1])) {
         $title = isset($args[0]) ? $args[0] : null;
         if (isset($args[0])) {
             $title = $args[0];
         }
         // Prefix name to avoid collisions.
         $name = 'LabelField' . $title;
     }
     parent::__construct($name, $title);
 }
Exemplo n.º 6
0
 function __construct($name, $title = null, $headingLevel = 2, $form = null)
 {
     // legacy handling for old parameters: $title, $heading, ...
     // instead of new handling: $name, $title, $heading, ...
     $args = func_get_args();
     if (!isset($args[1]) || is_numeric($args[1])) {
         $title = isset($args[0]) ? $args[0] : null;
         // Use "HeaderField(title)" as the default field name for a HeaderField; if it's just set to title then we risk
         // causing accidental duplicate-field creation.
         $name = 'HeaderField' . $title;
         // this means i18nized fields won't be easily accessible through fieldByName()
         $headingLevel = isset($args[1]) ? $args[1] : null;
         $form = isset($args[3]) ? $args[3] : null;
     }
     if ($headingLevel) {
         $this->headingLevel = $headingLevel;
     }
     parent::__construct($name, $title, null, $form);
 }
 /**
  * Header fields heading level to be set
  *
  * @return array
  */
 public function getSchemaDataDefaults()
 {
     $data = parent::getSchemaDataDefaults();
     $data['data']['headingLevel'] = $this->headingLevel;
     return $data;
 }
	/**
	 * Create a new HelpField.
	 * @param string $targetField The name of the form field to attach the help text to (eg, "MenuTitle" or "Content")
	 * @param string $content The text/HTML contents of the help box
	 */
	function __construct($targetField, $content) {
		$this->targetField = $targetField;
		$this->content = $content;
		
		parent::__construct($targetField.'_HelpField', $content);
	}
 public function __construct()
 {
     $name = "placeholder-" . rand(0, 1000);
     parent::__construct($name);
 }
 function __construct($name, $text)
 {
     parent::__construct($name, '');
     $this->text = $text;
 }
 public function Field($properties = array())
 {
     $this->setAttribute('href', $this->value);
     return parent::Field();
 }
Exemplo n.º 12
0
 public function __construct($name, $content)
 {
     $this->content = $content;
     parent::__construct($name);
 }
Exemplo n.º 13
0
 /**
  * Create a new label.
  * @param title The label itslef
  * @param class An HTML class to apply to the label.
  */
 function __construct($title, $className = "", $allowHTML = false, $form = null)
 {
     $this->className = $className;
     $this->allowHTML = $allowHTML;
     parent::__construct(null, $title, null, $form);
 }
Exemplo n.º 14
0
 /**
  * {@inheritdoc}
  */
 public function getAttributes()
 {
     return array_merge(parent::getAttributes(), array('id' => $this->ID(), 'class' => $this->extraClass()));
 }
Exemplo n.º 15
0
 /**
  * Creates a new field.
  * 
  * @param string $name    Field name
  * @param string $content Field content to display
  * @param string $title   Field title to display
  * 
  * @return void
  *
  * @author Sebastian Diel <*****@*****.**>
  * @since 22.07.2016
  */
 public function __construct($name, $content = null, $title = null)
 {
     parent::__construct($name, $title);
     $this->setContent($content);
     $this->setAlertTitle($title);
 }
Exemplo n.º 16
0
 function __construct($title, $headingLevel = 2, $allowHTML = false, $form = null)
 {
     $this->headingLevel = $headingLevel;
     $this->allowHTML = $allowHTML;
     parent::__construct(null, $title, null, $form);
 }
 /**
  * @param string $name
  * @param string|FormField $content
  */
 public function __construct($name, $content)
 {
     $this->setContent($content);
     parent::__construct($name);
 }
 public function __construct($title)
 {
     $this->title = $title;
     $name = "nakedtext-" . rand(0, 1000);
     parent::__construct($name, $title);
 }
Exemplo n.º 19
0
 function __construct($name, $content)
 {
     parent::__construct($name);
     $this->content = $content;
 }
 /**
  * @param The                        $name
  * @param DataObjectPreviewInterface $record
  * @param DataObjectPreviewer        $previewer
  */
 public function __construct($name, DataObjectPreviewInterface $record, DataObjectPreviewer $previewer)
 {
     $this->record = $record;
     $this->previewer = $previewer;
     parent::__construct($name);
 }