当前位置: 首页>>代码示例>>PHP>>正文


PHP joinPath函数代码示例

本文整理汇总了PHP中joinPath函数的典型用法代码示例。如果您正苦于以下问题:PHP joinPath函数的具体用法?PHP joinPath怎么用?PHP joinPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了joinPath函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * Run method with main page logic
  * 
  * Read in list of the latest published events and populate template with results.
  * Display results in the page. Pagination enabled
  * @access public
  */
 public function run()
 {
     $PAGINATION_LIMIT = 10;
     $session = Session::getInstance();
     $user = $session->getUser();
     $eventDAO = EventDAO::getInstance();
     $page = isset($_GET["page"]) && is_numeric($_GET["page"]) ? intval($_GET["page"]) : 1;
     $platform_id = isset($_GET["platform"]) && is_numeric($_GET["platform"]) ? intval($_GET["platform"]) : 0;
     if ($page < 1) {
         $page = 1;
     }
     $count = $paginator = $paginator_page = $queryVars = $current_platform = null;
     if ($platform_id <= 0) {
         $count = $eventDAO->countStatus(Event::APPROVED_STATUS);
         $paginator = new Paginator($count, $PAGINATION_LIMIT);
         $paginator_page = $paginator->getPage($page);
         $event_array = $eventDAO->allByStatus(Event::APPROVED_STATUS, array("order" => "{$eventDAO->getTableName()}.date DESC, {$eventDAO->getTableName()}.id DESC", "joins" => true, "limit" => $paginator_page));
     } else {
         $count = $eventDAO->countPlatformStatus($platform_id, Event::APPROVED_STATUS);
         $paginator = new Paginator($count, $PAGINATION_LIMIT);
         $paginator_page = $paginator->getPage($page);
         $event_array = $eventDAO->allByPlatformStatus($platform_id, Event::APPROVED_STATUS, array("order" => "{$eventDAO->getTableName()}.date DESC, {$eventDAO->getTableName()}.id DESC", "joins" => true, "limit" => $paginator_page));
         $queryVars = array("platform" => $platform_id);
     }
     $platformDAO = PlatformDAO::getInstance();
     $platform_array = $platformDAO->all();
     //print_r ($event_array);
     if ($platform_id > 0) {
         $current_platform = $platformDAO->load($platform_id);
     }
     $this->template->render(array("title" => "Event List", "main_page" => "event_list_tpl.php", "event_array" => $event_array, "session" => $session, "paginator_page" => $paginator_page, "sidebar_extra" => joinPath("fragments", "event_sidebar_tpl.php"), "platform_array" => $platform_array, "queryVars" => $queryVars, "current_platform" => $current_platform));
 }
开发者ID:Ryochan7,项目名称:UGA-Proposal-Website,代码行数:39,代码来源:event_list.php

示例2: showHead

function showHead($title = '')
{
    global $template, $config;
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<title><?php 
    echo $title;
    ?>
</title>
<link href="<?php 
    echo joinPath($config['site_absolute_url'], '/');
    ?>
css/style.css" rel="stylesheet" type="text/css" />
<script src="<?php 
    echo joinPath($config['site_absolute_url'], '/');
    ?>
js/JSL.js" type="text/javascript"></script>
<script src="<?php 
    echo joinPath($config['site_absolute_url'], '/');
    ?>
js/application.js" type="text/javascript"></script>
<?php 
    echo implode($template->includes, "\n");
}
开发者ID:Gninety,项目名称:Microweber,代码行数:25,代码来源:layout.php

示例3: printEnd

function printEnd()
{
    global $template, $config;
    ?>
<!-- End Content -->
</div>
<div id="end">
<h1 id="logo"><a href="<?php 
    echo $config['site_url'];
    ?>
"><?php 
    echo $config['site_title'];
    ?>
</a></h1>
</div>

<script src="<?php 
    echo joinPath($config['site_url'], 'js/library/jsl.js');
    ?>
" type="text/javascript"></script>
<script src="<?php 
    echo joinPath($config['site_url'], 'js/application.js');
    ?>
" type="text/javascript"></script>
<?php 
    echo implode("\n", $template->js_includes);
    ?>
</body>
</html>
<?php 
}
开发者ID:binnyva,项目名称:url_numbers,代码行数:31,代码来源:application.php

