本文整理匯總了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();
}
示例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!";
}
示例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!";
}
示例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!";
}
示例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");
}
}
示例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!";
}