function list_action() { $postsModel = new PostsModel(); $posts = $postsModel->get_all_posts(); $html = render_template('view/template/list.php', array('posts' => $posts)); return $html; //require "view/template/list.php"; }
public static function photo_del() { $photoId = empty($_GET['photoId']) ? "" : $_GET['photoId']; mod_index::delPhoto($photoId); $rs = mod_index::getPhoto(); render_template("photo.php", array("photo_list" => $rs)); }
function update_action() { update_row(); $rows = get_all_rows(); $html = render_template("view/admin.php", array('rows' => $rows)); return $html; }
function edit_action($id) { edit_post($id); $posts = get_all_posts(); $html = render_template('View/Templates/admin.php', array('posts' => $posts)); return $html; }
public static function add_page() { $courseId = $_GET['snavId']; $navId = $_GET['navId']; $type = $_GET['type']; render_template("student_add.php", array("navId" => $navId, "snavId" => $courseId, "type" => $type)); }
function update_action($id) { update_post($id); $posts = get_all_posts(); $html = render_template("view/templates/admin.php", array('posts' => $posts)); return new Response($html); }
function template_article($article, $single = false) { global $context; if (isset($context['tportal']['article_expired'])) { template_notpublished(); } render_template(article_renders(!empty($article['category_opts']['catlayout']) ? $article['category_opts']['catlayout'] : 1, true, true)); }
public static function delJoinus() { $navId = $_GET['navId']; $snavId = $_GET['snavId']; $id = $_GET['joinusId']; mod_joinus::delJoinus($id); render_template("joinus.php", array("navId" => $navId, "snavId" => $snavId)); }
public static function delAdvice() { $navId = $_GET['navId']; $snavId = $_GET['snavId']; $id = $_GET['adviceId']; mod_advice::delAdvice($id); render_template("buy.php", array("navId" => $navId, "snavId" => $snavId)); }
public static function index() { $courseId = $_GET['snavId']; $navId = $_GET['navId']; $courseId = $_GET['snavId']; $content = mod_course::getOne($courseId); render_template("course.php", array("navId" => $navId, "snavId" => $courseId, "content" => $content)); }
public static function delBuy() { $navId = $_GET['navId']; $snavId = $_GET['snavId']; $id = $_GET['buyId']; mod_buy::delBuy($id); render_template("buy.php", array("navId" => $navId, "snavId" => $snavId)); }
function render_view($name, $layout = 'default') { ob_start(); global $current_view; $current_view = $name; render_template("layouts/{$layout}"); ob_flush(); }
function delete_action($id) { $postsModel = new PostsModel(); $postsModel->delete_post($id); $posts = $postsModel->get_all_posts(); $html = render_template('view/template/admin.php', array('posts' => $posts)); return $html; }
function show_action($id) { //$id=$_REQUEST['id']; //$sql="SELECT * FROM `pages` WHERE `id`=$id"; //$row=get_all_rows($sql); $rows = get_row($id); $html = render_template("View/show.php", array('rows' => $rows)); return $html; }
function admin_action() { if (isset($_POST['submit'])) { add_post(); } $posts = get_all_posts(); $html = render_template('view/templates/admin.php', array('posts' => $posts)); return $html; //require "view/templates/admin.php"; }
public static function index() { $courseId = $_GET['snavId']; $navId = $_GET['navId']; $courseId = $_GET['snavId']; $content = mod_course::getOne($courseId); $currentNav = getCurrentNav($navId); $currentNavInfo = getCurrentNavInfo($courseId); render_template("course.php", array("navId" => $navId, "snavId" => $courseId, "content" => $content, "currentNav" => $currentNav, "currentNavInfo" => $currentNavInfo)); }
function render_footer($specific_quickstat = null, $skip_quickstat = null) { global $global_quickstat; // Pull in global quickstat if any. $quickstat = null; if (!$skip_quickstat) { $quickstat = isset($specific_quickstat) ? $specific_quickstat : $global_quickstat; } return render_template('footer.tpl', array("quickstat" => $quickstat)); }
function send_confirmation_email($email, $data) { $lost_confirm = $data['verification_number']; $lost_uname = $data['uname']; $_from = array(SYSTEM_EMAIL => SYSTEM_EMAIL_NAME); $_to = array("{$email}" => $data['uname']); $_subject = "NinjaWars Account Confirmation Info"; $_body = render_template('lostconfirm_email_body.tpl', array('lost_uname' => $lost_uname, 'lost_confirm' => $lost_confirm, 'account_id' => $data['account_id'])); $mail_obj = new Nmail($_to, $_subject, $_body, $_from); $mail_obj->setReplyTo(array(SUPPORT_EMAIL => SUPPORT_EMAIL_NAME)); return $mail_obj->send(); }
/** * Private functionality to send out the reset email. * * @return bool */ private function sendEmail($token, $account) { $email = $account->getActiveEmail(); if (!$email) { return false; } // Email body contents will be: Click here to reset your password: {{ url('password/reset/'.$token) }} $url = WEB_ROOT . 'resetpassword.php?command=reset&token=' . url($token); $rendered = render_template('email.password_reset_request.tpl', ['url' => $url]); // Construct the email with Nmail, and then just send it. $subject = 'NinjaWars: Your password reset request'; $nmail = new Nmail($email, $subject, $rendered, SUPPORT_EMAIL); return (bool) $nmail->send(); }
public static function index() { $rs = mod_index::getIndex(); $bigPhoto = array(); $smallPhoto = array(); foreach ($rs as $key => $val) { if ($val['type'] == 1) { array_push($bigPhoto, $val); } elseif ($val['type'] == 2) { array_push($smallPhoto, $val); } } render_template("index.php", array("bigPhoto" => $bigPhoto, "smallPhoto" => $smallPhoto)); }
function delete_action($id) { $postsModel = new PostsModel(); $postsModel->delete_post($id); $posts = $postsModel->get_all_posts(); $html = render_template("View/Templates/admin.php", array('posts' => $posts)); return $html; /*function delete_action($id) { delete_post($id); $posts = get_all_posts(); $html=render_template("View/Templates/admin.php",array('posts'=>$posts)); return $html; }*/ }
public static function index() { $navId = $_GET['navId']; $snavId = $_GET['snavId']; $type = empty($_GET['type']) ? 0 : $_GET['type']; //腾科战报 if ($snavId == "11") { $rs = mod_thanks::getStudentNewsList($type); render_template("student_news.php", array("navId" => $navId, "snavId" => $snavId, "content" => $rs)); } //学生感言 if ($snavId == "12") { $rs = mod_thanks::getStudentReportList($type); render_template("student_report.php", array("navId" => $navId, "snavId" => $snavId, "content" => $rs)); } }
public function onCompleted(ProxyEvent $event) { $request = $event['request']; $response = $event['response']; $url = $request->getUri(); // we attach url_form only if this is a html response if (!is_html($response->headers->get('content-type'))) { return; } // this path would be relative to index.php that included it? $url_form = render_template("./templates/url_form.php", array('url' => $url)); $output = $response->getContent(); // does the html page contain <body> tag, if so insert our form right after <body> tag starts $output = preg_replace('@<body.*?>@is', '$0' . PHP_EOL . $url_form, $output, 1, $count); // <body> tag was not found, just put the form at the top of the page if ($count == 0) { $output = $url_form . $output; } $response->setContent($output); }
function send_confirmation_email($email, $data) { $lost_confirm = $data['verification_number']; $lost_uname = $data['uname']; $confirmed = $data['confirmed']; /*$headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= 'Reply-To: '.SUPPORT_EMAIL."\r\n";*/ $_from = array(SYSTEM_EMAIL => SYSTEM_EMAIL_NAME); $_to = array("{$email}" => $data['uname']); $_subject = "NinjaWars Account Confirmation Info"; $_body = render_template('lostconfirm_email_body.tpl', array('lost_uname' => $lost_uname, 'lost_confirm' => $lost_confirm, 'account_id' => $data['account_id'])); $mail_obj = new Nmail($_to, $_subject, $_body, $_from); $mail_obj->setReplyTo(array(SUPPORT_EMAIL => SUPPORT_EMAIL_NAME)); if (DEBUG) { $mail_obj->dump = true; } $sent = false; $sent = $mail_obj->send(); return $sent; }
public static function index() { $navId = $_GET['navId']; $snavId = $_GET['snavId']; $rs = mod_article::getList($snavId); $articleType = $rs[0]['articleType']; $currentNav = getCurrentNav($navId); $currentNavInfo = getCurrentNavInfo($snavId); $args = array("navId" => $navId, "snavId" => $snavId, "content" => $rs, "currentNav" => $currentNav, "currentNavInfo" => $currentNavInfo); if ($articleType == "1") { //text render_template("article_text.php", $args); } if ($articleType == "2") { //list render_template("article_list.php", $args); } if ($articleType == "3") { //imglist render_template("article_imgList.php", $args); } }
public static function index() { $snavId = $_GET['snavId']; $navId = $_GET['navId']; $currentNav = getCurrentNav($navId); //联系我们 if ($snavId == 13) { render_template("callus.php", array("navId" => $navId, "snavId" => $snavId, "currentNav" => $currentNav)); } //在线订购 if ($snavId == 14) { render_template("buy.php", array("navId" => $navId, "snavId" => $snavId, "currentNav" => $currentNav)); } //留言建议 if ($snavId == 46) { render_template("advice.php", array("navId" => $navId, "snavId" => $snavId, "currentNav" => $currentNav)); } //招商加盟 if ($snavId == 47) { render_template("business.php", array("navId" => $navId, "snavId" => $snavId, "currentNav" => $currentNav)); } }
if ($message && $messenger) { if ($to_clan && $has_clan) { $message_sent_to = message_to_clan($message); } elseif (!!$target_id) { send_message($user_id, $target_id, $message); $message_sent_to = $to; // ( } } if ($delete) { delete_messages(); } $messages = get_messages($user_id, $limit, $offset); $message_count = message_count(); $pages = ceil($message_count / $limit); // Total pages. //$current_page = floor(($message_count/$limit) - $limit); // $nav = render_message_nav($page, $pages, $limit); read_messages($user_id); // mark messages as read for next viewing. // TODO: Handle "send" and "deletion"; $message_list = ''; if (!empty($messages)) { foreach ($messages as $loop_message) { $loop_message['message'] = out($loop_message['message']); $message_list .= render_template('single_message.tpl', array('message' => $loop_message)); } } $parts = get_certain_vars(get_defined_vars()); echo render_template('messages.tpl', $parts); include SERVER_ROOT . "interface/footer.php";
return $recent_attackers; } $active_ninja = render_active(5, $alive_only = true); // Display the currently active ninjas $match_string = in('enemy_match', null, 'no filter'); $add_enemy = in('add_enemy', null, 'toInt'); $remove_enemy = in('remove_enemy', null, 'toInt'); $enemy_limit = 20; $max_enemies = false; $enemy_list = get_setting('enemy_list'); if ($match_string) { $found_enemies = render_enemy_matches($match_string); } if (is_numeric($remove_enemy)) { remove_enemy($remove_enemy); $enemy_list = get_setting('enemy_list'); // Update to new enemy list. } if (is_numeric($add_enemy)) { add_enemy($add_enemy); $enemy_list = get_setting('enemy_list'); // Update to new enemy list. } $enemy_section = render_current_enemies($enemy_list); if (count($enemy_list) > $enemy_limit - 1) { $max_enemies = true; } $recent_attackers_section = render_recent_attackers(); $parts = get_certain_vars(get_defined_vars()); echo render_template('enemies.tpl', $parts); include SERVER_ROOT . "interface/footer.php";
/** * Renders an admin template */ function render_admin_template($template, $args) { return render_template('admin/base', "admin/{$template}", $args); }
<?php /** * Created by PhpStorm. * User: HX-ZJ-012 * Date: 2015/12/4 * Time: 15:35 */ use Symfony\Component\Routing; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; $routers = new Routing\RouteCollection(); $routers->add('hello', new Routing\Route('/hello/{name}', array('name' => 'felix', '_controller' => function (Request $request) { $request->attributes->set('foo', 'bar'); $response = render_template($request); // 改变一些头信息 $response->headers->set('Content-Type', 'text/plain'); return $response; }))); $routers->add('bye', new Routing\Route('/bye')); $routers->add('leap_year', new Routing\Route('/is_leap_year/{year}', array('year' => null, '_controller' => 'Calendar\\Controller\\LeapYearController::indexAction'))); return $routers;