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


PHP xajaxResponse::includeScript方法代码示例

本文整理汇总了PHP中xajaxResponse::includeScript方法的典型用法代码示例。如果您正苦于以下问题:PHP xajaxResponse::includeScript方法的具体用法?PHP xajaxResponse::includeScript怎么用?PHP xajaxResponse::includeScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xajaxResponse的用法示例。


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

示例1: plugin

function plugin($template, $customer)
{
    global $documents_dirs;
    $result = '';
    // xajax response object, can be used in the plugin
    $JSResponse = new xajaxResponse();
    foreach ($documents_dirs as $doc) {
        if (file_exists($doc . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $template)) {
            $doc_dir = $doc;
            continue;
        }
    }
    // read template information
    if (file_exists($file = $doc_dir . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $template . DIRECTORY_SEPARATOR . 'info.php')) {
        include $file;
    }
    // call plugin
    if (!empty($engine['plugin'])) {
        if (file_exists($file = $doc_dir . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $engine['name'] . DIRECTORY_SEPARATOR . $engine['plugin'] . '.php')) {
            include $file;
        }
        if (file_exists($doc_dir . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $engine['name'] . DIRECTORY_SEPARATOR . $engine['plugin'] . '.js')) {
            $JSResponse->removeScript($_SERVER['REQUEST_URI'] . '&template=' . $template);
            $JSResponse->includeScript($_SERVER['REQUEST_URI'] . '&template=' . $template);
        }
    }
    $JSResponse->assign('plugin', 'innerHTML', $result);
    $JSResponse->assign('title', 'value', isset($engine['form_title']) ? $engine['form_title'] : $engine['title']);
    return $JSResponse;
}
开发者ID:prezeskk,项目名称:lms,代码行数:30,代码来源:document.inc.php

示例2: includeScript

function includeScript($sFilename)
{
    $objResponse = new xajaxResponse();
    $objResponse->includeScript($sFilename);
    return $objResponse;
}
开发者ID:johnfelipe,项目名称:orfeo,代码行数:6,代码来源:includeExternalScriptTest.php

示例3: selectdata

function selectdata($table, $data)
{
    //global $tpl;
    global $memcache;
    global $l;
    global $tpl;
    global $user_data;
    global $getmonth;
    $objResponse = new xajaxResponse();
    //include('settings/template.php');
    include 'settings/tables.php';
    if ($user_data == '') {
        require_once 'lib/functions/get_userdata.php';
    }
    if ($table == $tbl_diary) {
        if ($data == 'clear_filter') {
            include "././lib/functions/fetch_diary.php";
        } else {
            $selected_month = mysql_real_escape_string($data['month']);
            $selected_year = mysql_real_escape_string($data['year']);
            //$mysqldate = date( 'Y-m-d H:i:s', time() );
            $start_date = date("Y-m-d H:i:s", mktime(0, 0, 0, $selected_month, 1, $selected_year));
            $end_date = date("Y-m-d H:i:s", mktime(23, 59, 59, $selected_month + 1, 0, $selected_year));
            //The last day of any given month can be expressed as the "0" day of the next month
            //strtotime("+1 month", $myTimestamp);
            //select new entry
            $diary = new SelectEntrys();
            $diary->cols = "ID, entry, date, picture";
            $diary->table = $tbl_diary;
            $diary->condition = " userID = '" . $user_data['ID'] . "' AND date >= '" . $start_date . "' AND date <= '" . $end_date . "' ";
            $diary->order = 'date DESC';
            //$diary->limit     = 10;
            $diary->multiSelect = 1;
            $ay_diary = $diary->row();
            if (isset($ay_diary[0])) {
                require_once 'lib/functions/convert_date.php';
                $count = 0;
                foreach ($ay_diary as $date_format) {
                    $ay_diary[$count]["date"] = convert_date($date_format['date'], 0, $getmonth);
                    $count++;
                }
            }
        }
        //refresh content
        //include("lib/functions/fetch_diary.php");
        $tpl->assign('ay_diary', $ay_diary);
        //TODO why is this needed now!?
        $tpl->assign('user_data', $user_data);
        //if at least one entry exists
        if (isset($ay_diary[0])) {
            $tpl->assign('at_least_one_entry', 1);
        } else {
            $tpl->assign('at_least_one_entry', 0);
        }
        $html = $tpl->fetch("modules/home/diary_entries.tpl");
        $objResponse->assign("diary_entries", "innerHTML", $html);
        //  if ($data == 'clear_filter') {
        $objResponse->includeScript("js/pinterest.js");
        $objResponse->call("m_reload");
        //   }
    }
    return $objResponse;
}
开发者ID:nbgmaster,项目名称:happify,代码行数:63,代码来源:selectdata.php

