tiki  21.2
About: Tiki Wiki is a Groupware/CMS (Content Management System) solution that has features like Wikis, Forums, Blogs, Articles, Image Gallery, Map Server, Link Directory, Multilingual Support, Bug Tracker, RSS Feeds etc. Latest release 21 with Long Term Support (LTS).
  Fossies Dox: tiki-21.2.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

tiki-user_bookmarks.php
Go to the documentation of this file.
1 <?php
5 // (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
6 //
7 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
8 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
9 // $Id$
10 
11 $section = 'mytiki';
12 require_once('tiki-setup.php');
13 include_once('lib/bookmarks/bookmarklib.php');
14 
15 $access->check_feature('feature_user_bookmarks', '', 'community');
16 $access->check_user($user);
17 $access->check_permission('tiki_p_create_bookmarks');
18 
19 if (! isset($_REQUEST["parentId"])) {
20  $_REQUEST["parentId"] = 0;
21 }
22 if ($_REQUEST["parentId"]) {
23  $path = $bookmarklib->get_folder_path($_REQUEST["parentId"], $user);
24  $p_info = $bookmarklib->get_folder($_REQUEST["parentId"], $user);
25  $father = $p_info["parentId"];
26 } else {
27  $path = tra("TOP");
28  $father = 0;
29 }
30 $smarty->assign('parentId', $_REQUEST["parentId"]);
31 $smarty->assign('path', $path);
32 //chekck for edit folder
33 if (isset($_REQUEST["editfolder"])) {
34  $folder_info = $bookmarklib->get_folder($_REQUEST["editfolder"], $user);
35 } else {
36  $folder_info["name"] = '';
37  $_REQUEST["editfolder"] = 0;
38 }
39 $smarty->assign('foldername', $folder_info["name"]);
40 $smarty->assign('editfolder', $_REQUEST["editfolder"]);
41 if (isset($_REQUEST["editurl"])) {
42  $url_info = $bookmarklib->get_url($_REQUEST["editurl"]);
43 } else {
44  $url_info["name"] = '';
45  $url_info["url"] = '';
46  $_REQUEST["editurl"] = 0;
47 }
48 $smarty->assign('urlname', $url_info["name"]);
49 $smarty->assign('urlurl', $url_info["url"]);
50 $smarty->assign('editurl', $_REQUEST["editurl"]);
51 // Create a folder inside the parentFolder here
52 if (isset($_REQUEST["addfolder"])) {
53  check_ticket('user-bookmarks');
54  if ($_REQUEST["editfolder"]) {
55  $bookmarklib->update_folder($_REQUEST["editfolder"], $_REQUEST["foldername"], $user);
56  $smarty->assign('editfolder', 0);
57  $smarty->assign('foldername', '');
58  } else {
59  $bookmarklib->add_folder($_REQUEST["parentId"], $_REQUEST["foldername"], $user);
60  }
61 }
62 if (isset($_REQUEST["removefolder"])) {
63  check_ticket('user-bookmarks');
64  $bookmarklib->remove_folder($_REQUEST["removefolder"], $user);
65 }
66 if (isset($_REQUEST["refreshurl"])) {
67  check_ticket('user-bookmarks');
68  $bookmarklib->refresh_url($_REQUEST["refreshurl"]);
69 }
70 if (isset($_REQUEST["addurl"])) {
71  check_ticket('user-bookmarks');
72  $urlid = $bookmarklib->replace_url($_REQUEST["editurl"], $_REQUEST["parentId"], $_REQUEST["urlname"], $_REQUEST["urlurl"], $user);
73  if ($_REQUEST["editurl"] == 0 && $tiki_p_cache_bookmarks == 'y') {
74  $bookmarklib->refresh_url($urlid);
75  }
76  $smarty->assign('editurl', 0);
77  $smarty->assign('urlname', '');
78  $smarty->assign('urlurl', '');
79 }
80 if (isset($_REQUEST["removeurl"])) {
81  check_ticket('user-bookmarks');
82  $bookmarklib->remove_url($_REQUEST["removeurl"], $user);
83 }
84 $urls = $bookmarklib->list_folder($_REQUEST["parentId"], 0, -1, 'name_asc', '', $user);
85 $smarty->assign('urls', $urls["data"]);
86 $folders = $bookmarklib->get_child_folders($_REQUEST["parentId"], $user);
87 $pf = ["name" => "..", "folderId" => $father, "parentId" => 0, "user" => $user];
88 $pfs = [$pf];
89 if ($_REQUEST["parentId"]) {
90  $folders = array_merge($pfs, $folders);
91 }
92 $smarty->assign('folders', $folders);
93 include_once('tiki-mytiki_shared.php');
94 ask_ticket('user-bookmarks');
95 include_once('tiki-section_options.php');
96 // Display the template
97 $smarty->assign('mid', 'tiki-user_bookmarks.tpl');
98 $smarty->display("tiki.tpl");
tra
tra($content, $lg='', $unused=false, $args=[])
Definition: tra.php:37
$path
$path
Definition: include_wiki.php:14
$pf
$pf
Definition: tiki-user_bookmarks.php:87
$_REQUEST
$_REQUEST["editfolder"]
Definition: tiki-user_bookmarks.php:37
$user
if(strpos($_SERVER['SCRIPT_NAME'], basename(__FILE__)) !=false) global $user
Definition: avatar_force_upload.php:7
php
$folders
$folders
Definition: tiki-user_bookmarks.php:86
$bookmarklib
$bookmarklib
Definition: bookmarklib.php:198
$smarty
$smarty
Definition: include_connect.php:17
$father
$father
Definition: tiki-user_bookmarks.php:28
ask_ticket
if(strpos($_SERVER['SCRIPT_NAME'], basename(__FILE__)) !==false) ask_ticket($area)
Definition: tikiticketlib.php:35
$access
$access
Definition: include_rating.php:15
check_ticket
check_ticket($area)
Definition: tikiticketlib.php:48
$url_info
$url_info["url"]
Definition: tiki-user_bookmarks.php:45
$urls
if(isset($_REQUEST["addfolder"])) if(isset($_REQUEST["removefolder"])) if(isset($_REQUEST["refreshurl"])) if(isset($_REQUEST["addurl"])) if(isset($_REQUEST["removeurl"])) $urls
Definition: tiki-user_bookmarks.php:84
$section
$section
Definition: tiki-user_bookmarks.php:11
$pfs
$pfs
Definition: tiki-user_bookmarks.php:88