Пример #1
0
 /**
  * Create a new page comment interface
  * @param controller The controller that the interface is used on
  * @param methodName The method to return this PageCommentInterface object
  * @param page The page that we're commenting on
  */
 function __construct($controller, $methodName, $page)
 {
     $this->controller = $controller;
     $this->methodName = $methodName;
     $this->page = $page;
     parent::__construct();
 }
 public function __construct(GridField $grid, GridFieldComponent $component, $name)
 {
     $this->grid = $grid;
     $this->component = $component;
     $this->name = $name;
     parent::__construct();
 }
 public function __construct($grid, $button)
 {
     $this->grid = $grid;
     $this->button = $button;
     $this->context = singleton($grid->getModelClass())->getDefaultSearchContext();
     parent::__construct();
 }
 /**
  * Handler's constructor
  *
  * @param GridField $gridField
  * @param GridField_URLHandler $component
  * @param RequestHandler $handler
  */
 public function __construct($gridField, $component, $handler)
 {
     $this->gridField = $gridField;
     $this->component = $component;
     $this->requestHandler = $handler;
     parent::__construct();
 }
 /**
  * Handler's constructor
  * 
  * @param GridFIeld $gridField
  * @param GridField_URLHandler $component
  * @param Controller $controller
  */
 public function __construct($gridField, $component, $controller)
 {
     $this->gridField = $gridField;
     $this->component = $component;
     $this->controller = $controller;
     parent::__construct();
 }
 /**
  * @param string $fragment the fragment to render the button in
  * @param string $title the text to display on the button
  * @param \FieldList|Callable|array $fields the fields to display in inline form
  */
 public function __construct($fragment = 'buttons-before-left', $title = '', $fields = null)
 {
     parent::__construct();
     $this->fragment = $fragment;
     $this->title = $title ?: _t('GridFieldExtensions.ADD', 'Add');
     $this->fields = $fields;
     $this->cache = \SS_Cache::factory($this->getCacheKey(['holder' => __CLASS__]), 'Output', ['lifetime' => 6 * 60 * 60]);
 }
 /**
  * @param string $groupField
  * @param string $groupFieldLabel
  * @param string $groupUnassignedName
  * @param array $groupsAvailable
  */
 public function __construct($groupField = 'Group', $groupFieldLabel = 'Group', $groupUnassignedName = '[none/inactive]', $groupsAvailable = array())
 {
     parent::__construct();
     $this->groupField = $groupField;
     $this->groupFieldLabel = $groupFieldLabel;
     $this->groupUnassignedName = $groupUnassignedName;
     $this->groupsAvailable = $groupsAvailable;
 }
 /**
  * @param string $parentController
  * @param string $urlSegment
  * @param string $recordClass
  */
 public function __construct($parentController, $urlSegment, $recordClass = null)
 {
     $this->parentController = $parentController;
     $this->urlSegment = $urlSegment;
     if ($recordClass) {
         $this->recordClass = $recordClass;
     }
     parent::__construct();
 }
Пример #9
0
	/**
	 * Create a new field.
	 * @param name The internal field name, passed to forms.
	 * @param title The field label.
	 * @param value The value of the field.
	 * @param form Reference to the container form
	 * @param maxLength The Maximum length of the attribute
	 */
	function __construct($name, $title = null, $value = null, $form = null, $rightTitle = null) {
		$this->name = $name;
		$this->title = ($title === null) ? $name : $title;

		if(isset($value)) $this->value = $value;
		if($form) $this->setForm($form);

		parent::__construct();
	}
 public function __construct($gridfield, $component, $record, $controller, $name, $formorfields)
 {
     $this->gridfield = $gridfield;
     $this->component = $component;
     $this->record = $record;
     $this->controller = $controller;
     $this->name = $name;
     $this->formorfields = $formorfields;
     parent::__construct();
 }
 /**
  * Create a new field.
  * @param name The internal field name, passed to forms.
  * @param title The field label.
  * @param value The value of the field.
  * @param form Reference to the container form
  * @param maxLength The Maximum length of the attribute
  */
 function __construct($name, $title = null, $value = null, $form = null, $rightTitle = null)
 {
     $this->name = $name;
     $this->title = $title === null ? $name : $title;
     if ($value !== NULL) {
         $this->setValue($value);
     }
     if ($form) {
         $this->setForm($form);
     }
     parent::__construct();
 }
