public function __construct($behavior, $options = array(), $CSRFSecret = null)
 {
     if (!$behavior instanceof DmBehavior) {
         throw new dmException(sprintf('%s must be initialized with a DmBehavior, not a %s', get_class($this), gettype($behavior)));
     }
     $this->dmBehavior = $behavior;
     // disable CSRF protection
     parent::__construct(array_merge($behavior->getValues(), array('dm_behavior_enabled' => $behavior->getDmBehaviorEnabled())), $options, false);
 }
예제 #2
0
 /**
  * Constructor.
  *
  * @param dmWidget $widget    A widget
  * @param array  $options     An array of options
  * @param string $CSRFSecret  A CSRF secret (false to disable CSRF protection, null to use the global CSRF secret)
  */
 public function __construct($widget, $options = array(), $CSRFSecret = null)
 {
     if (!$widget instanceof DmWidget) {
         throw new dmException(sprintf('%s must be initialized with a DmWidget, not a %s', get_class($this), gettype($widget)));
     }
     $this->dmWidget = $widget;
     // disable CSRF protection
     parent::__construct($widget->values, $options, false);
 }
 public function __construct($behaviors, $options = array(), $CSRFSecret = null)
 {
     $behaviorsManager = $this->getService('behaviors_manager');
     $tmp = array();
     foreach ($behaviors as $behavior) {
         try {
             $settings = $behaviorsManager->getBehaviorSettings($behavior['dm_behavior_key']);
         } catch (Exception $e) {
             throw new dmException($this->getI18n()->__('The behavior type with key %key% that you are trying to sort does not exist.', array('%key%' => $behavior['dm_behavior_key'])));
         }
         $tmp[] = array('dm_behavior_id' => $behavior['id'], 'dm_behavior_key' => $behavior['dm_behavior_key'], 'dm_behavior_name' => $this->getI18n()->__($settings['name']), 'dm_behavior_icon' => $settings['icon'], 'dm_behavior_attached_to' => $this->getI18n()->__($behavior['dm_behavior_attached_to']), 'dm_behavior_attached_to_id' => $behavior['dm_page_id'] + $behavior['dm_area_id'] + $behavior['dm_zone_id'] + $behavior['dm_widget_id'], 'dm_behavior_attached_to_selector' => $behavior['dm_behavior_attached_to_selector'], 'dm_behavior_sequence' => $behavior['position']);
     }
     $this->behaviors = $tmp;
     parent::__construct(array('behaviors' => json_encode($tmp)), $options, false);
 }
예제 #4
0
 public function __construct(dmDoctrineRecord $record = null)
 {
     $this->record = $record;
     parent::__construct();
 }
예제 #5
0
 public function __construct($folder, $options = array(), $CSRFSecret = null)
 {
     $this->folder = $folder;
     parent::__construct(array('id' => $folder->id, 'parent_id' => $folder->nodeParentId), $options);
 }
예제 #6
0
 /**
  * @see sfForm
  */
 public function __construct(dmAdminPageMetaView $metaView, $options = array(), $CSRFSecret = null)
 {
     $this->metaView = $metaView;
     return parent::__construct(array(), $options, $CSRFSecret);
 }
예제 #7
0
 public function __construct(DmUser $user, array $options = array())
 {
     $this->user = $user;
     parent::__construct(array(), $options);
 }