function wikiplugin_copyright($data, $params) { global $dbTiki; $copyrightslib = new CopyrightsLib; if (!isset($_REQUEST['page'])) { return ''; } $result = ''; $copyrights = $copyrightslib->list_copyrights($_REQUEST['page']); for ($i = 0; $i < $copyrights['cant']; $i++) { $notice = str_replace("~title~", $copyrights['data'][$i]['title'], $data); $notice = str_replace("~year~", $copyrights['data'][$i]['year'], $notice); $notice = str_replace("~authors~", $copyrights['data'][$i]['authors'], $notice); $result = $result . $notice; } global $tiki_p_edit_copyrights; if ((isset($tiki_p_edit_copyrights)) && ($tiki_p_edit_copyrights == 'y')) { $result = $result . "\n<a href=\"copyrights.php?page=" . $_REQUEST['page'] . "\">Edit copyrights</a> for ((" . $_REQUEST['page'] . "))\n"; } return $result; }
<?php /** * @package tikiwiki */ // (c) Copyright 2002-2015 by authors of the Tiki Wiki CMS Groupware Project // // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. // $Id$ require_once 'tiki-setup.php'; $access->check_feature('wiki_feature_copyrights'); $access->check_permission(array('tiki_p_edit_copyrights'), tra("Copyright management")); include_once "lib/copyrights/copyrightslib.php"; global $dbTiki; $copyrightslib = new CopyrightsLib(); if (!isset($_REQUEST["page"])) { $smarty->assign('msg', tra("No page indicated")); $smarty->display("error.tpl"); die; } $smarty->assign('page', $_REQUEST["page"]); $page = $_REQUEST["page"]; if (isset($_REQUEST['addcopyright'])) { if ($prefs['wiki_feature_copyrights'] == 'y' && isset($_REQUEST['copyrightTitle']) && isset($_REQUEST['copyrightYear']) && isset($_REQUEST['copyrightAuthors']) && !empty($_REQUEST['copyrightYear']) && !empty($_REQUEST['copyrightTitle'])) { $copyrightYear = $_REQUEST['copyrightYear']; $copyrightTitle = $_REQUEST['copyrightTitle']; $copyrightAuthors = $_REQUEST['copyrightAuthors']; $copyrightHolder = $_REQUEST['copyrightHolder']; $copyrightslib->add_copyright($page, $copyrightTitle, $copyrightYear, $copyrightAuthors, $copyrightHolder, $user); } else {
$smarty->assign('page_badchars_display', $wikilib->get_badchars()); } $plugins = $wikilib->list_plugins(true, 'editwiki'); $smarty->assign_by_ref('plugins', $plugins); $smarty->assign('showstructs', array()); if ($structlib->page_is_in_structure($_REQUEST["page"])) { $structs = $structlib->get_page_structures($_REQUEST["page"]); $smarty->assign('showstructs', $structs); } // Flag for 'page bar' that currently 'Edit' mode active // so no need to show comments & attachments, but need // to show 'wiki quick help' $smarty->assign('edit_page', 'y'); if ($prefs['wiki_feature_copyrights'] === 'y' && $tiki_p_edit_copyrights === 'y') { include_once 'lib/copyrights/copyrightslib.php'; $copyrightslib = new CopyrightsLib(); $copyrights = $copyrightslib->list_copyrights($_REQUEST["page"]); if ($copyrights['cant']) { $smarty->assign_by_ref('copyrights', $copyrights['data']); } } $defaultRows = $prefs['default_rows_textarea_wiki']; include_once 'lib/toolbars/toolbarslib.php'; if (!$user or $user === 'anonymous') { $smarty->assign('anon_user', 'y'); } if ($prefs['feature_contribution'] === 'y') { include_once 'contribution.php'; } if (!empty($prefs['geo_locate_wiki']) && $prefs['geo_locate_wiki'] == 'y') { $smarty->assign('geolocation_string', TikiLib::lib('geo')->get_coordinates_string('wiki page', $page));
$cat_name = $_REQUEST["page"]; $cat_href = "tiki-index.php?page=" . urlencode($cat_objid); include_once "categorize.php"; include_once "poll_categorize.php"; if ($feature_wiki_description == 'y' && md5($info["description"]) != md5($_REQUEST["description"]) || md5($info["data"]) != md5($_REQUEST["edit"]) || $info["lang"] != $_REQUEST["lang"] || $info["is_html"] != $is_html) { $page = $_REQUEST["page"]; if ($is_html) { $edit = $_REQUEST["edit"]; } else { // $edit = strip_tags($_REQUEST["edit"]); $edit = htmlspecialchars($_REQUEST['edit']); } // add permisions here otherwise return error! if (isset($wiki_feature_copyrights) && $wiki_feature_copyrights == 'y' && isset($_REQUEST['copyrightTitle']) && isset($_REQUEST['copyrightYear']) && isset($_REQUEST['copyrightAuthors']) && !empty($_REQUEST['copyrightYear']) && !empty($_REQUEST['copyrightTitle'])) { include_once "lib/copyrights/copyrightslib.php"; $copyrightslib = new CopyrightsLib($dbTiki); $copyrightYear = $_REQUEST['copyrightYear']; $copyrightTitle = $_REQUEST['copyrightTitle']; $copyrightAuthors = $_REQUEST['copyrightAuthors']; $copyrightslib->add_copyright($page, $copyrightTitle, $copyrightYear, $copyrightAuthors, $user); } // Parse $edit and eliminate image references to external URIs (make them internal) $edit = $imagegallib->capture_images($edit); // apply the optional page edit filters before data storage $edit = $tikilib->apply_postedit_handlers($edit); // If page exists if (!$tikilib->page_exists($_REQUEST["page"])) { // Extract links and update the page $links = $tikilib->get_links($_REQUEST["edit"]); /* $notcachedlinks = $tikilib->get_links_nocache($_REQUEST["edit"]);