예제 #1
0
 function handle_event($ev)
 {
     $id = $ev->context[$ev->parent_name]['retv'];
     switch ($ev->rem_name) {
         case 'util_small_pager_test.ed_count':
             print "\$i('" . js_escape($id) . "').innerHTML='" . js_escape(htmlspecialchars("ed_count: " . $_POST['val'], ENT_QUOTES)) . "';";
             break;
         case 'util_small_pager_test.ed_offset':
             print "\$i('" . js_escape($id) . "').innerHTML='" . js_escape(htmlspecialchars("ed_count: " . $_POST['val'], ENT_QUOTES)) . "';";
             break;
     }
     editor_generic::handle_event($ev);
 }
예제 #2
0
파일: index.php 프로젝트: vladisslav2011/nb
 function handle_event($ev)
 {
     switch ($ev->rem_name) {
         //handle root object events here
         case 'design':
             $_SESSION['sqldesign'] = $_POST['val'];
             print 'window.location.reload(true);';
             break;
             $r = new $this->list_class();
             //$r->picklist=unserialize($ev->context[$ev->parent_name]['picklist']);
             //print 'chse.safe_alert(123,\''.$ev->parent_type.'\');';
             //exit;
             $r->etype = $ev->parent_type;
             $r->context =& $ev->context;
             $r->for_each_set('oid', $ev->context[$ev->parent_name]['oid']);
             $r->name =& $ev->parent_name;
             $r->keys =& $ev->keys;
             $r->bootstrap();
             print "var res=\$i('" . js_escape($ev->context[$ev->long_name]['res_div']) . "');" . "chse.safe_alert(123,res.style.display);" . "if(res.style.display!='none')" . "{" . "res.style.display='none';" . "}else{" . "res.style.display='block';" . "try{res.innerHTML=" . reload_object($r) . "}catch(e){window.location.reload(true);};};";
             return true;
         default:
     }
     editor_generic::handle_event($ev);
 }
예제 #3
0
 function handle_event($ev)
 {
     $oid = $ev->context[$ev->long_name]['oid'];
     $customid = $ev->context[$ev->parent_name]['htmlid'];
     $this->path = $ev->keys['path'];
     $io_name = $ev->rem_name != 'result_button' ? preg_replace('/\\.[^.]+$/', '', $ev->parent_name) : $ev->parent_name;
     $io_name = preg_replace('/\\.[^.]+$/', '', $ev->parent_name);
     $ioclass = $ev->context[$io_name]['ioclass'];
     $customid = $ev->context[$ev->parent_name]['htmlid'];
     //print "\n\n/* ".$customid." */\n\n";
     //$oid=$ev->context[$io_name]['oid'];
     //print 'oid='.$oid;
     $this->ioclass = new $ioclass();
     $this->ioclass->context =& $ev->context;
     $this->ioclass->oid = $oid;
     $this->ioclass->long_name = $io_name;
     $this->obj = $this->ioclass->load();
     $this->curr = workers_container::find_by_path($this->path, $this->obj);
     $reload = false;
     switch ($ev->rem_name) {
         case 'clean':
             //$this->obj=;
             workers_container::change_by_path(new query_gen_ext(), $this->path);
             $this->ioclass->save($this->obj);
             //print 'window.location.reload(true);';
             $reload = true;
             break;
         case 'limit_count':
             $this->curr->lim_count = $_POST['val'];
             $this->ioclass->save($this->obj);
             break;
         case 'limit_skip':
             $this->curr->lim_offset = $_POST['val'];
             $this->ioclass->save($this->obj);
             break;
         case 'result_button':
             $res = $this->obj->result();
             $result_div_id = $ev->context[$ev->parent_name]['result_div_id'];
             print "\$i('" . $result_div_id . "').innerHTML='" . js_escape(htmlspecialchars($res)) . "';";
             break;
     }
     if ($reload) {
         $r = new workers_container();
         //$r->obj=&$this->obj;// not required
         $r->path =& $this->path;
         $r->name = preg_replace('/\\.[^.]+$/', '', $ev->parent_name);
         $r->etype = preg_replace('/\\.[^.]+$/', '', $ev->parent_type);
         $r->context = $ev->context;
         $r->oid = $oid;
         $r->custom_id = $customid;
         $r->bootstrap();
         print "var a=\$i('" . js_escape($customid) . "');try{a.innerHTML=";
         reload_object($r, true);
         print "}catch(e){ window.location.reload(true);};";
     }
     editor_generic::handle_event($ev);
 }
예제 #4
0
 function handle_event($ev)
 {
     editor_generic::handle_event($ev);
 }
예제 #5
0
 function handle_event($ev)
 {
     if ($ev->rem_name == 'm_id') {
         $this->add_map($ev->keys['id'], $_POST['val']);
     }
     if ($ev->rem_name == 'm_del') {
         $this->del_map($ev->keys['id']);
     }
     editor_generic::handle_event($ev);
 }
예제 #6
0
 function bootstrap()
 {
     //$this->picklist=$this->context
     $this->long_name = $long_name = editor_generic::long_name();
     $this->context[$long_name . '.text']['var'] = 'name';
     $this->context[$long_name . '.btn']['var'] = 'id';
 }
