Exemple #1
0
 /**
  * @see FWS_Module::run()
  */
 public function run()
 {
     $tpl = FWS_Props::get()->tpl();
     $input = FWS_Props::get()->input();
     $cookies = FWS_Props::get()->cookies();
     $scope = $input->get_var('scope', -1, FWS_Input::STRING);
     $name = $input->get_var('name', -1, FWS_Input::STRING);
     $url = PC_URL::get_mod_url();
     $url->set('scope', $scope);
     $url->set('name', $name);
     $surl = clone $url;
     $total = PC_DAO::get_vars()->get_count_for($scope, $name);
     $pagination = new PC_Pagination(PC_ENTRIES_PER_PAGE, $total);
     $pagination->populate_tpl($url);
     $start = $pagination->get_start();
     $vars = array();
     foreach (PC_DAO::get_vars()->get_list($start, PC_ENTRIES_PER_PAGE, $scope, $name) as $var) {
         /* @var $var PC_Obj_Variable */
         $url = PC_URL::get_mod_url('file');
         $url->set('path', $var->get_file());
         $url->set('line', $var->get_line());
         $url->set_anchor('l' . $var->get_line());
         $vscope = $var->get_scope();
         if ($vscope == PC_Obj_Variable::SCOPE_GLOBAL) {
             $vscope = '<i>Global</i>';
         }
         $vars[] = array('id' => $var->get_id(), 'scope' => $vscope, 'name' => '$' . $var->get_name(), 'type' => $var->get_type(), 'file' => $var->get_file(), 'line' => $var->get_line(), 'url' => $url->to_url());
     }
     $callurl = PC_URL::get_mod_url('filepart');
     $callurl->set('id', '__ID__');
     $callurl->set('type', 'var');
     $this->request_formular();
     $tpl->add_variables(array('vars' => $vars, 'get_code_url' => $callurl->to_url(), 'scope' => $scope, 'name' => $name, 'search_target' => $surl->to_url(), 'display_search' => $cookies->get_cookie('vars_search') ? 'block' : 'none', 'cookie_name' => $cookies->get_prefix() . 'vars_search'));
 }
 /**
  * @see FWS_Module::run()
  */
 public function run()
 {
     $tpl = FWS_Props::get()->tpl();
     $input = FWS_Props::get()->input();
     $cookies = FWS_Props::get()->cookies();
     $file = $input->get_var('file', -1, FWS_Input::STRING);
     $class = $input->get_var('class', -1, FWS_Input::STRING);
     $url = PC_URL::get_submod_url();
     $url->set('file', $file);
     $url->set('class', $class);
     $surl = clone $url;
     $pagination = new PC_Pagination(PC_ENTRIES_PER_PAGE, PC_DAO::get_classes()->get_count_for($class, $file));
     $pagination->populate_tpl($url);
     $start = $pagination->get_start();
     $classes = array();
     foreach (PC_DAO::get_classes()->get_list($start, PC_ENTRIES_PER_PAGE, $class, $file) as $c) {
         $sig = $c->get_signature(true);
         $sig = preg_replace_callback('/#(.+?)#/', function ($match) {
             return "<a href=\"" . PC_URL::get_mod_url('class')->set('name', $match[1])->to_url() . "\">" . $match[1] . "</a>";
         }, $sig);
         $classes[] = array('name' => $sig, 'file' => $c->get_file(), 'line' => $c->get_line(), 'since' => implode(', ', $c->get_version()->get_min()), 'till' => implode(', ', $c->get_version()->get_max()));
     }
     $this->request_formular();
     $tpl->add_variables(array('classes' => $classes, 'file' => $file, 'class' => $class, 'search_target' => $surl->to_url(), 'display_search' => $cookies->get_cookie('classes_search') ? 'block' : 'none', 'cookie_name' => $cookies->get_prefix() . 'classes_search'));
 }
 /**
  * @see FWS_Module::run()
  */
 public function run()
 {
     $tpl = FWS_Props::get()->tpl();
     $input = FWS_Props::get()->input();
     $cookies = FWS_Props::get()->cookies();
     $file = $input->get_var('file', -1, FWS_Input::STRING);
     $name = $input->get_var('name', -1, FWS_Input::STRING);
     $url = PC_URL::get_submod_url();
     $url->set('file', $file);
     $url->set('name', $name);
     $surl = clone $url;
     $pagination = new PC_Pagination(PC_ENTRIES_PER_PAGE, PC_DAO::get_constants()->get_count_for(0, $file, $name));
     $pagination->populate_tpl($url);
     $start = $pagination->get_start();
     $consts = array();
     $constants = PC_DAO::get_constants()->get_list(array(0), $file, $name, PC_Project::CURRENT_ID, $start, PC_ENTRIES_PER_PAGE);
     foreach ($constants as $const) {
         $url = PC_URL::get_mod_url('file');
         $url->set('path', $const->get_file());
         $url->set('line', $const->get_line());
         $url->set_anchor('l' . $const->get_line());
         $consts[] = array('id' => $const->get_id(), 'name' => $const->get_name(), 'type' => (string) $const->get_type(), 'file' => $const->get_file(), 'line' => $const->get_line(), 'url' => $url->to_url());
     }
     $callurl = PC_URL::get_mod_url('filepart');
     $callurl->set('id', '__ID__');
     $callurl->set('type', 'const');
     $this->request_formular();
     $tpl->add_variables(array('consts' => $consts, 'get_code_url' => $callurl->to_url(), 'file' => $file, 'name' => $name, 'search_target' => $surl->to_url(), 'display_search' => $cookies->get_cookie('consts_search') ? 'block' : 'none', 'cookie_name' => $cookies->get_prefix() . 'consts_search'));
 }