示例4: Logger

 /**
  * Constructor
  * Argument: $log_file - The file to which all the log message must be saved to.
  */
 function Logger($log_file = '')
 {
     global $config;
     $folder = joinPath($config['site_folder'], 'Logs');
     if (!$log_file) {
         //Log file not specifed - use default.
         if (file_exists($folder)) {
             $log_file = joinPath($folder, 'Development.log');
         }
     } else {
         //Use user specified log file
         if (file_exists($folder)) {
             $log_file = joinPath($folder, $log_file);
         }
     }
     $this->log_file = $log_file;
     if ($this->log_file and is_writable($folder)) {
         $this->handle = fopen($this->log_file, 'a');
     }
     if (!$this->handle) {
         print "Cannot enable logging: Log File '{$this->log_file}' not writable";
     }
 }
开发者ID:centaurustech,项目名称:fundrace,代码行数:27,代码来源:Logger.php

示例5: loadPlugins

/**
 * Read the plugin folder and put all the plugins found there in the dropdown menu
 */
function loadPlugins()
{
    global $config;
    $plugins = array();
    // Open plugin directory, and proceed to read its contents
    $dir = joinPath($config['site_folder'], 'plugins');
    $files = ls("*", $dir, false, array('return_folders'));
    foreach ($files as $file) {
        if ($file == 'CVS' . DIRECTORY_SEPARATOR || $file == '.' || $file == '..' || $file == 'api' . DIRECTORY_SEPARATOR || $file == '.svn' . DIRECTORY_SEPARATOR) {
            continue;
        }
        $plugins[] = substr($file, 0, -1);
        //Remove the trailing '/'
    }
    //Show the dropdown menu only if there are plugins
    if (count($plugins)) {
        print '<li class="dropdown"><a href="' . joinPath($config['site_relative_path'], 'plugins/') . '" class="plugin with-icon">Plugins</a>';
        print "\n<ul class='menu-with-icon plugins'>\n";
        foreach ($plugins as $plug) {
            print '<li><a href="' . joinPath($config['site_absolute_path'], 'plugins/', "{$plug}/") . '">' . format($plug) . '</a></li>' . "\n";
        }
        print '</ul></li>';
    }
}
开发者ID:Gninety,项目名称:Microweber,代码行数:27,代码来源:custom.php

示例6: dirname

<?php

/**
 * File defines the DeleteAlbumController PageController class
 * @package PageController
 */
/**
 */
$current_dir = dirname(__FILE__);
require_once $current_dir . DIRECTORY_SEPARATOR . "shared" . DIRECTORY_SEPARATOR . "bootstrap.php";
require_once joinPath(INCLUDES_DIR, "models", "Album.php");
require_once joinPath(INCLUDES_DIR, "models", "Photo.php");
/**
 * ADMIN PAGE. Interface for deleting an album entry
 * 
 * Display confirmation for album deletion. For POST request,
 * check user credentials, check if album exists and then delete entry from database.
 * Available to admins only.
 * @package PageController
 */