예제 #7
0
 function bootstrap()
 {
     $this->long_name = editor_generic::long_name();
     if (!is_array($this->editors)) {
         return;
     }
     foreach ($this->editors as $i => $e) {
         $this->context[$this->long_name . '.' . $i]['var'] = $i;
         $e->context =& $this->context;
         $e->keys =& $this->keys;
         $e->args =& $this->args;
         $e->oid = $this->oid;
     }
     foreach ($this->editors as $i => $e) {
         $e->bootstrap();
     }
     $this->rootnode->endscripts['test_long_run'] = "function status_fetch()" . "{" . "async_get('/ext/test_long_run.php',function(){if ((xmlHttp.readyState == 4)&&(xmlHttp.status == 200))\$i('" . $this->status->id_gen() . "').textContent=xmlHttp.responseText;});" . "}" . "setInterval('status_fetch();',1000);" . "";
 }
예제 #8
0
 function bootstrap()
 {
     $this->long_name = editor_generic::long_name();
 }
예제 #9
0
 function handle_event($event)
 {
     global $sql;
     if ($event->rem_name == 'submit') {
         $r = unserialize($_POST['val']);
         //print 'alert(\''.js_escape(serialize($r[1][0]['ok'])).'\');';
         //print 'alert(\''.js_escape(serialize($t)).'\');';
         for ($y = 1; $y <= keyboard_test::TEST_NUM; $y++) {
             $q = new query_gen_ext('INSERT UPDATE');
             $q->into->exprs[] = new sql_column(NULL, 'keyboard_test');
             $q->set->exprs[] = new sql_expression('=', array(new sql_column(NULL, NULL, 'user-agent'), new sql_immed($_SERVER['HTTP_USER_AGENT'])));
             $q->set->exprs[] = new sql_expression('=', array(new sql_column(NULL, NULL, 'testn'), new sql_immed($y)));
             $q->set->exprs[] = new sql_expression('=', array(new sql_column(NULL, NULL, 'keypress-result'), new sql_immed($r[$y][0]['ok'] == 1 ? $r[$y][0]['cnt'] . '/' . $r[$y][0]['kc'] . '/' . $r[$y][0]['cc'] . '/' . $r[$y][0]['wh'] : 'n')));
             $q->set->exprs[] = new sql_expression('=', array(new sql_column(NULL, NULL, 'keydown-result'), new sql_immed($r[$y][1]['ok'] == 1 ? $r[$y][1]['cnt'] . '/' . $r[$y][1]['kc'] . '/' . $r[$y][1]['cc'] . '/' . $r[$y][1]['wh'] : 'n')));
             $q->set->exprs[] = new sql_expression('=', array(new sql_column(NULL, NULL, 'keyup-result'), new sql_immed($r[$y][2]['ok'] == 1 ? $r[$y][2]['cnt'] . '/' . $r[$y][2]['kc'] . '/' . $r[$y][2]['cc'] . '/' . $r[$y][2]['wh'] : 'n')));
             $sql->query($q->result());
         }
     }
     editor_generic::handle_event($event);
 }
예제 #10
0
 function bootstrap()
 {
     editor_generic::bootstrap_part();
     $this->attributes['onmouseup'] = "if(resizer && resizer.obj && resizer.obj==this)chse.send_or_push({static:'" . $this->send . "',val:this.clientWidth+'x'+this.clientHeight});";
 }
예제 #11
0
 function handle_event($ev)
 {
     global $sql;
     $oid = $ev->context[$ev->parent_name]['oid'];
     switch ($ev->rem_name) {
         case 'default_map':
         case 'reset_map':
         case 'direct_map':
             $parent_name = preg_replace('/\\.[^.]+$/', '', $ev->parent_name);
             $setting_tool = new settings_tool();
             $mapping = unserialize($sql->fetch1($sql->query($setting_tool->single_query($oid, $parent_name . '!txlumapping', $_SESSION['uid'], 0))));
             $collist = $ev->context[$ev->long_name]['collist'];
             $self_id = $ev->context[$ev->long_name]['self_id'];
             $src_rows = $ev->context[$ev->long_name]['src_rows'];
             $cnt = 0;
             foreach ($collist as $r => $v) {
                 $c_i[$cnt++] = $r;
             }
             $c2 = 0;
             foreach ($src_rows as $r) {
                 switch ($ev->rem_name) {
                     case 'default_map':
                         $mapping[$c_i[$c2++]] = $r;
                         break;
                     case 'reset_map':
                         unset($mapping[$c_i[$c2++]]);
                         break;
                     case 'direct_map':
                         if (isset($src_rows[$c_i[$c2]])) {
                             $mapping[$c_i[$c2]] = $c_i[$c2];
                         } else {
                             unset($mapping[$c_i[$c2]]);
                         }
                         $c2++;
                         break;
                 }
             }
             unset($mapping['']);
             $sql->query($setting_tool->set_query($oid, $parent_name . '!txlumapping', $_SESSION['uid'], 0, serialize($mapping)));
             break;
     }
     editor_generic::handle_event($ev);
 }
예제 #12
0
 function handle_event($ev)
 {
     /*		if($ev->rem_name=='name')
     		{
     			$ev->current->attributes[$ev->keys['css_style']]->name=$_POST['val'];
     			$ev->do_store=true;
     		}*/
     editor_generic::handle_event($ev);
 }