Пример #12
0
 /**
  *
  * @param GridFIeld $gridField
  * @param GridField_URLHandler $component
  * @param DataObject $record
  * @param RequestHandler $requestHandler
  * @param string $popupFormName
  */
 public function __construct($gridField, $component, $record, $requestHandler, $popupFormName)
 {
     $this->gridField = $gridField;
     $this->component = $component;
     $this->record = $record;
     $this->popupController = $requestHandler;
     $this->popupFormName = $popupFormName;
     parent::__construct();
 }
Пример #13
0
 /**
  * Creates a new field.
  *
  * @param string $name The internal field name, passed to forms.
  * @param string $title The human-readable field label.
  * @param mixed $value The value of the field.
  */
 public function __construct($name, $title = null, $value = null)
 {
     $this->name = $name;
     $this->title = $title === null ? self::name_to_label($name) : $title;
     if ($value !== NULL) {
         $this->setValue($value);
     }
     parent::__construct();
 }
Пример #14
0
 public function __construct($parent, $folderName = null)
 {
     $this->parent = $parent;
     $this->folderName = $folderName;
     parent::__construct();
 }
 function __construct($controller, $name)
 {
     parent::__construct();
     Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
     Requirements::javascript(SAPPHIRE_DIR . "/javascript/tiny_mce_improvements.js");
     Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/jquery-form/jquery.form.js");
     Requirements::javascript(SAPPHIRE_DIR . "/javascript/HtmlEditorField.js");
     $this->controller = $controller;
     $this->name = $name;
 }
 /**
  * Buidls the request
  * @param GridFieldBetterButtonsItemRequest $parent     The extension instance
  * @param GridFieldDetailForm_ItemRequest $controller The request that points to the detail form
  */
 public function __construct($parent, $controller, $form)
 {
     $this->parent = $parent;
     $this->controller = $controller;
     $this->form = $form;
     $this->record = $this->controller->record;
     parent::__construct();
 }
 function __construct($parent, $item, $fields = null, $actions = null, $defaultAction = null)
 {
     parent::__construct();
     $this->parent = $parent;
     $this->item = $item;
     $this->setFields($fields);
     $this->setActions($actions);
     $this->setDefaultAction($defaultAction);
 }
Пример #18
0
 /**
  * Create a new form, with the given fields an action buttons.
  * 
  * @param Controller $controller The parent controller, necessary to create the appropriate form action tag.
  * @param String $name The method on the controller that will return this form object.
  * @param FieldList $fields All of the fields in the form - a {@link FieldList} of {@link FormField} objects.
  * @param FieldList $actions All of the action buttons in the form - a {@link FieldLis} of
  *                           {@link FormAction} objects
  * @param Validator $validator Override the default validator instance (Default: {@link RequiredFields})
  */
 public function __construct($controller, $name, FieldList $fields, FieldList $actions, $validator = null)
 {
     parent::__construct();
     if (!$fields instanceof FieldList) {
         throw new InvalidArgumentException('$fields must be a valid FieldList instance');
     }
     if (!$actions instanceof FieldList) {
         throw new InvalidArgumentException('$actions must be a valid FieldList instance');
     }
     if ($validator && !$validator instanceof Validator) {
         throw new InvalidArgumentException('$validator must be a Validator instance');
     }
     $fields->setForm($this);
     $actions->setForm($this);
     $this->fields = $fields;
     $this->actions = $actions;
     $this->controller = $controller;
     $this->name = $name;
     if (!$this->controller) {
         user_error("{$this->class} form created without a controller", E_USER_ERROR);
     }
     // Form validation
     $this->validator = $validator ? $validator : new RequiredFields();
     $this->validator->setForm($this);
     // Form error controls
     $this->setupFormErrors();
     // Check if CSRF protection is enabled, either on the parent controller or from the default setting. Note that
     // method_exists() is used as some controllers (e.g. GroupTest) do not always extend from Object.
     if (method_exists($controller, 'securityTokenEnabled') || method_exists($controller, 'hasMethod') && $controller->hasMethod('securityTokenEnabled')) {
         $securityEnabled = $controller->securityTokenEnabled();
     } else {
         $securityEnabled = SecurityToken::is_enabled();
     }
     $this->securityToken = $securityEnabled ? new SecurityToken() : new NullSecurityToken();
 }
