* compliance with the License. You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * 
 * notes template, displays notes on a template
 *
 * @author Patrick Lockley
 * @version 1.0
 * @package
 */
require_once "../../../config.php";
include "../template_status.php";
include "../user_library.php";
include "properties_library.php";
if (is_numeric($_POST['template_id'])) {
    if (is_user_creator($_POST['template_id']) || is_user_admin()) {
        $query_for_template_notes = "select notes from {$xerte_toolkits_site->database_table_prefix}templaterights where template_id = ?";
        $row_notes = db_query_one($query_for_template_notes, array($_POST['template_id']));
        notes_display($row_notes['notes'], false, $_POST['template_id']);
        exit(0);
    }
}
notes_display_fail();
Пример #2
0
<?php

if (session_id() == "") {
    session_start();
}
$docroot = $_SERVER['DOCUMENT_ROOT'];
require_once $docroot . "/config.php";
require_once $docroot . "/models/twextra_model.php";
require_once $docroot . "/tw.lib.php";
require_once $docroot . "/banner.php";
require_once $docroot . "/header_html.php";
notes_display();
//.......................................................................................................//
function notes_display()
{
    if (session_id() == "") {
        session_start();
    }
    logger($script_path . " index start:");
    validate_access_webnotes();
    //configuration parameters:
    $config_params = Config::getConfigParams();
    $hostname = $config_params['hostname'];
    $watch_demo = $config_params['watch_demo'];
    $docroot = $config_params['docroot'];
    $debug = $config_params['debug'];
    $header = header_html();
    //
    $footer = $config_params['footer'];
    $doctype = $config_params['doctype'];
    $html_attribute = $config_params['html_attribute'];
<?php

/**
 * 
 * notes change template, updates a users notes on a template
 *
 * @author Patrick Lockley
 * @version 1.0
 * @copyright Copyright (c) 2008,2009 University of Nottingham
 * @package
 */
require_once "../../../config.php";
include "../user_library.php";
include "properties_library.php";
if (is_numeric($_POST['template_id'])) {
    $database_id = database_connect("notes change template database connect success", "notes change template database connect failed");
    $query = "update " . $xerte_toolkits_site->database_table_prefix . "templaterights SET notes =\"" . mysql_real_escape_string($_POST['notes']) . "\" WHERE template_id =\"" . mysql_real_escape_string($_POST['template_id']) . "\"";
    if (mysql_query($query)) {
        notes_display($_POST['notes'], true);
    } else {
    }
    mysql_close($database_id);
}