class DeleteAlbumController implements Controller
{
    protected $template;
    public function __construct()
    {
        $this->template = new PageTemplate();
    }
    public function run()
    {
        $session = Session::getInstance();
        $user = $session->getUser();
开发者ID:Ryochan7,项目名称:UGA-Proposal-Website,代码行数:31,代码来源:delete_album.php

示例7: joinPath

        ?>
</a></td>
<td><?php 
        echo $album->title;
        ?>
</td>
</tr>
        <?php 
        $i++;
    }
    ?>
        </tbody>
    </table>
    </form>
    <?php 
    include joinPath("fragments", "pagination_tpl.php");
} elseif (strcmp($action, "delete") == 0) {
    ?>
    <div id="breadcrumb_trail"><p><a href="album_options.php">Album Options</a></p></div>
    <h3>No albums selected</h3>
    <p>No albums chosen for deletion</p>
<?php 
} else {
    ?>
    <p style="float: right;"><a href="<?php 
    echo generate_link_url("create_album.php");
    ?>
">Create</a></p>
    <div id="breadcrumb_trail"><p><a href="album_options.php">Album Options</a></p></div>
    <h3>Album Options</h3>
    <div style="clear: both;"></div>
开发者ID:Ryochan7,项目名称:UGA-Proposal-Website,代码行数:31,代码来源:album_options_tpl.php

示例8: run

 /**
  * Run method with main page logic
  * 
  * Populate template and display form for editing an photo entry. For POST requests,
  * check user credentials, check if photo exists and then update entry in database.
  * Available to admins only
  * @access public
  */
 public function run()
 {
     $session = Session::getInstance();
     $user = $session->getUser();
     if (!$user || !$user->isAdmin()) {
         $session->setMessage("Do not have permission to access", Session::MESSAGE_ERROR);
         header("Location: " . BASE_URL);
         return;
     }
     $photoDAO = PhotoDAO::getInstance();
     $albumDAO = AlbumDAO::getInstance();
     $photo = null;
     $form_errors = array();
     $form_values = array("id" => "", "albumid" => "", "title" => "", "description" => "");
     if (!empty($_POST)) {
         $form_values["id"] = isset($_POST["id"]) && is_numeric($_POST["id"]) ? intval($_POST["id"]) : "";
         $form_values["albumid"] = isset($_POST["albumid"]) && is_numeric($_POST["albumid"]) ? intval($_POST["albumid"]) : "";
         $form_values["title"] = isset($_POST["title"]) ? trim($_POST["title"]) : "";
         $form_values["description"] = isset($_POST["description"]) ? trim($_POST["description"]) : "";
         if (empty($form_values["id"])) {
             $form_errors["id"] = "No id specified";
         }
         $photo = $photoDAO->load($form_values["id"]);
         if (!$photo) {
             $form_errors["id"] = "Photo does not exist";
         }
         if (empty($form_values["albumid"])) {
             $form_errors["albumid"] = "No albumid specified";
         } else {
             if (!$albumDAO->load($form_values["albumid"])) {
                 $form_errors["albumid"] = "Album does not exist";
             }
         }
         if (empty($form_values["title"])) {
             $form_errors["title"] = "No title specified";
         }
         if (empty($form_values["description"])) {
             $form_errors["description"] = "No description specified";
         }
         // Check if image will be changed
         $upload_path = "";
         if (!empty($_FILES["imagefile"]) && $_FILES["imagefile"]["error"] != UPLOAD_ERR_NO_FILE) {
             if ($_FILES["imagefile"]["error"] != UPLOAD_ERR_OK) {
                 $form_errors["imagefile"] = "File upload failed";
             } else {
                 $info = getimagesize($_FILES["imagefile"]["tmp_name"]);
                 $path = pathinfo($_FILES["imagefile"]["name"]);
                 $upload_path = joinPath(Photo::UPLOAD_DIR, strftime("%Y_%m"), basename($_FILES['imagefile']['name']));
                 $thumbLoc = joinPath(Photo::THUMBNAIL_DIR, strftime("%Y_%m"), $path["filename"] . "_thumb.jpg");
                 $smallThumbLoc = joinPath(Photo::THUMBNAIL_DIR, strftime("%Y_%m"), $path["filename"] . "_thumb_small.jpg");
                 if (!$info || !(strtolower($path["extension"]) != ".png" && strtolower($path["extension"]) != ".jpg" && strtolower($path["extension"]) != ".jpeg")) {
                     $form_errors["imagefile"] = "An invalid file was uploaded";
                 } else {
                     if (file_exists($upload_path)) {
                         unlink($upload_path);
                         if (file_exists($thumbLoc)) {
                             unlink($thumbLoc);
                         }
                         if (file_exists($smallThumbLoc)) {
                             unlink($smallThumbLoc);
                         }
                         //$form_errors["imagefile"] = "Filename already exists.  Please choose different name or delete file first";
                     }
                 }
             }
         }
         if (empty($form_errors)) {
             $photo->setAlbumId($form_values["albumid"]);
             $photo->setTitle($form_values["title"]);
             $photo->setDescription($form_values["description"]);
             // New image has been uploaded
             if (!empty($_FILES["imagefile"]) && $_FILES["imagefile"]["error"] != UPLOAD_ERR_NO_FILE) {
                 if (!file_exists(dirname($upload_path))) {
                     mkdir(dirname($upload_path));
                 }
                 if (move_uploaded_file($_FILES["imagefile"]["tmp_name"], $upload_path)) {
                     $photo->setFileLoc($upload_path);
                     // Reset thumbnail location in case new image does not need a thumbnail
                     $photo->setThumbLoc("");
                     // Create thumbnail
                     if ($info[0] > Photo::MAX_WIDTH) {
                         $phpThumb = new phpThumb();
                         $phpThumb->setSourceFilename($photo->getFileLoc());
                         $phpThumb->setParameter('w', Photo::MAX_WIDTH);
                         $phpThumb->setParameter('config_output_format', 'jpeg');
                         if (!file_exists(dirname($thumbLoc))) {
                             mkdir(dirname($thumbLoc));
                         }
                         if ($phpThumb->GenerateThumbnail() && $phpThumb->RenderToFile($thumbLoc)) {
                             $photo->setThumbLoc($thumbLoc);
                             $phpThumb = new phpThumb();
                             $phpThumb->setSourceFilename($photo->getFileLoc());
//.........这里部分代码省略.........
开发者ID:Ryochan7,项目名称:UGA-Proposal-Website,代码行数:101,代码来源:edit_photo.php

示例9: urlload

 function urlload($url, $options = array())
 {
     $default_options = array('method' => 'get', 'post_data' => false, 'return_info' => false, 'return_body' => true, 'cache' => false, 'referer' => '', 'headers' => array(), 'session' => false, 'session_close' => false);
     // Sets the default options.
     foreach ($default_options as $opt => $value) {
         if (!isset($options[$opt])) {
             $options[$opt] = $value;
         }
     }
     $url_parts = parse_url($url);
     $ch = false;
     $info = array('http_code' => 200);
     $response = '';
     $send_header = array('Accept' => 'text/*', 'User-Agent' => 'BinGet/1.00.A (http://www.bin-co.com/php/scripts/load/)') + $options['headers'];
     // Add custom headers provided by the user.
     if ($options['cache']) {
         $cache_folder = joinPath(sys_get_temp_dir(), 'php-load-function');
         if (isset($options['cache_folder'])) {
             $cache_folder = $options['cache_folder'];
         }
         if (!file_exists($cache_folder)) {
             $old_umask = umask(0);
             // Or the folder will not get write permission for everybody.
             mkdir($cache_folder, 0777);
             umask($old_umask);
         }
         $cache_file_name = md5($url) . '.cache';
         $cache_file = joinPath($cache_folder, $cache_file_name);
         //Don't change the variable name - used at the end of the function.
         if (file_exists($cache_file)) {
             // Cached file exists - return that.
             $response = file_get_contents($cache_file);
             //Seperate header and content
             $separator_position = strpos($response, "\r\n\r\n");
             $header_text = substr($response, 0, $separator_position);
             $body = substr($response, $separator_position + 4);
             foreach (explode("\n", $header_text) as $line) {
                 $parts = explode(": ", $line);
                 if (count($parts) == 2) {
                     $headers[$parts[0]] = chop($parts[1]);
                 }
             }
             $headers['cached'] = true;
             if (!$options['return_info']) {
                 return $body;
             } else {
                 return array('headers' => $headers, 'body' => $body, 'info' => array('cached' => true));
             }
         }
     }
     if (isset($options['post_data'])) {
         //There is an option to specify some data to be posted.
         $options['method'] = 'post';
         if (is_array($options['post_data'])) {
             //The data is in array format.
             $post_data = array();
             foreach ($options['post_data'] as $key => $value) {
                 $post_data[] = "{$key}=" . urlencode($value);
             }
             $url_parts['query'] = implode('&', $post_data);
         } else {
             //Its a string
             $url_parts['query'] = $options['post_data'];
         }
     } elseif (isset($options['multipart_data'])) {
         //There is an option to specify some data to be posted.
         $options['method'] = 'post';
         $url_parts['query'] = $options['multipart_data'];
         /*
            This array consists of a name-indexed set of options.
            For example,
            'name' => array('option' => value)
            Available options are:
            filename: the name to report when uploading a file.
            type: the mime type of the file being uploaded (not used with curl).
            binary: a flag to tell the other end that the file is being uploaded in binary mode (not used with curl).
            contents: the file contents. More efficient for fsockopen if you already have the file contents.
            fromfile: the file to upload. More efficient for curl if you don't have the file contents.
         
            Note the name of the file specified with fromfile overrides filename when using curl.
         */
     }
     ///////////////////////////// Curl /////////////////////////////////////
     //If curl is available, use curl to get the data.
     if (function_exists("curl_init") and !(isset($options['use']) and $options['use'] == 'fsocketopen')) {
         //Don't use curl if it is specifically stated to use fsocketopen in the options
         if (isset($options['post_data'])) {
             //There is an option to specify some data to be posted.
             $page = $url;
             $options['method'] = 'post';
             if (is_array($options['post_data'])) {
                 //The data is in array format.
                 $post_data = array();
                 foreach ($options['post_data'] as $key => $value) {
                     $post_data[] = "{$key}=" . urlencode($value);
                 }
                 $url_parts['query'] = implode('&', $post_data);
             } else {
                 //Its a string
                 $url_parts['query'] = $options['post_data'];
//.........这里部分代码省略.........
开发者ID:hasssammalik,项目名称:Pretastyler,代码行数:101,代码来源:get_images_helper.php

示例10: run

 /**
  * Run method with main page logic
  * 
  * Populate template and display form for registration. For POST requests, check if the user
  * already exists. If not, create new User and AuthToken entries and send an email notification to the user
  * @access public
  */
 public function run()
 {
     $form_errors = array();
     $form_values = array("username" => "", "password" => "", "password2" => "", "ulid" => "");
     $session = Session::getInstance();
     $user = $session->getUser();
     // Session should not have a defined user
     if ($user != null) {
         $session->setMessage("You are already a user", Session::MESSAGE_ERROR);
         header("Location: " . BASE_URL);
         return;
     }
     if (!empty($_POST)) {
         $form_values["username"] = isset($_POST["username"]) ? trim($_POST["username"]) : "";
         $form_values["password"] = isset($_POST["password"]) ? trim($_POST["password"]) : "";
         $form_values["password2"] = isset($_POST["password2"]) ? trim($_POST["password2"]) : "";
         $form_values["ulid"] = isset($_POST["ulid"]) ? trim($_POST["ulid"]) : "";
         if (empty($form_values["username"])) {
             $form_errors["username"] = "No username specified";
         }
         if (empty($form_values["password"])) {
             $form_errors["password"] = "No password specified";
         }
         if (empty($form_values["password2"])) {
             $form_errors["password"] = "Password must be entered twice";
         }
         if (empty($form_values["ulid"])) {
             $form_errors["ulid"] = "No ulid specified";
         } else {
             if (!preg_match("/[a-z]{5,7}/", $form_values["ulid"])) {
                 $form_errors["ulid"] = "Ulid is not in the proper format.";
             }
         }
         $userDAO = UserDAO::getInstance();
         $user = $userDAO->loadByUsername($form_values["username"]);
         // User already exists
         if ($user != null) {
             $form_errors["username"] = "User already exists";
         }
         if (strcmp($form_values["password"], $form_values["password2"]) != 0) {
             $form_errors["password"] = "Passwords do not match";
         }
         $user = $userDAO->loadByUlid($form_values["ulid"]);
         // User already exists
         if ($user != null) {
             $form_errors["ulid"] = "Ulid is already registered";
         }
         if (empty($form_errors)) {
             $user = new User();
             $user->setUsername($form_values["username"]);
             $user->setPassHash(sha1($form_values["password"]));
             $user->setUlid($form_values["ulid"]);
             $status = $userDAO->insert($user);
             if ($status) {
                 $token = new AuthToken();
                 $token->setUser($user);
                 $tokenDAO = AuthTokenDAO::getInstance();
                 $status = $tokenDAO->insert($token);
                 if ($status) {
                     $session->setMessage("Registration started. Check your email for a message to continue");
                     if (defined("SMTP_HOST") && strcmp(SMTP_HOST, "") != 0) {
                         $from_addr = EMAIL_ADDRESS;
                         //$to = "tanickl@ilstu.edu";
                         $to = "{$form_values["ulid"]}@" . User::ISU_EMAIL_DOMAIN;
                         $subject = "Verify registration with " . SITE_NAME;
                         $body = "To start the next step of the registration process, click the verify link below and enter the requested information. If the URL does not appear as a link, copy the URL, paste it into your browser's address bar and proceed to the web page.\n\n" . joinPath(BASE_URL, "verify.php") . "?token={$token->getToken()}\n";
                         $headers = array("From" => $from_addr, "To" => $to, "Subject" => $subject);
                         $stmp = Mail::factory("smtp", array("host" => SMTP_HOST, "auth" => true, "username" => SMTP_USERNAME, "password" => SMTP_PASSWORD));
                         $mail = $stmp->send($to, $headers, $body);
                     }
                     header("Location: " . BASE_URL);
                     return;
                 }
             }
         }
     }
     $user = $session->getUser();
     $this->template->render(array("title" => "Register", "main_page" => "register_tpl.php", "user" => $user, "session" => $session, "form_errors" => $form_errors, "form_values" => $form_values));
 }
开发者ID:Ryochan7,项目名称:UGA-Proposal-Website,代码行数:86,代码来源:register.php

示例11: dirname

<?php

/**
 * File defines the CreateAlbumController PageController class
 * @package PageController
 */
/**
 */
$current_dir = dirname(__FILE__);
require_once $current_dir . DIRECTORY_SEPARATOR . "shared" . DIRECTORY_SEPARATOR . "bootstrap.php";
require_once joinPath(INCLUDES_DIR, "models", "Album.php");
/**
 * ADMIN PAGE. Interface for creating a new album entry
 *
 * Display form for creating a new album entry. For POST request,
 * validate form data and save information to database. Available to admins only
 * @package PageController
 */
class CreateAlbumController implements Controller
{
    /**
     * PageTemplate object used to render page
     * @access protected
     * @var PageTemplate
     */
    protected $template;
    /**
     * Constructor. Create instance of PageTemplate using default index_tpl.php file
     * @access public
     */
    public function __construct()
开发者ID:Ryochan7,项目名称:UGA-Proposal-Website,代码行数:31,代码来源:create_album.php

示例12: array

$crud->allow['add'] = false;
// $crud->allow['edit'] = false;
$crud->allow['sorting'] = false;
$all_donation_types = array('ecs' => 'ECS', 'globalgiving' => 'Global Giving', 'online' => 'Online', 'other' => "Other", 'any' => 'Any');
$all_donation_status = array('TO_BE_APPROVED_BY_POC' => 'Not Deposited', 'DEPOSIT COMPLETE' => 'Deposited', 'any' => 'Any');
$all_cities = $sql->getById("SELECT id,name FROM cities ORDER BY name");
$all_cities[0] = 'Any';
// Filtering code - goes on the top.
$html = new HTML();
$html->options['output'] = 'return';
$crud->code['before_content'] = '<form action="donations.php" method="post" class="form-area">' . $html->buildInput("city_id", 'City', 'select', $city_id, array('options' => $all_cities)) . '<div id="select-date-area">' . $html->buildInput("donation_type", 'Type', 'select', $donation_type, array('options' => $all_donation_types)) . $html->buildInput("donation_status", 'Status', 'select', $donation_status, array('options' => $all_donation_status)) . $html->buildInput('from', 'From', 'text', $from, array('class' => 'date-picker')) . $html->buildInput('to', 'To', 'text', $to, array('class' => 'date-picker')) . '</div><a href="#" id="select-date-toggle">More Options</a><br />' . $html->buildInput("action", '&nbsp;', 'submit', 'Filter', array('class' => 'btn btn-primary')) . '</form><br /><br />';
$html->options['output'] = 'print';
// The SQL for the listing
$crud->setListingQuery("SELECT D.* FROM external_donations D \n\tINNER JOIN users U ON U.id=D.fundraiser_id\n\tWHERE " . implode(" AND ", $checks) . " ORDER BY D.created_at DESC");
// Fields customization.
$crud->addField("donation_type", 'Type', 'enum', array(), $all_donation_types, 'select');
$all_donation_status_without_any = $all_donation_status;
unset($all_donation_status_without_any['any']);
$crud->addField("donation_status", 'Donation Status', 'enum', array(), $all_donation_status_without_any, 'select');
$crud->addListDataField("donor_id", "donours", "Donor", "", array('fields' => 'id,first_name'));
$crud->fields['donor_id']['extra_info']['readonly'] = true;
$crud->addListDataField("fundraiser_id", "users", "Fundraiser", "", array('fields' => 'id,CONCAT(first_name, " ", last_name) AS name'));
$crud->fields['fundraiser_id']['extra_info']['readonly'] = true;
$crud->addListingField('Status', array('html' => '($row["donation_status"] == "DEPOSIT COMPLETE")' . ' ? "<span class=\\"with-icon success\\">Deposited - <a href=\'?status_action=disapprove&select_row[]=$row[id]\'>Undo Approval?</a></span>"' . ' : "<span class=\\"with-icon error\\">Not Deposited Yet - <a href=\'?status_action=approve&select_row[]=$row[id]\'>Approve?</a></span>"'));
// Show only the listing
$crud->setListingFields("donation_type", "amount", "donor_id", "fundraiser_id", "created_at", 'status');
$crud->setSearchFields('amount', 'donor_id', 'fundraiser_id');
// The other includes
$template->addResource(joinPath($config['site_url'], 'bower_components/jquery-ui/ui/minified/jquery-ui.min.js'), 'js', true);
$template->addResource(joinPath($config['site_url'], 'bower_components/jquery-ui/themes/base/minified/jquery-ui.min.css'), 'css', true);
render();
开发者ID:makeadiff,项目名称:exdon,代码行数:31,代码来源:donations.php

示例13: joinPath

</a>
	</div>
	<div class="collapse navbar-collapse">
		<ul class="nav navbar-nav pull-right">
			<li><a class="home with-icon" href="<?php 
echo $config['site_url'];
?>
">Home</a></li>
			<?php 
if ($current_folder != $base_folder) {
    ?>
<li><a class="folder with-icon" href="<?php 
    echo $config['site_url'];
    ?>
index.php?folder=<?php 
    echo joinPath($folder, '..');
    ?>
">Up</a></li><?php 
}
?>
		</ul>
	</div>

</div>
</div>

<div id="content" class="container">

<div class="message-area" id="error-message" <?php 
echo $QUERY['error'] ? '' : 'style="display:none;"';
?>
开发者ID:binnyva,项目名称:picaxe,代码行数:31,代码来源:page.php

示例14: joinPath

<?php

require_once joinPath($config['site_folder'], 'models/Task.php');
require_once joinPath($config['site_folder'], 'models/User.php');
$User = new User();
checkUser();
//////////////////////////////////// Authenitication Checks ////////////////////////////////////
function checkUser($redirect = true)
{
    global $config;
    if (isset($config['single_user']) and $config['single_user']) {
        $_SESSION['user_id'] = $config['single_user'];
        return true;
    }
    if (!isset($_SESSION['user_id']) or !$_SESSION['user_id']) {
        if ($redirect) {
            showMessage("Please login to use this feature", $config['site_url'] . 'user/login.php', "error");
        }
        return false;
    }
    return true;
}
/// See if the given task's owner is the currently logined user.
function checkTaskOwnership($task_id, $return_only = false)
{
    global $sql;
    if (empty($_SESSION['user_id'])) {
        $correct_owner = 0;
    } else {
        $task_owner = $sql->getOne("SELECT user_id FROM Task WHERE id={$task_id}");
        $correct_owner = $task_owner == $_SESSION['user_id'];
开发者ID:binnyva,项目名称:Tiker,代码行数:31,代码来源:application.php

示例15: full_escape

}
?>
 for="published">Published:</label><select name="published" id="published"><option value="false"<?php 
if ($form_values["published"] == "false") {
    echo "selected=\"selected\"";
}
?>
>False</option><option value="true"<?php 
if ($form_values["published"] == "true") {
    echo "selected=\"selected\"";
}
?>
>True</option></select></li>
        <li><label <?php 
if (!empty($form_errors["tags"])) {
    ?>
class="error" <?php 
}
?>
 for="tags">Tags:</label><input type="text" name="tags" id="tags" value="<?php 
echo full_escape($form_values["tags"]);
?>
" /><p class="help_text">Space-separated string (ex: ssf4 blazblue tekken6)</p></li>
        <li class="submit"><input type="submit" value="Submit" /></li>
</ul>
</form>
<?php 
include joinPath("fragments", "tinymce_tpl.php");
$dateField = "postDate";
include joinPath("fragments", "jscal2_tpl.php");
开发者ID:Ryochan7,项目名称:UGA-Proposal-Website,代码行数:30,代码来源:create_article_tpl.php


注:本文中的joinPath函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。