Exemple #4
0
 /**
  * @see FWS_Module::run()
  */
 public function run()
 {
     $tpl = FWS_Props::get()->tpl();
     $input = FWS_Props::get()->input();
     $cookies = FWS_Props::get()->cookies();
     $file = $input->get_var('file', -1, FWS_Input::STRING);
     $class = $input->get_var('class', -1, FWS_Input::STRING);
     $function = $input->get_var('function', -1, FWS_Input::STRING);
     $url = PC_URL::get_mod_url();
     $url->set('file', $file);
     $url->set('class', $class);
     $url->set('function', $function);
     $surl = clone $url;
     $typecon = new PC_Engine_TypeContainer(new PC_Engine_Options());
     $pagination = new PC_Pagination(PC_ENTRIES_PER_PAGE, PC_DAO::get_calls()->get_count_for($file, $class, $function));
     $pagination->populate_tpl($url);
     $start = $pagination->get_start();
     $calls = array();
     foreach (PC_DAO::get_calls()->get_list($start, PC_ENTRIES_PER_PAGE, $file, $class, $function) as $call) {
         /* @var $call PC_Obj_Call */
         $url = PC_URL::get_mod_url('file');
         $url->set('path', $call->get_file());
         $url->set('line', $call->get_line());
         $url->set_anchor('l' . $call->get_line());
         $func = $typecon->get_method_or_func($call->get_class(), $call->get_function());
         $calls[] = array('id' => $call->get_id(), 'call' => $this->get_call($call, $typecon), 'file' => $call->get_file(), 'line' => $call->get_line(), 'url' => $url->to_url(), 'since' => $func ? implode(', ', $func->get_version()->get_min()) : '', 'till' => $func ? implode(', ', $func->get_version()->get_max()) : '');
     }
     $callurl = PC_URL::get_mod_url('filepart');
     $callurl->set('id', '__ID__');
     $callurl->set('type', 'call');
     $this->request_formular();
     $tpl->add_variables(array('calls' => $calls, 'get_code_url' => $callurl->to_url(), 'file' => $file, 'class' => $class, 'function' => $function, 'search_target' => $surl->to_url(), 'display_search' => $cookies->get_cookie('calls_search') ? 'block' : 'none', 'cookie_name' => $cookies->get_prefix() . 'calls_search'));
 }
Exemple #5
0
 /**
  * @see FWS_Module::run()
  */
 public function run()
 {
     $tpl = FWS_Props::get()->tpl();
     $input = FWS_Props::get()->input();
     $cookies = FWS_Props::get()->cookies();
     $file = $input->get_var('file', -1, FWS_Input::STRING);
     $msg = $input->get_var('msg', -1, FWS_Input::STRING);
     $types = $input->get_var('types', -1);
     if (!FWS_Array_Utils::is_numeric($types)) {
         $types = array();
     }
     $url = PC_URL::get_mod_url();
     $url->set('file', $file);
     $url->set('msg', $msg);
     if (count($types)) {
         $url->set('types', $types);
     }
     $surl = clone $url;
     $pagination = new PC_Pagination(PC_ENTRIES_PER_PAGE, PC_DAO::get_errors()->get_count_with($file, $msg, $types));
     $pagination->populate_tpl($url);
     $start = $pagination->get_start();
     $errs = array();
     $errors = PC_DAO::get_errors()->get_list(PC_Project::CURRENT_ID, $start, PC_ENTRIES_PER_PAGE, $file, $msg, $types);
     foreach ($errors as $err) {
         /* @var $err PC_Obj_Error */
         $url = PC_URL::get_mod_url('file');
         $url->set('path', $err->get_loc()->get_file());
         $url->set('line', $err->get_loc()->get_line());
         $url->set_anchor('l' . $err->get_loc()->get_line());
         $errs[] = array('id' => $err->get_id(), 'type' => PC_Obj_Error::get_type_name($err->get_type()), 'message' => $this->get_msg($err), 'file' => $err->get_loc()->get_file(), 'line' => $err->get_loc()->get_line(), 'fileurl' => $url->to_url(), 'typeurl' => PC_URL::get_mod_url()->set('types', array($err->get_type()))->to_url());
     }
     $this->request_formular();
     $typecbs = array();
     $row = -1;
     $i = 0;
     $error_types = PC_Obj_Error::get_types();
     asort($error_types);
     foreach ($error_types as $type => $name) {
         if ($i % 4 == 0) {
             $typecbs[++$row] = array();
         }
         $typecbs[$row][] = array('name' => 'types[' . $type . ']', 'selected' => count($types) == 0 || in_array($type, $types), 'value' => $type, 'text' => $name);
         $i++;
     }
     for ($i = $i % 4; $i < 4; $i++) {
         $typecbs[$row][] = array('name' => '');
     }
     $callurl = PC_URL::get_mod_url('filepart');
     $callurl->set('id', '__ID__');
     $callurl->set('type', 'error');
     $tpl->add_variables(array('errors' => $errs, 'search_target' => $surl->to_url(), 'display_search' => $cookies->get_cookie('error_search') ? 'block' : 'none', 'cookie_name' => $cookies->get_prefix() . 'error_search', 'file' => $file, 'msg' => $msg, 'typecbs' => $typecbs, 'get_code_url' => $callurl->to_url()));
 }