Exemple #1
0
 /**
  * 数据列表
  */
 public function lists()
 {
     if (IS_POST) {
         $title = PUT('title');
         $map = array();
         $map['parent_id'] = 0;
         parent::page(array('size' => PUT('size', 10), 'page' => PUT('p'), 'where' => $map, 'orderby' => 'sort desc,id desc'));
     } else {
         $this->display();
     }
 }
Exemple #2
0
<?php

if (version_compare(PHP_VERSION, "5.1.3", "<")) {
    exit("Chyrp requires PHP 5.1.3 or greater.");
}
require_once "../includes/common.php";
# Prepare the controller.
$extend = ExtendController::current();
# Parse the route.
$route = Route::current($extend);
if (module_enabled("cacher") and !empty(Modules::$instances["cacher"]->cacher->path)) {
    $cacher =& Modules::$instances["cacher"]->cacher;
    $cacher->caches = INCLUDES_DIR . "/caches/extend";
    $cacher->path = str_replace(INCLUDES_DIR . "/caches", INCLUDES_DIR . "/caches/extend", $cacher->path);
    $cacher->file = $cacher->path . "/" . md5($cacher->url) . ".html";
    $cacher->remove_expired();
}
# Execute the appropriate Controller responder.
$route->init();
# If the route failed or nothing was displayed, check for:
#     1. Module-provided pages.
#     2. Feather-provided pages.
#     3. Theme-provided pages.
if (!$route->success) {
    $displayed = false;
    if (!$displayed and $theme->file_exists("pages/" . $route->action)) {
        $extend->display("pages/extend/" . $route->action);
    } elseif (!$displayed) {
        show_404();
    }
}
Exemple #3
0
 /**
  * Function: delete_link
  * Outputs a delete link for the post, if the <User.can> delete_[model].
  *
  * Parameters:
  *     $text - The text to show for the link.
  *     $before - If the link can be shown, show this before it.
  *     $after - If the link can be shown, show this after it.
  *     $classes - Extra CSS classes for the link, space-delimited.
  */
 public function delete_link($text = null, $before = null, $after = null, $classes = "")
 {
     if (!$this->deletable()) {
         return false;
     }
     fallback($text, __("Delete"));
     echo $before . '<a href="' . url("delete_extension/" . $this->id, ExtendController::current()) . '" title="Delete" class="' . ($classes ? $classes . " " : '') . 'extension_delete_link delete_link" id="extension_delete_' . $this->id . '">' . $text . '</a>' . $after;
 }