public static function index() { session::start(); render::add_val('content', phpexcel_block_class::getBlock()); render::get_main_tpl(); render::rend(); session::close(); }
public static function renderParameterVektor($obj) { $para = self::$para; if (!is_object($obj->getSourceCode()[$para])) { $obj->setSourceCode(render::doRendering([\math\math::vector($obj->getSourceCode()[$para])]), $para); } else { $obj->setSourceCode(render::doRendering([$obj->getSourceCode()[$para]]), $para); } }
public static function get_main_tpl($name = null) { ob_start(); if ($name == NULL) { require config::get_config('tpl_config')['index']; } else { require config::get_config('tpl_config')[$name]; } self::$main_tpl = ob_get_contents(); ob_end_clean(); }
public function render_pdf($modes) { if (file_exists($this->dir_tmp)) { render::rrmdir($this->dir_tmp); } mkdir($this->dir_tmp); $this->tex_eval($modes); $this->tex_settings('settings.tex'); $this->create_symlinks(); $this->compile(getcwd()); }
private static function _actionSilentItemDel() { $res = "{res:"; //проверяем id $id = 0 + self::post(self::$class . "-admin-item-id"); if (!$id) { echo $res . "false,msg:\"Невозможно выполнить операцию: задан неверный идентификатор меню [" . $id . "]\"}"; return; } $r = self::q("SELECT * FROM " . self::tb(self::$class) . " WHERE `id`=" . $id, false); if ($r === false) { echo $res . "false,msg:\"Ошибка операции с базой данных\"}"; return; } $rec = mysql_fetch_assoc($r); if (!$rec) { echo $res . "false,msg:\"Ошибка: указанное меню [" . $id . "] не существует или было удалено ранее.\"}"; return; } $r = render::unbind(self::$class, $id); if ($r !== true) { if (is_array($r) && isset($r["msg"])) { $msg = $r["msg"]; } else { $msg = "Ошибка удаления байндингов объекта."; } echo $res . "false,msg:\"" . lib::jsonPrepare($msg) . "\"}"; return; } $r = self::q("DELETE FROM " . self::tb(self::$class . "_entries") . " WHERE `mid`=" . $id); if ($r === false) { echo $res . "false,msg:\"Ошибка операции с базой данных\"}"; return; } $r = self::q("DELETE FROM " . self::tb(self::$class) . " WHERE `id`=" . $id); if ($r === false) { echo $res . "false,msg:\"Ошибка операции с базой данных\"}"; return; } echo $res . "true,msg:\"\"}"; }
/* * Copyright (C) <2008> <chenkun cs.kunchen@gmail.com> * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ define('IN_XJOJ', true); include "includes/render.class.php"; $tex_code = isset($_GET['tex_code']) ? trim($_GET['tex_code']) : ''; $tex_code = str_replace("\\\\", "\\", $tex_code); $render = new render(); $hash = md5($tex_code); $full_name = $render->CACHE_DIR . "/{$hash}.png"; if (!is_file($full_name)) { $render->render_latex($tex_code, $hash); } header("Content-Type: image/jpg"); readfile($full_name); exit; ?>
<li><a href="javascript:void(0)" class="delete_idea" onclick="OPN.deleteIdea('<?php echo $idea['id']; ?> ')">Delete</a></li> </ul> <?php } ?> <br clear="all"/> <br/> </div> <br clear="all"/> <div class="before_line"></div> <div class="idea_info"> <div class="nr_comments fleft"><?php echo render::giveComments($idea['comments']); ?> </div> <div class="share"> <ul> <li> Share: </li> <li> <a href=""><img src="<?php echo $conf->DIR_IMG; ?> facebook.png" alt="facebook"/></a> </li> <li> <a href=""><img src="<?php
public static function _exec() { $checked = false; if (self::$c->silent()) { if (self::$c->action(self::$class . "-reg-logincheck")) { self::_actionSilentRegLoginCheck(); } } else { render::addStyle(self::$class, "", true); render::addScript(self::$class, "", true); if (self::$c->action(self::$class . "-login")) { $checked = true; self::_actionLogin(); } if (self::$c->action(self::$class . "-logoff")) { $checked = true; self::_actionExit(); } if (self::$c->action(self::$class . "-register")) { self::_actionRegister(); } } if (!$checked) { self::_check(); } }
public static function _exec() { render::addScript(self::$class,self::$class,true); }
/** * put your comment there... * */ public static function _exec() { self::$uriSimbolic = self::$c->path("simbolic"); self::$c->renderAddStyle(self::$class); render::addScript(self::$class); }
<?php include '../core/main.class.php'; $main = new Main(); //check for loged in $id = Security::secureString($_GET['id']); $idea = mysql_fetch_array($main->con()->db_query("SELECT votes FROM feedback_ideas WHERE id='{$id}'")); if (session::check()) { $voter_id = session::get_param('user_id'); $main->con()->db_query("UPDATE feedback_ideas SET votes=votes+1 WHERE id='{$id}'"); $main->con()->db_query("INSERT INTO feedback_votes (idea_id,voter_id) VALUES('{$id}','{$voter_id}')"); } echo render::dynamicFont(number_format($idea['votes'] + 1, 0, '', ','), 32); ?> <br/> votes<br/>
$app->register('isUser', function () { $render = new render(); $config = new config(); if (!isset($_SESSION['user'])) { $render->render("admin.notice", ["system" => $config->system]); die; } }); }); //Error $route->onHttpError(function ($code, $router) { /* * HttpError doesn't have access to * vars outside of here. */ $render = new render(); $config = new config(); $build = new page(); $pages = new db("pages"); $request = $_SERVER['REQUEST_URI']; $found = false; foreach ($pages->all() as $page) { $component = array_keys($page)[0]; if ($page["endpoint"] != "/") { //Add slash to URL $page["endpoint"] = "/" . $page["endpoint"]; } if ($page["endpoint"] == $request) { $found = $page; } }
<?php echo messages::show_message(); ?> </div> <div class="col-md-12" name="content"> <div class="col-md-9" name="center_col"> <?php echo render::get_content('content'); ?> <?php echo render::get_content('content1'); ?> <?php echo render::get_content('content2'); ?> <?php //var_dump(render::get_val('ref')) ?> </div> </div> <div class="col-md-12 footer" name="footer"> </div> </div>
<?php if (!defined('CORE_DIR')) { die('No direct script access allowed'); } $voted_ideas = array(); if (session::check()) { $videas_q = $main->con()->db_query("SELECT idea_id FROM feedback_votes WHERE voter_id='" . session::get_param('user_id') . "'"); while ($i_videas = mysql_fetch_assoc($videas_q)) { $voted_ideas[] = $i_videas; } } $id = $pars['id']; $idea = mysql_fetch_array($main->con()->db_query("SELECT * FROM feedback_ideas WHERE id='{$id}'")); $title = $idea['idea']; $idea_link = 'idea/id/' . $id . '/title/' . render::makeTitle($title); if (!isset($pars['page'])) { $page = 1; } else { $page = $pars['page']; } $order = ' ORDER BY date DESC'; $selu = "idea_id='{$id}'"; //SEARCH TIME $sql = "SELECT * FROM feedback_comments WHERE " . $selu . "" . $order; $p = new Paginator($sql, COMMENTS_PER_PAGE, $pars, $pagename); $total_pages = $p->getTotalPages(); if ($page > 0) { $prev_page = $page - 1; } if ($total_pages > $page) {
public function silent() { return render::silent(); }
?> "><b> <?php echo render::giveComments($idea['comments']); ?> </b></a> </div> <?php if (!empty($idea['admin_comment'])) { ?> <div class="admin_comment"> <div id="com_status_<?php echo $idea['id']; ?> " class="ad_<?php echo render::giveStatus($idea['status'], 'class'); ?> "></div> <div class="ad_comment"> <?php echo $idea['admin_comment']; ?> </div> <div class="auth_inf"> by <a href="">Gogu</a> (admin) </div> </div> <?php } ?> <?php
$render->render("admin.variables", ["system" => $config->system, "variables" => $db->all()]); }); //Extensions $route->respond("/extensions", function ($request, $response, $service, $app) { $app->isUser; $render = new render(); $config = new config(); $db = new db("extensions"); if (isset($request->title) && isset($request->filename) && strpos($request->filename, '.php') !== FALSE) { $db->set($request->title, $request->filename); } if (isset($_GET['delete'])) { $db->delete($_GET['delete']); } $render->render("admin.extensions", ["system" => $config->system, "extensions" => $db->all()]); }); //Extension $route->respond("/extension/[:extension]", function ($request, $response, $service, $app) { $app->isUser; if (!isset($request->extension) || !file_exists("app/resources/backend/extensions/" . $request->extension . ".twig")) { $response->redirect(BACKEND . "/pages"); return; } $ext = $request->extension; $render = new render(); $config = new config(); $db = new db("extensions"); $render->render("../extensions/{$ext}", ["system" => $config->system, "extensions" => $db->all()]); }); }); $route->dispatch();
<?php include '../core/main.class.php'; $main = new Main(); //check for loged in $id = Security::secureString($_GET['id']); $status = Security::secureString($_GET['status']); if (session::check() && session::get_param('admin')) { $main->con()->db_query("UPDATE feedback_ideas SET status='{$status}' WHERE id='{$id}'"); $info = array('status' => '<div id="status_' . $id . '" class="nr_votes ' . render::giveStatus($status, "class") . '">' . render::giveStatus($status, "text") . '</div>', 'adm_com' => '<div id="com_status_' . $id . '" class="ad_' . render::giveStatus($status, "class") . '"></div>'); echo json_encode($info); }
<?php include '../../../core/main.class.php'; $main = new Main(); //check for loged in $title = Security::secureString($_GET['title']); $descr = Security::secureString($_GET['description']); $auth_id = session::get_param('user_id'); $main->con()->db_query("INSERT INTO feedback_ideas (idea,description,sub_date,auth_id) VALUES('{$title}','{$descr}',NOW(),'{$auth_id}')"); //insert si in votes votu lu asta! $id = mysql_insert_id(); $idea = mysql_fetch_array($main->con()->db_query("SELECT idea,id FROM feedback_ideas WHERE id='{$id}'")); $url = HTTP_CORE_BASE . 'idea/id/' . $idea['id'] . '/' . render::makeTitle($idea['idea']); echo '&url=' . $url;
function render($page, $save = false) { $render = new render(); $components = new db("components"); $keys = array_keys($page); $html = ""; foreach ($keys as $key) { if ($key != "page" && $key != "endpoint" && $key != "layout") { $strkey = str_replace("_", " ", $key); $query = $components->get($strkey); if (is_array($query)) { $page[$key]["template"] = $query['filename']; $page[$key]["key"] = $key; } } } $title = $page['page']; $endpoint = $page['endpoint']; $layout = isset($page['layout']) ? $page['layout'] : false; $variables = new db("variables"); $pages = new db("pages"); $layouts = new db("layouts"); $headFoot = false; $array = array(); $names = array(); $values = array(); unset($page['page']); unset($page['endpoint']); unset($page['layout']); foreach ($page as $item) { foreach ($item as $k => $x) { if (is_array($x)) { foreach ($x as $n => $v) { if ($n == "name") { $names[] = $v; } if ($n == "value") { if ($v == "on") { $v = true; } $values[] = $v; } } } } $array = array_combine($names, $values); $array["variables"] = $variables->all(); $array["pages"] = $pages->all(); if ($layout) { $custom = $layouts->get($layout); $array['custom'] = array("js" => $custom['customjs'], "css" => $custom['customcss']); } if ($render->exists("header.twig", "frontend") && $render->exists("footer.twig", "frontend")) { $headFoot = true; $html .= $render->render("layout/header.twig", $array, "frontend"); } if (isset($item['template'])) { $html .= $render->render("component/" . $item['template'], $array, "frontend"); } else { $html .= "<p>Component Not Found.</p>"; } if ($headFoot) { $html .= $render->render("layout/footer.twig", $array, "frontend"); } } if ($save) { return $html; } echo $html; die; }
/** * @param $vec * @return mixed */ public static function Vector($vec) { if (funcs::is_vector($vec)) { foreach ($vec->getSourceCode()["parameter"] as $index => $p) { if (is_object($p)) { $q .= render::doRendering([$p]); } else { $temp = $vec->getSourceCode()["parameter"]; $temp[$index] = \math\internal\renderengines\html::common($p); $vec->setSourceCode($temp, "parameter"); } } } return $vec; }