Ejemplo n.º 1
0
 function __construct($nodeUri)
 {
     parent::__construct($nodeUri);
     $this->add(new ManyToOneRelation('user_id', Attribute::AF_PRIMARY, 'auth.users'));
     $this->add(new ManyToOneRelation('group_id', Attribute::AF_PRIMARY, 'auth.groups'));
     $this->setTable('Users_Groups');
 }
Ejemplo n.º 2
0
 public function __construct($nodeUri, $flags = 0)
 {
     parent::__construct($nodeUri, $flags);
     $this->setTable('testbed_M2MNode');
     $this->setSecurityAlias($this->getModule() . '.playground');
     $this->add(new Attribute('playground_id', Attribute::AF_PRIMARY));
     $this->add(new Attribute('remotetable_id', Attribute::AF_PRIMARY));
 }
Ejemplo n.º 3
0
 public function __construct($nodeUri, $flags = 0)
 {
     parent::__construct($nodeUri, $flags);
     $this->setTable('testbed_O2ONode');
     $this->setSecurityAlias($this->getModule() . '.playground');
     $this->add(new Attribute('id', Attribute::AF_AUTOKEY));
     $this->add(new Attribute('playground_id'));
     $this->add(new Attribute('o2o_name'));
 }
Ejemplo n.º 4
0
 function __construct($nodeUri)
 {
     parent::__construct($nodeUri, Node::NF_ADD_LINK | Node::NF_EDITAFTERADD | Node::NF_IMPORT);
     $this->setTable('TestNode');
     $this->add(new Attribute('id', Attribute::AF_AUTOKEY));
     $this->add(new Attribute('name', Attribute::AF_OBLIGATORY));
     $this->add(new TextAttribute('description'));
     $this->setDescriptorTemplate('[name]');
 }
Ejemplo n.º 5
0
 public function __construct($nodeUri, $flags = 0)
 {
     parent::__construct($nodeUri, $flags);
     $this->setTable('testbed_O2MNode2');
     $this->setSecurityAlias($this->getModule() . '.playground');
     $this->setDescriptorTemplate('[o2mName]');
     $this->add(new Attribute('id', Attribute::AF_AUTOKEY));
     $this->add(new Attribute('playground_id'));
     $this->add(new ListAttribute('o2mName', Attribute::AF_SEARCHABLE, ['test1', 'test']));
 }
Ejemplo n.º 6
0
 public function __construct($nodeUri, $flags = 0)
 {
     parent::__construct($nodeUri, $flags | Node::NF_ADD_LINK);
     $this->setTable('testbed_M2ONode');
     $this->setSecurityAlias($this->getModule() . '.playground');
     $this->add(new Attribute('id', Attribute::AF_AUTOKEY));
     $this->add(new Attribute('m2o_name', Attribute::AF_FORCE_LOAD | Attribute::AF_SEARCHABLE));
     $this->add(new NumberAttribute('numeroA', Attribute::AF_TOTAL | Attribute::AF_SEARCHABLE, 2));
     $this->add(new NumberAttribute('numeroB', Attribute::AF_TOTAL | Attribute::AF_SEARCHABLE, 2));
     $this->setDescriptorTemplate('[m2o_name]');
     //  $this->setDescriptorHandler($this);
 }
Ejemplo n.º 7
0
 function __construct($nodeUri)
 {
     parent::__construct($nodeUri, Node::NF_ADD_LINK | Node::NF_EDITAFTERADD);
     $this->add(new Attribute('id', A::AF_AUTOKEY));
     $this->add(new Attribute('name', A::AF_OBLIGATORY | A::AF_UNIQUE | A::AF_SEARCHABLE));
     $this->add(new TextAttribute('description'));
     $attr = new ShuttleRelation('users', A::AF_HIDE_LIST | A::AF_HIDE_ADD, 'auth.users_groups', 'auth.users');
     $this->add($attr);
     $attr->setLocalKey('group_id');
     $attr->setRemoteKey('user_id');
     $this->add(new ProfileAttribute('accessrights', A::AF_BLANKLABEL | A::AF_HIDE_ADD));
     $this->setTable('Groups');
     $this->setOrder('name');
     $this->setDescriptorTemplate('[name]');
 }
