當前位置: 首頁>>代碼示例>>PHP>>正文


PHP view::set_special方法代碼示例

本文整理匯總了PHP中view::set_special方法的典型用法代碼示例。如果您正苦於以下問題:PHP view::set_special方法的具體用法?PHP view::set_special怎麽用?PHP view::set_special使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在view的用法示例。


在下文中一共展示了view::set_special方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 public function run()
 {
     if (app::$session != 'admin') {
         app::$content['ajax_error'] = "Access only for admins!";
         view::set_special("ajax", "browser/error/ajax.html");
     } elseif (count(app::$param) > 0 && method_exists($this, app::$param[0])) {
         $this->{app::$param[0]}();
     }
     $this->generate_html_output();
 }
開發者ID:q4z1,項目名稱:pokerth_monthlycup,代碼行數:10,代碼來源:upload.php

示例2: delete

 public function delete()
 {
     view::set_special("ajax", "browser/ajax/modal.html");
     $id = app::$request['id'];
     $cls = "model_signup" . date("Y");
     $sup = $cls::get_entry_by_id($id);
     if (is_null($sup)) {
         app::$content['modal']["heading"] = "<div class='text-danger'>Fail!</div>";
         app::$content['modal']["content"] = "A Signupd with id {$id} not found!";
         return;
     }
     // @TODO: remove assignments from each player !!!
     $cls::delete_entry_by_id($id);
     app::$content['modal']["heading"] = "<div class='text-success'>Success!</div>";
     app::$content['modal']["content"] = "The Signup with id {$id} has been deleted!";
 }
開發者ID:q4z1,項目名稱:pokerth_monthlycup,代碼行數:16,代碼來源:signup.php

示例3: assign

 public function assign()
 {
     view::set_special("ajax", "browser/ajax/modal.html");
     if (!array_key_exists("json", app::$request)) {
         app::$content['modal']["heading"] = "<div class='text-danger'>Fail!</div>";
         app::$content['modal']["content"] = "No json data given!";
         return;
     }
     $jObj = app::$request['json'];
     $awrd_id = $jObj->award_id;
     $players = $jObj->players;
     if (count($players) == 0) {
         app::$content['modal']["heading"] = "<div class='text-danger'>Fail!</div>";
         app::$content['modal']["content"] = "No players selected!";
         return;
     }
     $cls = "model_award" . date("Y");
     $awrd = $cls::get_entry_by_id($awrd_id);
     foreach ($players as $player) {
         $cls = "model_player" . date("Y");
         $ply = $cls::get_entry_by_id($player);
         if (is_null($ply->awards) || $ply->awards == "") {
             $awards = array();
         } else {
             $awards = json_decode($ply->awards);
         }
         $do = true;
         if (count($awards) > 0) {
             foreach ($awards as $aw) {
                 if ($aw->month == $awrd->month && $aw->type == $awrd->type) {
                     $do = false;
                 }
             }
         }
         if ($do) {
             $awards[] = array("month" => $awrd->month, "type" => $awrd->type);
             $ply->awards = json_encode($awards);
             $ply->save();
         }
     }
     app::$content['modal']["heading"] = "<div class='text-success'>Success!</div>";
     app::$content['modal']["content"] = "The award <strong class='text-primary'>{$awrd->filename}</strong> has been assigned!";
 }
開發者ID:q4z1,項目名稱:pokerth_monthlycup,代碼行數:43,代碼來源:award.php

示例4: dates

 public function dates()
 {
     view::set_special("ajax", "browser/ajax/modal.html");
     app::$content['modal']["heading"] = "<div class='text-success'>Success!</div>";
     app::$content['modal']["content"] = "The award <strong class='text-primary'>{$awrd->filename}</strong> has been assigned!";
 }
開發者ID:q4z1,項目名稱:pokerth_monthlycup,代碼行數:6,代碼來源:setting.php

示例5: set_base_cli_layout

 private static function set_base_cli_layout()
 {
     // debug::add_info("(".__FILE__.")<b>".__CLASS__."</b>::".__FUNCTION__."() betreten.");
     if (cfg::$debug) {
         view::set_special("debug", "cli/debug/debug.cli");
     }
 }
開發者ID:q4z1,項目名稱:pokerth_monthlycup,代碼行數:7,代碼來源:base.php

示例6: award

 public function award()
 {
     view::set_special("ajax", "browser/ajax/modal.html");
     if (!is_array($_FILES) || !array_key_exists("file", $_FILES)) {
         app::$content['modal']["heading"] = "<div class='text-danger'>Fail!</div>";
         app::$content['modal']["content"] = "No image file received!";
         return;
     }
     $blob = addslashes(file_get_contents($_FILES['file']['tmp_name']));
     $filename = $_FILES['file']['name'];
     $mime = $_FILES['file']['type'];
     $cls = "model_award" . date("Y");
     if (!is_null($cls::get_award_by_month_type(intval(app::$request['month']), app::$request['type']))) {
         app::$content['modal']["heading"] = "<div class='text-danger'>Fail!</div>";
         app::$content['modal']["content"] = "This award has alread been uploaded!";
         return;
     }
     $award = new $cls();
     $award->month = intval(app::$request['month']);
     $award->type = app::$request['type'];
     $award->file = $blob;
     $award->filename = $filename;
     $award->mime = $mime;
     $award->save();
     unlink($_FILES['file']['tmp_name']);
     app::$content['modal']["heading"] = "<div class='text-success'>Success!</div>";
     app::$content['modal']["content"] = "Award {$filename} successfully uploaded!";
 }
開發者ID:q4z1,項目名稱:pokerth_monthlycup,代碼行數:28,代碼來源:upload.php


注:本文中的view::set_special方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。