示例4: insertdata

function insertdata($table, $data, $special = 0)
{
    //global $tpl;
    global $memcache;
    global $l;
    global $tpl;
    global $user_data;
    global $getmonth;
    $objResponse = new xajaxResponse();
    //include('settings/template.php');
    include 'settings/tables.php';
    if ($user_data == '' || !isset($user_data)) {
        require_once 'lib/functions/get_userdata.php';
    }
    //enter new diary entry
    if ($table == $tbl_diary) {
        if ($special == 1) {
            $html = $tpl->fetch("modules/improve/diary/add_pin.tpl");
            //         $objResponse->assign("add_pin","style.className",'pin');
            $objResponse->assign("add_pin", "innerHTML", $html);
            $objResponse->includeScript("js/pinterest.js");
            $objResponse->call("m_reload");
        } else {
            if ($data['image_file'] != '') {
                $objResponse->script("document.forms['insert'].submit();");
            } else {
                $mysqldate = date('Y-m-d H:i:s', time());
                $diary_note = mysql_real_escape_string(strip_tags($data['note']));
                //insert new entry
                $diary = new ModifyEntry();
                $diary->table = $table;
                $diary->cols = 'userID, entry, date';
                $diary->values = " '" . $user_data['ID'] . "', '" . $diary_note . "', '" . $mysqldate . "' ";
                $diary->insert();
                unset($diary);
                //TODO check if first entry and if yes update user array with start_month and start_year
                //refresh content
                include "lib/functions/fetch_diary.php";
                $tpl->assign('ay_diary', $ay_diary);
                $tpl->assign('at_least_one_entry', 1);
                //else $tpl->assign('at_least_one_entry', 0);
                //TODO why is this needed now!?
                $tpl->assign('user_data', $user_data);
                $html = $tpl->fetch("modules/home/diary_entries.tpl");
                $objResponse->assign("diary_entries", "innerHTML", $html);
                $objResponse->assign("add_pin", "innerHTML", '');
                $objResponse->includeScript("js/pinterest.js");
                $objResponse->call("m_reload");
            }
        }
    } elseif ($table == $tbl_goals) {
        $mysqldate = date('Y-m-d H:i:s', time());
        $note = strip_tags(mysql_real_escape_string($data['note']));
        //insert new entry
        $goals = new ModifyEntry();
        $goals->table = $table;
        $goals->cols = 'userID, goal, created';
        $goals->values = " '" . $user_data['ID'] . "', '" . $note . "', '" . $mysqldate . "' ";
        $goals->insert();
        unset($goals);
        //refresh content
        $html1 = $tpl->fetch("modules/improve/goals/sortfields.tpl");
        $objResponse->assign("sortfields", "innerHTML", $html1);
        include "lib/functions/fetch_goals.php";
        $tpl->assign('ay_goals', $ay_goals);
        $html2 = $tpl->fetch("modules/improve/goals/goal_entries.tpl");
        $objResponse->assign("goal_entries", "innerHTML", $html2);
        $objResponse->call("reset_input");
    } elseif ($table == $tbl_distorted_thoughts) {
        $mysqldate = date('Y-m-d H:i:s', time());
        $thought = strip_tags(mysql_real_escape_string($data['thought']));
        $response = strip_tags(mysql_real_escape_string($data['response']));
        $c_action = strip_tags(mysql_real_escape_string($data['c_action']));
        //insert new entry
        $thoughts = new ModifyEntry();
        $thoughts->table = $table;
        $thoughts->cols = 'userID, thought, response, action, created';
        $thoughts->values = " '" . $user_data['ID'] . "', '" . $thought . "', '" . $response . "', '" . $c_action . "', '" . $mysqldate . "' ";
        $thoughts->insert();
        unset($thoughts);
        //refresh content
        include "lib/functions/fetch_thoughts.php";
        $tpl->assign('ay_thoughts', $ay_thoughts);
        $html = $tpl->fetch("modules/improve/distorted_thoughts/thought_entries.tpl");
        $objResponse->assign("thought_entries", "innerHTML", $html);
        $objResponse->call("reset_input");
    } elseif ($table == $tbl_da_scale_results || $table == $tbl_bd_scale_results) {
        $i = 0;
        $dataValid = 1;
        $mysqldate = date('Y-m-d H:i:s', time());
        //check if all items have been answered
        for ($i = 1; $i <= $data['items_total']; $i++) {
            if (!isset($data[$i])) {
                $objResponse->alert('Please answer all items');
                // TODO put string in language file
                $dataValid = 0;
                break;
            }
        }
        //TODO store aggregated values in user table
//.........这里部分代码省略.........
开发者ID:nbgmaster,项目名称:happify,代码行数:101,代码来源:insertdata.php

示例5: page

function page($site, $id, $total)
{
    global $memcache;
    global $tpl;
    global $duration;
    global $_COOKIE;
    //$tpl = new Smarty;
    include 'settings/tables.php';
    include 'settings/page_settings.php';
    $objResponse = new xajaxResponse();
    if (!isset($_COOKIE["l"])) {
        $objResponse->redirect(ROOT_DIR);
        return $objResponse;
    }
    $l["token"] = substr($_COOKIE["l"], 3, -35);
    $mem_key1 = "user_data_" . $l["token"];
    $user_data = $memcache->get($mem_key1);
    $mem_key2 = "trigger_f_" . $l["token"];
    $trigger_f = $memcache->get($mem_key2);
    include 'modules/logon/get_userdata.php';
    if ($site == 'friendslist') {
        $objResponse->includeScript("http://connect.facebook.net/en_US/all.js#xfbml=1");
        $page_friendslist = $id;
        $start_friendslist = $per_page_friendslist * $page_friendslist - $per_page_friendslist;
        $tpl->assign('per_page_friendslist', $per_page_friendslist);
        $tpl->assign('start_friendslist', $start_friendslist);
        $total_pages = ceil(count($user_data['fb_friends']) / $per_page_friendslist);
        $tpl->assign('total_pages', "{$total_pages}");
        $tpl->assign('category', "friendslist");
        $tpl->assign('current_page', $id);
        $tpl->assign("usr_data", $user_data);
        $html = $tpl->fetch("modules/account/friendslist.tpl");
        $html2 = $tpl->fetch("pagenavi_ajax.tpl");
        $objResponse->assign("friendslist", "innerHTML", $html);
        $objResponse->assign("pagenavi_friendslist", "innerHTML", $html2);
    }
    if ($site == 'favorites') {
        $page_favorites = $id;
        $start_favorites = $per_page_favorites * $page_favorites - $per_page_favorites;
        $tpl->assign('per_page_favorites', $per_page_favorites);
        $tpl->assign('start_favorites', $start_favorites);
        $total_pages = ceil($total / $per_page_favorites);
        $tpl->assign('total_pages', "{$total_pages}");
        $tpl->assign('total', $total);
        $favorites = new SelectEntrys();
        $favorites->cols = "{$tbl_favorites}.flashID, {$tbl_flashes}.question";
        $favorites->table = $tbl_favorites;
        $favorites->join = " LEFT JOIN {$tbl_flashes} ON ({$tbl_flashes}.ID = {$tbl_favorites}.flashID) ";
        $favorites->condition = " {$tbl_favorites}.userID = '" . $user_data['ID'] . "' ";
        $favorites->order = "{$tbl_favorites}.time DESC";
        $favorites->limit = "{$start_favorites}, {$per_page_favorites}";
        $favorites->multiSelect = 1;
        $ay_favorites = $favorites->row();
        $tpl->assign('ay_favorites', $ay_favorites);
        $tpl->assign('category', "favorites");
        $tpl->assign('current_page', $id);
        $html = $tpl->fetch("modules/account/favorites_list.tpl");
        $html2 = $tpl->fetch("pagenavi_ajax.tpl");
        $objResponse->assign("p_favorites", "innerHTML", $html);
        $objResponse->assign("pagenavi_favorites", "innerHTML", $html2);
    }
    return $objResponse;
}
开发者ID:nbgmaster,项目名称:wiflash,代码行数:63,代码来源:ajax_functions.php

示例6: move

function move($direction, $table, $position, $cid)
{
    global $tpl;
    $objResponse = new xajaxResponse();
    /* Distinguish between up and down movement */
    if ($direction == "up") {
        $delimiter = "<";
        $order = "DESC";
        //$modify1 = "position = position-1";
        //$modify2 = "position = position+1";
    } else {
        $delimiter = ">";
        $order = "ASC";
        //$modify1 = "position = position+1";
        //$modify2 = "position = position-1";
    }
    /***********************************/
    /* Let's move */
    require_once 'lib/select.php';
    require_once 'lib/modify.php';
    $select = new SelectEntrys();
    $select->table = $table;
    $select->cols = 'position';
    $select->condition = " position {$delimiter} '{$position}' ";
    if ($cid) {
        $select->condition .= " AND cid = '{$cid}' ";
    }
    $select->order = "position {$order}";
    $select->limit = '1';
    $select->module = '';
    $select->template = '';
    $position_less = $select->row();
    $select->cols = 'id';
    $position_less_id = $select->row();
    $update = new ModifyEntry();
    $update->table = $table;
    if ($position > 1 && $direction == "up" || $position_less > 0 && $direction == "down") {
        $update->condition = " position = '{$position}' ";
        if ($cid) {
            $update->condition .= " AND cid = '{$cid}' ";
        }
        $update->changes = " position = '{$position_less}' ";
        $update->update();
        $update->condition = " id = '{$position_less_id}' ";
        if ($cid) {
            $update->condition .= " AND cid = '{$cid}' ";
        }
        $update->changes = " position = '{$position}' ";
        $update->update();
    }
    unset($select);
    unset($update);
    /***********************************/
    /* Get data in new order */
    require_once 'settings/config.php';
    require_once 'settings/tables.php';
    require_once 'settings/template.php';
    if ($table == $tbl_profile) {
        $profile = new SelectEntrys();
        $profile->cols = 'id, german, english, value, value_EN, position';
        $profile->table = $table;
        $profile->order = 'position';
        $profile->multiSelect = '1';
        $tpl->assign('array_profile', $profile->row());
        unset($profile);
        $html = $tpl->fetch("shortprofile_content.tpl");
        $objResponse->assign("layout_navi_profile", "innerHTML", $html);
        $html = $tpl->fetch("admin/settings_profile_fields.tpl");
        $objResponse->assign("layout_set_profile", "innerHTML", $html);
    }
    if ($table == $tbl_ref) {
        $ref = new SelectEntrys();
        $ref->cols = 'id, link, description, description_EN, position';
        $ref->table = $table;
        $ref->order = 'position';
        $ref->multiSelect = '1';
        $tpl->assign('array_ref', $ref->row());
        unset($ref);
        $html = $tpl->fetch("quicklinks_content.tpl");
        $objResponse->assign("layout_navi_ref", "innerHTML", $html);
        $html = $tpl->fetch("admin/settings_quicklinks_fields.tpl");
        $objResponse->assign("layout_set_ref", "innerHTML", $html);
    }
    if ($table == $tbl_design) {
        $design = new SelectEntrys();
        $design->cols = 'id, german, english, hexcode, imgfolder, position';
        $design->table = $table;
        $design->order = 'position';
        $design->multiSelect = '1';
        $tpl->assign('array_design', $design->row());
        unset($design);
        $html = $tpl->fetch("set_design.tpl");
        $objResponse->assign("layout_navi_design", "innerHTML", $html);
        $html = $tpl->fetch("admin/settings_design_fields.tpl");
        $objResponse->assign("layout_set_design", "innerHTML", $html);
        $objResponse->includeScript("js/change_settings.js");
        $objResponse->call("reload_tpl");
    }
    if ($table == $tbl_links_c) {
        $links_c = new SelectEntrys();
//.........这里部分代码省略.........
开发者ID:nbgmaster,项目名称:master2008,代码行数:101,代码来源:index.server.php


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