Ejemplo n.º 8
0
 function __construct($nodeUri)
 {
     parent::__construct($nodeUri, Node::NF_ADD_LINK);
     $this->setTable('Users');
     $this->add(new Attribute('id', A::AF_AUTOKEY));
     $this->add(new Attribute('firstname', A::AF_FORCE_LOAD | A::AF_OBLIGATORY | A::AF_SEARCHABLE));
     $this->add(new Attribute('lastname', A::AF_FORCE_LOAD | A::AF_OBLIGATORY | A::AF_SEARCHABLE));
     $this->add(new Attribute('username', A::AF_FORCE_LOAD | A::AF_OBLIGATORY | A::AF_SEARCHABLE | A::AF_UNIQUE));
     $pwdFlags = A::AF_OBLIGATORY | A::AF_HIDE_LIST | PasswordAttribute::AF_PASSWORD_NO_VALIDATE;
     $this->add(new PasswordAttribute('passwd', $pwdFlags, true, 0, ['minalphabeticchars' => 6, 'minnumbers' => 2]));
     $this->add(new EmailAttribute('email'));
     $this->add(new BoolAttribute('disabled', A::AF_SEARCHABLE | A::AF_FORCE_LOAD));
     $attr = new ShuttleRelation('groups', A::AF_SEARCHABLE, 'auth.users_groups', 'auth.groups');
     $this->add($attr);
     $attr->setLocalKey('user_id');
     $attr->setRemoteKey('group_id');
     $this->setOrder('[table].lastname, [table].firstname');
     $this->setDescriptorTemplate('[username]');
 }
Ejemplo n.º 9
0
 /**
  * Constructor.
  *
  * This function is called when a new atkFileEditor is instantiated.
  *
  * @param string $name The name of the node.
  * @param string $dir The directory that the fileeditor lists. If you
  *                       want to enable addition of new files, make sure
  *                       that the webserver has write access to this dir.
  *                       Only regular files (not subdirs or special files)
  *                       are listed.
  * @param string $filter A regular expression that is used to filter which
  *                       files will be shown. Example: '.txt$' lists only
  *                       txt files in the directory.
  *                       Note: This parameter is also used to validate the
  *                       filename of newly created files. This means, you
  *                       cannot create a new file called test.css if your
  *                       filter param is set to '.tpl$';
  *                       Note 2: Watch out when using $ in your regular
  *                       expression; PHP parses this, so use single quotes
  *                       or escape the dollarsign with \.
  * @param int $flags The node flags. See Node for a list of possible
  *                       flags.
  */
 public function __construct($name, $dir = '', $filter = '', $flags = 0)
 {
     parent::__construct($name, $flags | Node::NF_ADD_LINK);
     $this->m_dir = $dir;
     $this->m_basedir = $dir;
     if ($dir == '') {
         $this->m_dir = './';
     }
     // dir must have a trailing slash.
     if (substr($this->m_dir, -1) != '/') {
         $this->m_dir .= '/';
     }
     $this->m_filefilter = $filter;
     $this->m_showdirs = true;
     $this->add(new Attribute('filename', Attribute::AF_PRIMARY | Attribute::AF_SEARCHABLE));
     $this->add(new TextAttribute('filecontent', 30, Attribute::AF_HIDE_LIST));
     $this->addSecurityMap('dirchange', 'admin');
     $this->setOrder('dummy.filename');
     $this->setTable('dummy');
 }
Ejemplo n.º 10
0
 /**
  * Constructor.
  *
  * @param string $type node type (by default the class name)
  * @param int $flags node flags
  *
  * @return DataNode
  */
 public function __construct($type = '', $flags = 0)
 {
     parent::__construct($type, $flags | self::NF_NO_ADD | self::NF_NO_EDIT);
     $this->setTable($this->m_type);
 }
Ejemplo n.º 11
0
 /**
  * Constructor.
  *
  * @param string $name Node name
  * @param int $flags Node flags
  */
 public function __construct($name, $flags = 0)
 {
     parent::__construct($name, $flags);
 }
