Dragonfly CMS logo Server sponsored and hosted by
DedicatedNOW
CVS logo  
.:: Home :: Dev. Resources :: Forums ::.
Dragonfly CMS CVS Repository
 Location: / cvs / html / includes / cssmainmenu.php
This is a web interface to the Dragonfly CMS CVS tree. You can browse the file hierarchy by picking directories. If you pick a file, you will see the revision history for that file.
Selecting a revision number will show that revision of the file. There are links at each revision to display diffs, annotate and download.
Note: Info about CVS and our commits can be found at our CVS Info Forum
File name: html/includes/cssmainmenu.php
Revision : 1.9 (5 years 8 months 3 weeks 2 days 12 hours 4 minutes 28 seconds ago) by nanocaiordo
Changed : +5 -5 lines
Comment: Replacing getlink with URL::index


# Author Rev Line
1 phoenix 1.1 <?php
2 phoenix 1.1 /*********************************************
3 phoenix 1.1 CPG Dragonfly™ CMS
4 phoenix 1.1 ********************************************
5 nanocaio 1.6 Copyright © 2004 - 2007 by CPG-Nuke Dev Team
6 phoenix 1.1 http://dragonflycms.org
7 phoenix 1.1  
8 phoenix 1.1 Dragonfly is released under the terms and conditions
9 phoenix 1.1 of the GNU GPL version 2 or any later version
10 phoenix 1.1  
11 phoenix 1.1 $Source: /cvs/html/includes/cssmainmenu.php,v $
12 nanocaio 1.9 $Revision: 1.8 $
13 nanocaio 1.9 $Author: nanocaiordo $
14 nanocaio 1.9 $Date: 2008/04/19 12:24:58 $
15 phoenix 1.1 **********************************************/
16 phoenix 1.1 if (!defined('CPG_NUKE')) { exit; }
17 phoenix 1.3 global $prefix, $db, $module_name, $language, $currentlang, $mainindex, $userinfo, $adminindex, $MAIN_CFG;
18 phoenix 1.3 if (!($MAIN_CFG['global']['admingraphic'] & 4)) return '';
19 phoenix 1.1  
20 phoenix 1.1 $menucats = array();
21 phoenix 1.1 $modquery = $lnkquery = '';
22 phoenix 1.1 $setstatus = 1;
23 phoenix 1.1  
24 phoenix 1.1 if (!is_admin())
25 phoenix 1.1 {
26 phoenix 1.1 $modquery = 'WHERE m.active=1 AND m.inmenu=1';
27 phoenix 1.1 $lnkquery = 'WHERE l.active=1';
28 phoenix 1.7 $view = array();
29 phoenix 1.1 $view[] = 0;
30 phoenix 1.1 if (is_user()) {
31 phoenix 1.1 $view[] = 1;
32 phoenix 1.1 foreach($userinfo['_mem_of_groups'] AS $key => $value) {
33 phoenix 1.1 $view[] = $key+3;
34 phoenix 1.1 }
35 phoenix 1.1 } else {
36 phoenix 1.1 $view[] = 3;
37 phoenix 1.1 }
38 phoenix 1.1 $modquery .= ' AND m.view IN ('.implode(',', $view).')';
39 phoenix 1.1 $lnkquery .= ' AND l.view IN ('.implode(',', $view).')';
40 phoenix 1.1 }
41 phoenix 1.1  
42 phoenix 1.1 // Load active modules from database
43 phoenix 1.1 $sql = 'SELECT m.title as link, m.custom_title as title, m.view, m.active, m.inmenu, m.cat_id, m.pos AS linkpos, c.name, c.image, c.pos AS catpos, c.link AS catlnk, c.link_type AS cattype FROM '.$prefix.'_modules AS m LEFT JOIN '.$prefix."_modules_cat c ON (c.cid = m.cat_id) $modquery";
44 phoenix 1.1 $result = $db->sql_query($sql);
45 phoenix 1.1 while ($row = $db->sql_fetchrow($result))
46 phoenix 1.1 {
47 phoenix 1.1 if ($row['title'] == '') {
48 nanocaio 1.8 $row['title'] = (defined("_$row[link]LANG")) ? constant("_$row[link]LANG") : str_replace('_', ' ', $row['link']);
49 phoenix 1.1 }
50 phoenix 1.1 $row['link_type'] = -1;
51 phoenix 1.1 if (!isset($row['catpos'])) {
52 phoenix 1.1 $row['catpos'] = -1;
53 phoenix 1.1 }
54 phoenix 1.1 $menucats[$row['catpos']][$row['linkpos']] = $row;
55 phoenix 1.1 }
56 phoenix 1.1 $db->sql_freeresult($result);
57 phoenix 1.1  
58 phoenix 1.1 // Load custom links from database
59 phoenix 1.1 $sql = "SELECT l.title, l.link, l.link_type, l.view, l.active, l.cat_id, l.pos AS linkpos, c.name, c.image, c.pos AS catpos, c.link AS catlnk, c.link_type AS cattype FROM ".$prefix."_modules_links AS l LEFT JOIN ".$prefix."_modules_cat c ON (c.cid = l.cat_id) $lnkquery";
60 phoenix 1.1 $result = $db->sql_query($sql);
61 phoenix 1.1 while ($row = $db->sql_fetchrow($result))
62 phoenix 1.1 {
63 phoenix 1.1 if (defined($row['title'])) {
64 phoenix 1.1 $row['title'] = constant($row['title']);
65 phoenix 1.1 }
66 nanocaio 1.8 $link = str_ireplace('&amp;', '&', $row['link']);
67 phoenix 1.1 if (get_uri() != '') {
68 nanocaio 1.8 if (false !== strpos(get_uri(), $link)) {
69 phoenix 1.1 $row['status'] = '<span class="sgreen">&#8226;</span>';
70 phoenix 1.1 $setstatus = 0;
71 phoenix 1.1 }
72 phoenix 1.1 }
73 nanocaio 1.8 $row['link'] = str_ireplace('&', '&amp;', $link);
74 nanocaio 1.8 $row['catlnk'] = str_ireplace('&', '&amp;', $row['catlnk']);
75 phoenix 1.1 $row['inmenu'] = 1;
76 phoenix 1.1 if (!isset($row['catpos'])) {
77 phoenix 1.1 $row['catpos'] = -1;
78 phoenix 1.1 }
79 phoenix 1.1 $menucats[$row['catpos']][$row['linkpos']] = $row;
80 phoenix 1.1 }
81 phoenix 1.1 $db->sql_freeresult($result);
82 phoenix 1.1  
83 phoenix 1.1 $nocatcontent = '';
84 phoenix 1.1 $content = "\n".'<ul id="menuList">';
85 phoenix 1.1 if (defined('ADMIN_PAGES'))
86 phoenix 1.1 {
87 phoenix 1.1 $content .= '<li><a href="'.$mainindex.'"><b>&raquo;</b> '._HOME.' <b>&laquo;</b></a>'."\n <ul>";
88 phoenix 1.1 }
89 phoenix 1.1 elseif (!defined('ADMIN_PAGES') && is_admin())
90 phoenix 1.1 {
91 phoenix 1.2 global $CLASS;
92 phoenix 1.1 require_once(CORE_PATH.'classes/cpg_adminmenu.php');
93 phoenix 1.1 $content .= '<li><a href="'.$adminindex.'"><b>&raquo;</b> '._ADMIN.' <b>&laquo;</b></a>';
94 nanocaio 1.4 $content .= $CLASS['adminmenu']->display('all', 'cssmenu');
95 phoenix 1.1 $content .='</li>';
96 phoenix 1.1 }
97 phoenix 1.1  
98 phoenix 1.1 ksort($menucats);
99 phoenix 1.2 while (list($ccat, $items) = each($menucats))
100 phoenix 1.1 {
101 phoenix 1.1 ksort($items);
102 phoenix 1.1 $catcontent = $offcontent = $hidcontent = '';
103 phoenix 1.1 while (list($dummy, $item) = each($items))
104 phoenix 1.1 {
105 phoenix 1.1 $status = '<span class="sblack">&#8226;</span>';
106 phoenix 1.1 if ($setstatus && $item['link'] == $module_name) {
107 phoenix 1.1 $status = '<span class="sgreen">&#8226;</span>';
108 phoenix 1.1 $setstatus = 0;
109 phoenix 1.1 }
110 phoenix 1.1 if (!$item['active']) {
111 phoenix 1.1 $status = '<span class="sred">&#8226;</span>';
112 phoenix 1.1 } elseif ($item['active'] && !$item['inmenu']) {
113 phoenix 1.1 $status = '<span class="sgray">&#8226;</span>';
114 phoenix 1.1 }
115 phoenix 1.1 $status = isset($item['status']) ? $item['status'] : $status;
116 phoenix 1.1 if ($item['link_type'] <= 0) {
117 nanocaio 1.9 $item['link'] = URL::index($item['link']);
118 phoenix 1.1 } elseif ($item['link_type'] == 2) {
119 phoenix 1.1 $item['link'] .= '" target="_blank';
120 phoenix 1.1 }
121 phoenix 1.1 $tmpcontent = '<li>'.$status.'<a href="'.$item['link'].'">'.$item['title'].'</a></li>';
122 phoenix 1.1 if (!$item['active'] && !$item['inmenu']) {
123 phoenix 1.1 $offcontent .= $tmpcontent;
124 phoenix 1.1 } elseif (!$item['active']) {
125 phoenix 1.1 $hidcontent .= $tmpcontent;
126 phoenix 1.1 } else {
127 phoenix 1.1 $catcontent .= $tmpcontent;
128 phoenix 1.1 }
129 phoenix 1.1 $cattitle = $item['name'];
130 phoenix 1.1 $catlnk = $item['catlnk'];
131 phoenix 1.1 $cattype = $item['cattype'];
132 phoenix 1.1 }
133 phoenix 1.1 $cattitle = (defined($cattitle) ? constant($cattitle) : $cattitle);
134 phoenix 1.1 $catcontent .= $hidcontent.$offcontent;
135 phoenix 1.1 if (!empty($catlnk)) {
136 phoenix 1.1 if ($cattype <= 0) {
137 nanocaio 1.9 $catlnk = URL::index($catlnk);
138 phoenix 1.1 } elseif ($cattype == 2) {
139 phoenix 1.1 $catlnk .= '" target="_blank';
140 phoenix 1.1 }
141 phoenix 1.5 $cattitlel = defined('ADMIN_PAGES') ? '<a href="'.$catlnk.'">'.$cattitle.'</a>' : '<a href="'.$catlnk.'"><b>&#8226;</b> '.$cattitle.'</a>';
142 phoenix 1.1 } else {
143 phoenix 1.1 $cattitlel = defined('ADMIN_PAGES') ? '<a>'.$cattitle.'</a>': '<a><b>&#8226;</b> '.$cattitle.'</a>';
144 phoenix 1.1 }
145 phoenix 1.2 if ($ccat >= 0) {
146 phoenix 1.1 $content .= "\n ".'<li>'.(defined('ADMIN_PAGES') ? '<span>&raquo;</span>': '').$cattitlel."\n <ul>".$catcontent;
147 phoenix 1.1 $content .= "\n </ul></li>";
148 phoenix 1.1 } else {
149 phoenix 1.1 $nocatcontent = "\n ".'<li>'.(defined('ADMIN_PAGES') ? '<span>&raquo;</span><a>None</a>' : '<a><b>&#8226;</b> None</a>')."\n <ul>".$catcontent;
150 phoenix 1.1 $nocatcontent .= "\n </ul></li>";
151 phoenix 1.1 }
152 phoenix 1.1 }
153 phoenix 1.1 $content .= $nocatcontent;
154 phoenix 1.1  
155 phoenix 1.1 if (defined('ADMIN_PAGES') && is_admin())
156 phoenix 1.1 {
157 phoenix 1.1 $content .= "\n</ul></li>\n";
158 phoenix 1.1 global $CLASS;
159 phoenix 1.1 require_once(CORE_PATH.'classes/cpg_adminmenu.php');
160 phoenix 1.2 $content .= $CLASS['adminmenu']->display($ccat, 'cssmenu');
161 phoenix 1.1 }
162 phoenix 1.1  
163 phoenix 1.1 $content .= "\n</ul>\n";
164 phoenix 1.1 $mmcontent = $content;


Code Credits - Privacy Policy