| | |
| | | $this->add_script($javascript, 'head_top'); |
| | | $this->add_script($javascript_foot, 'foot'); |
| | | $this->scripts_path = 'program/js/'; |
| | | $this->include_script('jquery-1.3.min.js'); |
| | | $this->include_script('jquery-1.4.min.js'); |
| | | $this->include_script('common.js'); |
| | | $this->include_script('app.js'); |
| | | |
| | |
| | | if ($templ != 'iframe') { |
| | | // prevent from endless loops |
| | | if ($exit != 'recur' && $this->app->plugins->is_processing('render_page')) { |
| | | raise_error(array('code' => 505, 'type' => 'php', 'message' => 'Recursion alert: ignoring output->send()'), true, false); |
| | | raise_error(array('code' => 505, 'type' => 'php', |
| | | 'file' => __FILE__, 'line' => __LINE__, |
| | | 'message' => 'Recursion alert: ignoring output->send()'), true, false); |
| | | return; |
| | | } |
| | | $this->parse($templ, false); |
| | |
| | | if ($this->config['debug_level'] & 8) { |
| | | $this->add_footer('<div id="console" style="position:absolute;top:5px;left:5px;width:405px;padding:2px;background:white;z-index:9000;"> |
| | | <a href="#toggle" onclick="con=document.getElementById(\'dbgconsole\');con.style.display=(con.style.display==\'none\'?\'block\':\'none\');return false">console</a> |
| | | <form action="/" name="debugform" style="display:inline"><textarea name="console" id="dbgconsole" rows="20" cols="40" wrap="off" style="display:none;width:400px;border:none;font-size:x-small" spellcheck="false"></textarea></form></div>' |
| | | <form action="/" name="debugform" style="display:inline"><textarea name="console" id="dbgconsole" rows="20" cols="40" wrap="off" style="display:none;width:400px;border:none;font-size:10px" spellcheck="false"></textarea></form></div>' |
| | | ); |
| | | } |
| | | |
| | |
| | | { |
| | | $out = ''; |
| | | if (!$this->framed && !empty($this->js_env)) { |
| | | $out .= JS_OBJECT_NAME . '.set_env('.json_encode($this->js_env).");\n"; |
| | | $out .= JS_OBJECT_NAME . '.set_env('.json_serialize($this->js_env).");\n"; |
| | | } |
| | | foreach ($this->js_commands as $i => $args) { |
| | | $method = array_shift($args); |
| | | foreach ($args as $i => $arg) { |
| | | $args[$i] = json_encode($arg); |
| | | $args[$i] = json_serialize($arg); |
| | | } |
| | | $parent = $this->framed || preg_match('/^parent\./', $method); |
| | | $out .= sprintf( |
| | |
| | | { |
| | | $GLOBALS['__version'] = Q(RCMAIL_VERSION); |
| | | $GLOBALS['__comm_path'] = Q($this->app->comm_path); |
| | | return preg_replace('/\$(__[a-z0-9_\-]+)/e', '$GLOBALS["\\1"]', $input); |
| | | return preg_replace_callback('/\$(__[a-z0-9_\-]+)/', |
| | | array($this, 'globals_callback'), $input); |
| | | } |
| | | |
| | | /** |
| | | * Callback funtion for preg_replace_callback() in parse_with_globals() |
| | | */ |
| | | private function globals_callback($matches) |
| | | { |
| | | return $GLOBALS[$matches[1]]; |
| | | } |
| | | |
| | | /** |
| | |
| | | * Parses expression and replaces variables |
| | | * |
| | | * @param string Expression statement |
| | | * @return string Expression statement |
| | | * @return string Expression value |
| | | */ |
| | | private function parse_expression($expression) |
| | | { |
| | |
| | | return $username; |
| | | } |
| | | |
| | | // get e-mail address form default identity |
| | | // get e-mail address from default identity |
| | | if ($sql_arr = $this->app->user->get_identity()) { |
| | | $username = $sql_arr['email']; |
| | | } |