function create($m, $n = null)
 {
     $a = new DRW(func_get_args());
     $a->next();
     $r = new DRW();
     $this->explorer($a, $r);
     return cEle($a->get(0), $r)->set_methods(function ($ref, $n, $args) {
         if ($n == 'setLegend') {
             $legend = cEle('legend');
             foreach ($args as $v) {
                 if (isDrw($v) && OBJ($v)) {
                     foreach ($v as $i => $v1) {
                         $legend->do_method(array($i => $v1));
                     }
                 }
             }
             $ref->addChild($legend);
         }
         if ($n == 'add_option') {
             $e = cEle('option');
             foreach (args_level_1($args) as $v) {
                 if (isDrw($v)) {
                     foreach ($v as $i => $v1) {
                         $e->do_method(array($i => $v1));
                     }
                 } else {
                     if (!$e->attr('value')) {
                         $e->attr('value', $v);
                     } else {
                         $e->html($v);
                     }
                     $ref->addChild($e);
                 }
             }
         }
         if ($n == 'add_options') {
             foreach ($args as $v) {
                 $ref->add_option($v);
             }
         }
     });
 }
示例#2
0
 private function pos_and_or($args)
 {
     $a = new DRW(func_get_args());
     $opt = $a->first();
     $a->next();
     foreach ($a->O as $v) {
         if ($opt[1] == 'or' && $this->pos($v) !== false) {
             return true;
         }
         if ($opt[1] == 'and' && $this->pos($v) === false) {
             return false;
         }
     }
     if ($opt[1] == 'or') {
         return false;
     }
     if ($opt[1] == 'and') {
         return true;
     }
 }