Ejemplo n.º 12
0
 function __construct($nodeUri)
 {
     parent::__construct($nodeUri, Node::NF_ADD_LINK);
     $this->setTable('testbed_Playground');
     $this->add(new Attribute('id', A::AF_AUTOKEY));
     /** tab ************************/
     $tab = 'default';
     //test tabbed pane
     $this->add(new Attribute('Attribute'), $tab);
     $this->add(new BoolAttribute('BoolAttribute'), $tab);
     $this->add(new CalculatorAttribute('CalculatorAttribute', 0, '10*5'), $tab);
     $attr = new DateTimeAttribute('theDateAttribute', A::AF_SEARCHABLE);
     $attr->addOnChangeHandler('console.log("theDateTimeAttribute onchange triggered!");');
     $this->add($attr, 'default');
     // $this->add(new MultiSelectAttribute('MultiSelectAttribute', A::AF_SEARCHABLE, ['option1', 'option2', 'option3'],
     //     ['option1val', 'option2val', 'option3val']), $tab);
     $attr = new ListAttribute('theListAttribute', A::AF_SEARCHABLE, ['testo lungo della option_4', 'option_5', 'testo lungo della option_6'], [4, 5, 6]);
     $attr->setWidth('300px');
     $attr->addDependency([$this, 'theListAttributeDependency']);
     $this->add($attr, "tab2");
     $attr = new ListAttribute('theListAttribute2', A::AF_SEARCHABLE, ['testo lungo della option_4', 'option_5', 'testo lungo della option_6'], [4, 5, 6]);
     $attr->setWidth('300px');
     $this->add($attr);
     $attr = new ManyToOneRelation('FM2O', A::AF_LARGE | A::AF_SEARCHABLE, $this->getModule() . '.m2o_node');
     //attr->setWidth('300px');
     //$attr->addDestinationFilter('id = 1');
     // $attr->setAutoSearch(true);
     //$attr->addOnChangeHandler('console.log("onchange triggered!");');
     //$attr->addDependency([$this, 'theListAttributeDependency']);
     $this->add($attr);
     /*
             $attr = new MultiSelectListAttribute('theMultiSelectListAttribute', A::AF_SEARCHABLE,
                 ['testo lungo della option_4', 'option_5', 'testo lungo della option_6'], [4, 5, 6]);
             //$attr->setWidth('300px');
             $this->add($attr);
     
     
             $this->add(new TabbedPane('tabbedpane', 0, ['tab1' => ['Attribute'], 'tab2' => ['BoolAttribute', 'CalculatorAttribute', 'theListAttribute2']]));
     */
     return true;
     // ListAttribute::AF_LIST_OBLIGATORY_NULL_ITEM |
     $attr = new ListAttribute('theListAttribute2', A::AF_OBLIGATORY | A::AF_SEARCHABLE, ['testo lungo della option_4', 'option_5', 'testo lungo della option_6'], [4, 5, 6]);
     $this->add($attr, $tab);
     //$this->add(new PasswordAttribute('PasswordAttribute', PasswordAttribute::AF_PASSWORD_NO_VALIDATE, true, ['minnumbers' => 2, 'minalphabeticchars' => 6]), $tab);
     return true;
     $this->add(new OneToManyRelation('the1OneToManyRelation', A::AF_SEARCHABLE, $this->getModule() . '.o2m_node', 'playground_id'), $tab);
     $this->add(new OneToManyRelation('the2OneToManyRelation', A::AF_SEARCHABLE, $this->getModule() . '.o2m_node2', 'playground_id'), $tab);
     for ($i = 0; $i < 10; $i++) {
         $this->add(new ExpressionAttribute('ExpressionAttribute' . $i, A::AF_SEARCHABLE, 'SELECT 5', 'number'), $tab);
     }
     return;
     //$tab = 'tab_2';
     $attr = new ListAttribute('theListAttribute', ListAttribute::AF_LIST_OBLIGATORY_NULL_ITEM | A::AF_OBLIGATORY | A::AF_SEARCHABLE, ['option_1', 'option_2', 'option_3'], [1, 2, 3]);
     $attr->addDependency([$this, 'theListAttributeDependency']);
     $this->add($attr, $tab);
     return;
     $attr = new DateTimeAttribute('theDateTimeAttribute', A::AF_SEARCHABLE);
     //$attr->setEmptyValue(-1);
     $attr->setAutoSearch(true);
     $attr->addOnChangeHandler("console.log(el);");
     $this->add($attr, $tab);
     $this->add(new Attribute('Attribute'), $tab);
     $this->add(new BoolAttribute('BoolAttribute'), $tab);
     $this->add(new CalculatorAttribute('CalculatorAttribute', 0, '10*5'), $tab);
     $this->add(new CkAttribute('CkAttribute'), $tab);
     $this->add(new ColorPickerAttribute('ColorPickerAttribute'), $tab);
     $this->add(new CountryAttribute('CountryAttribute'), $tab);
     $this->add(new CreatedByAttribute('CreatedByAttribute'), $tab);
     $this->add(new CreateStampAttribute('CreateStampAttribute'), $tab);
     /** tab ************************/
     $tab = "tab_2";
     $this->add(new CurrencyAttribute('CurrencyAttribute'), $tab);
     $this->add(new DummyAttribute('DummyAttribute'), $tab);
     $this->add(new DurationAttribute('DurationAttribute'), $tab);
     $this->add(new EmailAttribute('EmailAttribute'), $tab);
     //$this->add(new ExpressionAttribute('ExpressionAttribute', 0, 'SELECT "test expression"'), $tab);
     $this->add(new IpAttribute('IpAttribute'), $tab);
     /** tab ************************/
     $tab = "tab_3";
     $this->add(new DummyAttribute('FieldSet_dummy1', A::AF_NO_LABEL, 'FieldSet_dummy1_content'), $tab);
     $this->add(new DummyAttribute('FieldSet_dummy2', A::AF_NO_LABEL, 'FieldSet_dummy2_content'), $tab);
     $this->add(new FieldSet('FieldSet', 0, '[FieldSet_dummy1] e [FieldSet_dummy2]'), $tab);
     $this->add(new FileAttribute('FileAttribute', 0, [Config::getGlobal('application_dir') . 'web/files/', '/files/']), $tab);
     $this->add(new FileWriterAttribute('FileWriterAttribute', 0, Config::getGlobal('application_dir') . 'web/files/filewriterfile.txt'), $tab);
     $this->add(new FlagAttribute('FlagAttribute', 0, ['option_with_1', 'option_with_2', 'option_with_4'], [1, 2, 4]), $tab);
     $this->add(new FormatAttribute('FormatAttribute', 0, 'AAA/##/##'), $tab);
     //TODO: FuzzySearchAttribute: test
     // $this->add(new FuzzySearchAttribute('FuzzySearchAttribute'), $tab);
     $this->add(new HiddenAttribute('HiddenAttribute'), $tab);
     $this->add(new HtmlAttribute('HtmlAttribute'), $tab);
     /** tab ************************/
     $tab = "tab_4";
     $this->add(new Attribute('LiveTextPreviewAttributeMaster'), $tab);
     $this->add(new LiveTextPreviewAttribute('LiveTextPreviewAttribute', 0, 'LiveTextPreviewAttributeMaster'), $tab);
     $this->add(new MultipleFileAttribute('MultipleFileAttribute', 0, [Config::getGlobal('application_dir') . 'web/multiplefiles/', '/multiplefiles/']), $tab);
     $this->add(new NumberAttribute('NumberAttribute', 0, 20, 2), $tab);
     $this->add(new ParserAttribute('ParserAttribute', 0, 'NumberAttribute is: [NumberAttribute]'), $tab);
     $this->add(new PasswordAttribute('PasswordAttribute'), $tab);
     $this->add(new RadioAttribute('RadioAttribute', 0, ['option_1', 'option_2', 'option_3']), $tab);
     /** tab ************************/
     $tab = "tab_5";
     $this->add(new RowCounterAttribute('RowCounterAttribute'), $tab);
     $this->add(new StateAttribute('StateAttribute'), $tab);
     $this->add(new SwitchAttribute('SwitchAttribute'), $tab);
     //TODO: TabbedPane: test
     //$this->add(new TabbedPane('TabbedPane'), $tab);
     //TODO: TagAttribute: test
     //$this->add(new TagAttribute('TagAttribute'), $tab);
     $this->add(new TextAttribute('TextAttribute'), $tab);
     $this->add(new TimeAttribute('TimeAttribute'), $tab);
     $this->add(new TimeZoneAttribute('TimeZoneAttribute'), $tab);
     $this->add(new UpdatedByAttribute('UpdatedByAttribute'), $tab);
     $this->add(new UpdateStampAttribute('UpdateStampAttribute'), $tab);
     $this->add(new UrlAttribute('UrlAttribute'), $tab);
     $this->add(new WeekdayAttribute('WeekdayAttribute'), $tab);
     /** RELATIONS **/
     /** tab ************************/
     $tab = "tab_6";
     $this->add(new OneToOneRelation('OneToOneRelation', 0, $this->getModule() . '.o2o_node', 'playground_id'), $tab);
     $rel = new ShuttleRelation('ShuttleRelation', 0, $this->getModule() . '.m2m_node', $this->getModule() . '.m2o_node');
     $rel->setLocalKey('playground_id');
     $rel->setRemoteKey('remotetable_id');
     $this->add($rel, $tab);
 }