Пример #19
0
 public function __construct($next)
 {
     parent::__construct($next);
 }
Пример #20
0
 function __construct($ctf, $itemID)
 {
     $this->ctf = $ctf;
     $this->itemID = $itemID;
     parent::__construct();
 }
Пример #21
0
	/**
	 * Create a new form, with the given fields an action buttons.
	 * 
	 * @param Controller $controller The parent controller, necessary to create the appropriate form action tag.
	 * @param String $name The method on the controller that will return this form object.
	 * @param FieldSet $fields All of the fields in the form - a {@link FieldSet} of {@link FormField} objects.
	 * @param FieldSet $actions All of the action buttons in the form - a {@link FieldSet} of {@link FormAction} objects
	 * @param Validator $validator Override the default validator instance (Default: {@link RequiredFields})
	 */
	function __construct($controller, $name, FieldSet $fields, FieldSet $actions, $validator = null) {
		parent::__construct();

		foreach($fields as $field) $field->setForm($this);
		foreach($actions as $action) $actions->setForm($this);

		$this->fields = $fields;
		$this->actions = $actions;
		$this->controller = $controller;
		$this->name = $name;
		
		if(!$this->controller) user_error("$this->class form created without a controller", E_USER_ERROR);

		// Form validation
		$this->validator = ($validator) ? $validator : new RequiredFields();
		$this->validator->setForm($this);

		// Form error controls
		$this->setupFormErrors();
		
		$this->security = self::$default_security;
	}
Пример #22
0
 public function __construct(Presentation $presentation, PresentationAPI $parent)
 {
     parent::__construct();
     $this->presentation = $presentation;
     $this->parent = $parent;
 }
 public function __construct($parent, $name)
 {
     $this->parent = $parent;
     $this->name = $name;
     parent::__construct();
 }
Пример #24
0
 /**
  * Creates a new field.
  *
  * @param string $name The internal field name, passed to forms.
  * @param null|string $title The human-readable field label.
  * @param mixed $value The value of the field.
  */
 public function __construct($name, $title = null, $value = null)
 {
     $this->name = $name;
     if ($title === null) {
         $this->title = self::name_to_label($name);
     } else {
         $this->title = $title;
     }
     if ($value !== null) {
         $this->setValue($value);
     }
     parent::__construct();
     $this->setupDefaultClasses();
 }
 public function __construct($controller, $name)
 {
     parent::__construct();
     $this->controller = $controller;
     $this->name = $name;
 }
 /**
  * @param string $sortField
  */
 public function __construct($sortField = 'Sort')
 {
     parent::__construct();
     $this->sortField = $sortField;
 }
 public function __construct($dashboard, $panel, $editor, $item)
 {
     $this->dashboard = $dashboard;
     $this->panel = $panel;
     $this->editor = $editor;
     $this->item = $item;
     parent::__construct();
 }
 /**
  * Constructor, sets the parent and file
  * 
  * @param KickAssets $parent
  * @param File       $file
  */
 public function __construct(KickAssets $parent, File $file)
 {
     parent::__construct();
     $this->parent = $parent;
     $this->file = $file;
 }
 public function __construct($controller, $name)
 {
     parent::__construct();
     Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/jquery/jquery.js");
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js');
     Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/ssui.core.js');
     HtmlEditorConfig::require_js();
     Requirements::javascript(FRAMEWORK_DIR . "/javascript/HtmlEditorField.js");
     Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
     $this->controller = $controller;
     $this->name = $name;
 }
Пример #30
0
 /**
  * Constructor for the request
  * 
  * @param   $speaker PresentationSpeaker The speaker being updated
  * @param   $parent PresentationPage_ManageRequest The parent controller
  */
 public function __construct(PresentationSpeaker $speaker, PresentationPage_ManageRequest $parent)
 {
     parent::__construct();
     $this->speaker = $speaker;
     $this->parent = $parent;
 }