[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] sitemgr inc/class.Categories_UI.inc.php inc/cla... [s
From: |
Dave Hall |
Subject: |
[Phpgroupware-cvs] sitemgr inc/class.Categories_UI.inc.php inc/cla... [skwashd-16-compat] |
Date: |
Sun, 15 Oct 2006 05:16:34 +0000 |
CVSROOT: /cvsroot/phpgroupware
Module name: sitemgr
Branch: skwashd-16-compat
Changes by: Dave Hall <skwashd> 06/10/15 05:16:34
Modified files:
inc : class.Categories_UI.inc.php
class.Pages_UI.inc.php class.Sites_BO.inc.php
class.Sites_UI.inc.php
modules : class.module_news.inc.php
class.module_news_side.inc.php
class.module_sitetree.inc.php
sitemgr-site : functions.inc.php
sitemgr-site/inc: class.Template3.inc.php class.sitebo.inc.php
templates/base : edit_page.tpl
Log message:
some notices, some fixes, some eye candy and some other stuff i have
probably forgotten
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/sitemgr/inc/class.Categories_UI.inc.php?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.1.2.1.4.4&r2=1.1.2.1.4.5
http://cvs.savannah.gnu.org/viewcvs/sitemgr/inc/class.Pages_UI.inc.php?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.1.2.1.4.1&r2=1.1.2.1.4.2
http://cvs.savannah.gnu.org/viewcvs/sitemgr/inc/class.Sites_BO.inc.php?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.7.2.1.4.3&r2=1.7.2.1.4.4
http://cvs.savannah.gnu.org/viewcvs/sitemgr/inc/class.Sites_UI.inc.php?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.6.2.1.4.3&r2=1.6.2.1.4.4
http://cvs.savannah.gnu.org/viewcvs/sitemgr/modules/class.module_news.inc.php?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.2.2.5.4.2&r2=1.2.2.5.4.3
http://cvs.savannah.gnu.org/viewcvs/sitemgr/modules/class.module_news_side.inc.php?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.1.2.1&r2=1.1.2.2
http://cvs.savannah.gnu.org/viewcvs/sitemgr/modules/class.module_sitetree.inc.php?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.1.2.3&r2=1.1.2.3.4.1
http://cvs.savannah.gnu.org/viewcvs/sitemgr/sitemgr-site/functions.inc.php?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.6.2.2.4.1&r2=1.6.2.2.4.2
http://cvs.savannah.gnu.org/viewcvs/sitemgr/sitemgr-site/inc/class.Template3.inc.php?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.5.2.1&r2=1.5.2.1.4.1
http://cvs.savannah.gnu.org/viewcvs/sitemgr/sitemgr-site/inc/class.sitebo.inc.php?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.1.2.3.4.5&r2=1.1.2.3.4.6
http://cvs.savannah.gnu.org/viewcvs/sitemgr/templates/base/edit_page.tpl?cvsroot=phpgroupware&only_with_tag=skwashd-16-compat&r1=1.1.2.1&r2=1.1.2.2
Patches:
Index: inc/class.Categories_UI.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Categories_UI.inc.php,v
retrieving revision 1.1.2.1.4.4
retrieving revision 1.1.2.1.4.5
diff -u -b -r1.1.2.1.4.4 -r1.1.2.1.4.5
--- inc/class.Categories_UI.inc.php 15 Oct 2006 04:07:09 -0000
1.1.2.1.4.4
+++ inc/class.Categories_UI.inc.php 15 Oct 2006 05:16:33 -0000
1.1.2.1.4.5
@@ -97,9 +97,15 @@
}
else
{
+ $inputgroupaccessread =
isset($POST['inputgroupaccessread']) ? $_POST['inputgroupaccessread'] : array();
+ $inputgroupaccesswrite =
isset($POST['inputgroupaccesswrite']) ? $_POST['inputgroupaccesswrite'] :
array();
+
+ $inputindividualaccessread =
isset($POST['inputindividualaccessread']) ? $_POST['inputindividualaccessread']
: array();
+ $inputindividualaccesswrite =
isset($POST['inputindividualaccesswrite']) ?
$_POST['inputindividualaccesswrite'] : array();
+
$cat_id = $cat_id ? $cat_id :
$this->cat_bo->addCategory('','');
- $groupaccess =
array_merge_recursive($_POST['inputgroupaccessread'],
$_POST['inputgroupaccesswrite']);
- $individualaccess =
array_merge_recursive($_POST['inputindividualaccessread'],
$_POST['inputindividualaccesswrite']);
+ $groupaccess =
array_merge_recursive($inputgroupaccessread, $inputgroupaccesswrite);
+ $individualaccess =
array_merge_recursive($inputindividualaccessread, $inputindividualaccesswrite);
$savelanguage =
isset($_POST['savelanguage']) && $_POST['savelanguage'] ?
$_POST['savelanguage'] : $this->sitelanguages[0];
$this->cat_bo->saveCategoryInfo($cat_id,
$_POST['inputcatname'],
Index: inc/class.Pages_UI.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Pages_UI.inc.php,v
retrieving revision 1.1.2.1.4.1
retrieving revision 1.1.2.1.4.2
diff -u -b -r1.1.2.1.4.1 -r1.1.2.1.4.2
--- inc/class.Pages_UI.inc.php 14 Aug 2006 06:44:55 -0000 1.1.2.1.4.1
+++ inc/class.Pages_UI.inc.php 15 Oct 2006 05:16:34 -0000 1.1.2.1.4.2
@@ -7,7 +7,7 @@
* Free Software Foundation; either version 2 of the License, or (at
your *
* option) any later version.
*
\*************************************************************************/
- /* $Id: class.Pages_UI.inc.php,v 1.1.2.1.4.1 2006/08/14 06:44:55
skwashd Exp $ */
+ /* $Id: class.Pages_UI.inc.php,v 1.1.2.1.4.2 2006/10/15 05:16:34
skwashd Exp $ */
class Pages_UI
{
@@ -51,8 +51,8 @@
global $btnAddPage, $btnDelete, $btnEditPage, $btnSave;
global $inputsort,$inputtitle, $inputname,
$inputsubtitle;
global $savelanguage;
- $page_id = $inputpageid ? $inputpageid :
$_GET['page_id'];
- $category_id = $inputcategoryid ? $inputcategoryid :
$_GET['cat_id'];
+ $page_id = $inputpageid ? $inputpageid :
(isset($_GET['page_id']) ? $_GET['page_id'] : 0);
+ $category_id = $inputcategoryid ? $inputcategoryid :
(isset($_GET['cat_id']) ? $_GET['cat_id'] : 0);
$this->t->set_file('EditPage', 'edit_page.tpl');
@@ -111,10 +111,13 @@
}
else
{
- $this->t->set_var(array(
+ $this->t->set_var(array
+ (
'add_edit' => lang('Add Page'),
'catselect' =>
$this->getParentOptions($category_id)
));
+
+ $page = createObject('sitemgr.Page_SO');
}
if (count($this->sitelanguages) > 1)
Index: inc/class.Sites_BO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Sites_BO.inc.php,v
retrieving revision 1.7.2.1.4.3
retrieving revision 1.7.2.1.4.4
diff -u -b -r1.7.2.1.4.3 -r1.7.2.1.4.4
--- inc/class.Sites_BO.inc.php 29 Sep 2006 10:00:52 -0000 1.7.2.1.4.3
+++ inc/class.Sites_BO.inc.php 15 Oct 2006 05:16:34 -0000 1.7.2.1.4.4
@@ -9,7 +9,7 @@
* option) any later version. *
\**************************************************************************/
- /* $Id: class.Sites_BO.inc.php,v 1.7.2.1.4.3 2006/09/29 10:00:52 skwashd Exp
$ */
+ /* $Id: class.Sites_BO.inc.php,v 1.7.2.1.4.4 2006/10/15 05:16:34 skwashd Exp
$ */
class Sites_BO
{
@@ -177,10 +177,10 @@
}
else
{
- $currentsite =
$GLOBALS['phpgw_info']['user']['preferences']['sitemgr']['currentsite'];
- if($currentsite)
+ if (
isset($GLOBALS['phpgw_info']['user']['preferences']['sitemgr']['currentsite'])
+ &&
$GLOBALS['phpgw_info']['user']['preferences']['sitemgr']['currentsite'] )
{
- $this->current_site =
$this->read($currentsite);
+ $this->current_site =
$this->read($GLOBALS['phpgw_info']['user']['preferences']['sitemgr']['currentsite']);
}
}
}
Index: inc/class.Sites_UI.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Sites_UI.inc.php,v
retrieving revision 1.6.2.1.4.3
retrieving revision 1.6.2.1.4.4
diff -u -b -r1.6.2.1.4.3 -r1.6.2.1.4.4
--- inc/class.Sites_UI.inc.php 29 Sep 2006 10:00:52 -0000 1.6.2.1.4.3
+++ inc/class.Sites_UI.inc.php 15 Oct 2006 05:16:34 -0000 1.6.2.1.4.4
@@ -9,7 +9,7 @@
* option) any later version. *
\**************************************************************************/
- /* $Id: class.Sites_UI.inc.php,v 1.6.2.1.4.3 2006/09/29 10:00:52 skwashd Exp
$ */
+ /* $Id: class.Sites_UI.inc.php,v 1.6.2.1.4.4 2006/10/15 05:16:34 skwashd Exp
$ */
//copied from class admin.uiservers
class Sites_UI
@@ -59,7 +59,8 @@
function save_sessiondata()
{
- $data = array(
+ $data = array
+ (
'start' => $this->start,
'query' => $this->query,
'sort' => $this->sort,
@@ -77,14 +78,15 @@
$this->deny();
}
+ $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
$GLOBALS['phpgw']->template->set_file('site_list_t',
'listsites.tpl');
$GLOBALS['phpgw']->template->set_block('site_list_t','site_list','list');
-
$GLOBALS['phpgw']->template->set_var('add_action',$GLOBALS['phpgw']->link('/index.php','menuaction=sitemgr.Sites_UI.edit'));
+
$GLOBALS['phpgw']->template->set_var('add_action',$GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'sitemgr.Sites_UI.edit') ) );
$GLOBALS['phpgw']->template->set_var('lang_add',lang('Add'));
$GLOBALS['phpgw']->template->set_var('title_sites',lang('Sitemgr Websites'));
$GLOBALS['phpgw']->template->set_var('lang_search',lang('Search'));
-
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=sitemgr.Sites_UI.list_sites'));
+
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'sitemgr.Sites_UI.list_sites') ) );
$GLOBALS['phpgw']->template->set_var('lang_done',lang('Done'));
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/admin/index.php'));
@@ -95,8 +97,8 @@
$this->save_sessiondata();
- $left =
$this->nextmatchs->left('/index.php',$this->start,$this->bo->total,'menuaction=sitemgr.Sites_UI.list_sites');
- $right =
$this->nextmatchs->right('/index.php',$this->start,$this->bo->total,'menuaction=sitemgr.Sites_UI.list_sites');
+ $left =
$this->nextmatchs->left('/index.php',$this->start,$this->bo->total,
array('menuaction' => 'sitemgr.Sites_UI.list_sites') );
+ $right =
$this->nextmatchs->right('/index.php',$this->start,$this->bo->total,
array('menuaction' => 'sitemgr.Sites_UI.list_sites') );
$GLOBALS['phpgw']->template->set_var(array
(
@@ -106,10 +108,10 @@
'lang_edit' => lang('Edit'),
'lang_delete' => lang('Delete'),
'sort_name' =>
$this->nextmatchs->show_sort_order(
-
$this->sort,'site_name',$this->order,'/index.php',lang('Name'),'&menuaction=sitemgr.Sites_UI.list_sites'
+
$this->sort,'site_name',$this->order,'/index.php',lang('Name'),
array('menuaction' => 'sitemgr.Sites_UI.list_sites')
),
'sort_url' =>
$this->nextmatchs->show_sort_order(
-
$this->sort,'site_url',$this->order,'/index.php',lang('URL'),'&menuaction=sitemgr.Sites_UI.list_sites'
+
$this->sort,'site_url',$this->order,'/index.php',lang('URL'),
array('menuaction' => 'sitemgr.Sites_UI.list_sites')
)
));
@@ -124,22 +126,22 @@
'row_class' =>
$row_class,
'site_name' =>
$GLOBALS['phpgw']->strip_html($site['site_name']),
'site_url' =>
$site['site_url'],
- 'edit' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=sitemgr.Sites_UI.edit&site_id='
. $site_id),
+ 'edit' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'sitemgr.Sites_UI.edit', 'site_id' => $site_id) ),
'lang_edit_entry' => lang('Edit'),
- 'delete' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=sitemgr.Sites_UI.delete&site_id='
. $site_id),
+ 'delete' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'sitemgr.Sites_UI.delete', 'site_id' => $site_id) ),
'lang_delete_entry' =>
lang('Delete')
));
$GLOBALS['phpgw']->template->parse('list','site_list', true);
}
- $GLOBALS['phpgw']->template->pfp('out','site_list_t',
true);
+ $GLOBALS['phpgw']->template->pfp('out','site_list_t');
$this->common_ui->DisplayFooter();
}
/* This function handles add or edit */
function edit()
{
- if ($_POST['done'])
+ if ( isset($_POST['done']) && $_POST['done'] )
{
return $this->list_sites();
}
@@ -149,7 +151,7 @@
{
$this->deny();
}
- if ($_POST['delete'])
+ if ( isset($_POST['delete']) && $_POST['delete'] )
{
return $this->delete();
}
@@ -160,7 +162,7 @@
$GLOBALS['phpgw']->template->set_block('form','add','addhandle');
$GLOBALS['phpgw']->template->set_block('form','edit','edithandle');
- if ($_POST['save'])
+ if ( isset($_POST['save']) && $_POST['save'] )
{
if (!$_POST['site']['name'])
{
@@ -169,12 +171,12 @@
elseif ($site_id)
{
$this->bo->update($site_id,$_POST['site']);
-
$GLOBALS['phpgw']->template->set_var('message',lang('Site %1 has been
updated',$_POST['site']['_name']));
+
$GLOBALS['phpgw']->template->set_var('message',lang('Site %1 has been
updated',$_POST['site']['name']));
}
else
{
$site_id =
$this->bo->add($_POST['site']);
-
$GLOBALS['phpgw']->template->set_var('message',lang('Site %1 has been
added',$_POST['site']['_name']));
+
$GLOBALS['phpgw']->template->set_var('message',lang('Site %1 has been
added',$_POST['site']['name']));
}
}
else
@@ -188,7 +190,7 @@
$GLOBALS['phpgw']->template->set_var('title_sites',$site_id ? lang('Edit
Website') : lang('Add Website'));
-
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=sitemgr.Sites_UI.edit'));
+
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'sitemgr.Sites_UI.edit')));
$GLOBALS['phpgw']->template->set_var(array(
'lang_name' => lang('Site name'),
@@ -222,11 +224,6 @@
$GLOBALS['phpgw']->template->set_var('site_adminlist',$this->adminselectlist($site_id));
$GLOBALS['phpgw']->template->set_var('site_id',$site_id);
- $GLOBALS['phpgw']->template->set_var(array(
- 'th' =>
$GLOBALS['phpgw_info']['theme']['th_bg'],
- 'row_on' =>
$GLOBALS['phpgw_info']['theme']['row_on'],
- 'row_off' =>
$GLOBALS['phpgw_info']['theme']['row_off']
- ));
if ($site_id)
{
$GLOBALS['phpgw']->template->parse('edithandle','edit');
@@ -247,7 +244,8 @@
$accounts = $GLOBALS['phpgw']->accounts->get_list();
$admin_list = $this->bo->get_adminlist($site_id);
- while (list($null,$account) = each($accounts))
+ $selectlist = '';
+ foreach ( $accounts as $account )
{
$selectlist .= '<option value="' .
$account['account_id'] . '"';
if($admin_list[$account['account_id']] ==
SITEMGR_ACL_IS_ADMIN)
@@ -276,7 +274,7 @@
{
$this->bo->delete($site_id);
}
-
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction=sitemgr.Sites_UI.list_sites');
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'sitemgr.Sites_UI.list_sites'));
}
else
{
@@ -288,7 +286,7 @@
$GLOBALS['phpgw']->template->set_file(array('site_delete' =>
'delete_common.tpl'));
$GLOBALS['phpgw']->template->set_var(array(
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=sitemgr.Sites_UI.delete'),
+ 'form_action' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'sitemgr.Sites_UI.delete')),
'hidden_vars' => '<input type="hidden"
name="site_id" value="' . $site_id .
'"><script>document.yesbutton.yesbutton.focus()</script>',
'messages' => lang('Are you sure you
want to delete site %1 and all its content? You cannot retrieve it if you
continue.',$site['site_name']),
'no' => lang('No'),
Index: modules/class.module_news.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/modules/class.module_news.inc.php,v
retrieving revision 1.2.2.5.4.2
retrieving revision 1.2.2.5.4.3
diff -u -b -r1.2.2.5.4.2 -r1.2.2.5.4.3
--- modules/class.module_news.inc.php 23 Aug 2006 13:32:03 -0000
1.2.2.5.4.2
+++ modules/class.module_news.inc.php 15 Oct 2006 05:16:34 -0000
1.2.2.5.4.3
@@ -19,7 +19,7 @@
$this->properties = array();
$this->title = lang('News module');
$this->description = lang('This module publishes news
from the news_admin application on your website. Be aware of news_admin\'s ACL
restrictions.');
- $this->template;
+ $this->template = null;//we use this hack to define
this instance variable here
}
function get_user_interface()
@@ -42,6 +42,7 @@
function get_content(&$arguments,$properties)
{
+ //echo "news::get_content(args = " .
print_r($arguments, true) . ", \nprops = " . print_r($properties, ture) .
')<br>';
$bonews = CreateObject('news_admin.bonews');
$this->template = createobject('phpgwapi.Template');
@@ -56,8 +57,8 @@
{
$this->template->set_var('rsslink',
$GLOBALS['Common_BO']->sites->current_site['site_url']
- .
($sitemgr_info['htaccess_rewrite'] ? 'news/feed' : 'index.php?news=feed')
- .
($cat_id > 0 ? "cat-$cat_id" : ''));
+ .
($GLOBALS['sitemgr_info']['htaccess_rewrite'] ? 'news/feed' :
'index.php?news=feed')
+ .
(isset($arguments['cat_id']) ? "cat-{$arguments['cat_id']}" : ''));
$this->template->parse('rsshandle','rss');
}
else
@@ -68,7 +69,7 @@
if ( isset($arguments['item']) && (int)
$arguments['item'] > 0 )
{
$newsitem =
$bonews->get_news($arguments['item']);
- if ( is_array($newsitem) &&
($newsitem['category'] == $arguments['category']))
+ if ( is_array($newsitem) && (
!isset($newsitem['category']) || $arguments['category'] == 0 ||
$newsitem['category'] == $arguments['category']) )
{
$this->render($newsitem);
$link_data['item'] = 0;
@@ -113,7 +114,8 @@
function render($newsitem)
{
- $this->template->set_var(array(
+ $this->template->set_var(array
+ (
'news_title' => $newsitem['subject'],
'news_submitter' =>
$GLOBALS['phpgw']->accounts->id2name($newsitem['submittedby']),
'news_date' =>
$GLOBALS['phpgw']->common->show_date($newsitem['date']),
Index: modules/class.module_news_side.inc.php
===================================================================
RCS file:
/cvsroot/phpgroupware/sitemgr/modules/Attic/class.module_news_side.inc.php,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -b -r1.1.2.1 -r1.1.2.2
--- modules/class.module_news_side.inc.php 19 Aug 2006 03:56:01 -0000
1.1.2.1
+++ modules/class.module_news_side.inc.php 15 Oct 2006 05:16:34 -0000
1.1.2.2
@@ -11,7 +11,7 @@
$this->properties = array();
$this->title = lang('Side News module');
$this->description = lang("This module displayes news
from the news_admin application in a side bloack on your website. Be aware of
news_admin's ACL restrictions.");
- $this->template;
+ $this->template = null;
}
function get_user_interface()
Index: modules/class.module_sitetree.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/modules/class.module_sitetree.inc.php,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.3.4.1
diff -u -b -r1.1.2.3 -r1.1.2.3.4.1
--- modules/class.module_sitetree.inc.php 23 Jun 2003 20:31:21 -0000
1.1.2.3
+++ modules/class.module_sitetree.inc.php 15 Oct 2006 05:16:34 -0000
1.1.2.3.4.1
@@ -9,7 +9,7 @@
$this->cookie = array('menutree');
$this->title = lang('Site Tree Menu');
$this->description = lang('This block displays a javascript
based tree menu');
- $this->expandedcats;
+ $this->expandedcats = null;
}
function showcat($cats)
Index: sitemgr-site/functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/sitemgr-site/functions.inc.php,v
retrieving revision 1.6.2.2.4.1
retrieving revision 1.6.2.2.4.2
diff -u -b -r1.6.2.2.4.1 -r1.6.2.2.4.2
--- sitemgr-site/functions.inc.php 24 Jul 2006 03:31:54 -0000
1.6.2.2.4.1
+++ sitemgr-site/functions.inc.php 15 Oct 2006 05:16:34 -0000
1.6.2.2.4.2
@@ -20,7 +20,7 @@
function sitemgr_link($extravars = '')
{
- $kp3 = $_GET['kp3'] ? $_GET['kp3'] : $_COOKIE['kp3'];
+ $kp3 = isset($_REQUEST['kp3']) ? $_REQUEST['kp3'] : '';
if (! $kp3)
{
@@ -35,75 +35,35 @@
parse_str($extravars,$extravarsnew);
$extravars = $extravarsnew;
}
- $page_name = $extravars['page_name'];
+ $url = '/';
if (!$page_name == '' &&
$GLOBALS['sitemgr_info']['htaccess_rewrite'])
{
$url = '/'.$page_name;
- $newextravars=array();
- while (list($key,$value) = each($extravars))
+ if ( isset($extravars['page_name']) )
{
- if ($key != 'page_name')
- {
- $newextravars[$key]=$value;
+ unset($extravars['page_name']);
}
}
- $extravars = $newextravars;
+
+ if ( !isset($GLOBALS['phpgw_info']['server']['usecookies']) ||
!$GLOBALS['phpgw_info']['server']['usecookies'] )
+ {
+ $extravars['sessionid'] =
$GLOBALS['phpgw_info']['user']['sessionid'];
+ $extravars['kp3'] = $kp3;
+ $extravars['domain'] =
$GLOBALS['phpgw_info']['user']['domain'];
}
- // In certain instances (wouldn't it be better to fix these
instances? MT)
- // a url may look like this: 'http://xyz//hi.php' or
- // like this: '//index.php?blahblahblah' -- so the code below
will remove
- // the inappropriate double slashes and leave appropriate ones
- $url = $GLOBALS['sitemgr_info']['site_url'] . $url;
- $url = substr(ereg_replace('([^:])//','\1/','s'.$url),1);
+ // remove // or /./ from path
+ $url = realpath($GLOBALS['sitemgr_info']['site_url'] . $url);
// build the extravars string from a array
- if (is_array($extravars))
- {
- foreach($extravars as $key => $value)
- {
- if (!empty($new_extravars))
- {
- $new_extravars .= '&';
- }
- $new_extravars .= (($value == '') ? $key :
($key . '=' . urlencode($value)) );
- }
- // This needs to be explictly reset to a string
variable type for PHP3
- $extravars = $new_extravars;
- }
- if (isset($GLOBALS['phpgw_info']['server']['usecookies']) &&
$GLOBALS['phpgw_info']['server']['usecookies'])
- {
- if ($extravars)
+ $qstr = '';
+ if ( is_array($extravars) )
{
- $url .= '?' . $extravars;
- }
- }
- else
- {
- $sessionID = 'sessionid=' .
@$GLOBALS['phpgw_info']['user']['sessionid'];
- $sessionID .= '&kp3=' . $kp3;
- $sessionID .= '&domain=' .
@$GLOBALS['phpgw_info']['user']['domain'];
- // This doesn't belong in the API.
- // Its up to the app to pass this value. (jengo)
- // Putting it into the app requires a massive number of
updates in email app.
- // Until that happens this needs to stay here (seek3r)
- if (isset($GLOBALS['phpgw_info']['flags']['newsmode'])
&&
- $GLOBALS['phpgw_info']['flags']['newsmode'])
- {
- $url .= '&newsmode=on';
- }
- if ($extravars)
- {
- $url .= '?' . $extravars . '&' . $sessionID;
- }
- else
- {
- $url .= '?' . $sessionID;
- }
+ $qstr = '?' . http_build_query($extravars, 0, '&');
}
- return $url;
+ return $url . $qstr;
}
?>
Index: sitemgr-site/inc/class.Template3.inc.php
===================================================================
RCS file:
/cvsroot/phpgroupware/sitemgr/sitemgr-site/inc/class.Template3.inc.php,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.1.4.1
diff -u -b -r1.5.2.1 -r1.5.2.1.4.1
--- sitemgr-site/inc/class.Template3.inc.php 23 Jun 2003 20:31:21 -0000
1.5.2.1
+++ sitemgr-site/inc/class.Template3.inc.php 15 Oct 2006 05:16:34 -0000
1.5.2.1.4.1
@@ -111,7 +111,7 @@
"/\{contentarea:([^{ ]+)\}/",
array($this,'process_blocks'),
$this->template);
- $this->permitted_modules =
array_keys($this->modulebo->getcascadingmodulepermissions('__PAGE__',$page->cat_id));
+ $this->permitted_modules =
array_keys($this->modulebo->getcascadingmodulepermissions('__PAGE__',
$GLOBALS['page']->cat_id));
//process module calls hardcoded into template of form
{modulename?arguments}
$str = preg_replace_callback(
"/\{([[:alnum:]_-]+)\?([^{ ]+)?\}/",
@@ -294,7 +294,11 @@
return $page->subtitle;
case 'sitename':
case 'site_name':
+ if (
isset($GLOBALS['sitemgr_info']['site_name_' .
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang']]) )
+ {
return
$GLOBALS['sitemgr_info']['site_name_' .
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang']];
+ }
+ return '';
case 'sitedesc':
case 'site_desc':
return
$GLOBALS['sitemgr_info']['site_desc_' .
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang']];
Index: sitemgr-site/inc/class.sitebo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/sitemgr-site/inc/class.sitebo.inc.php,v
retrieving revision 1.1.2.3.4.5
retrieving revision 1.1.2.3.4.6
diff -u -b -r1.1.2.3.4.5 -r1.1.2.3.4.6
--- sitemgr-site/inc/class.sitebo.inc.php 25 Aug 2006 10:01:58 -0000
1.1.2.3.4.5
+++ sitemgr-site/inc/class.sitebo.inc.php 15 Oct 2006 05:16:34 -0000
1.1.2.3.4.6
@@ -8,15 +8,35 @@
* Free Software Foundation; either version 2 of the License, or (at
your *
* option) any later version.
*
\*************************************************************************/
- /* $Id: class.sitebo.inc.php,v 1.1.2.3.4.5 2006/08/25 10:01:58 skwashd
Exp $ */
+ /* $Id: class.sitebo.inc.php,v 1.1.2.3.4.6 2006/10/15 05:16:34 skwashd
Exp $ */
class sitebo
{
+ /**
+ * @var object $pages_bo reference to the pages logic class
+ */
var $pages_bo;
+
+ /**
+ * @var object $cat_bo reference to the categories logic class
+ */
var $catbo;
+
+ /**
+ * @var object $acl reference to the access control logic class
+ */
var $acl;
+
+ /**
+ * @var int $cur_cat the id of the category the current page
belongs to
+ */
var $cur_cat = 0;
+ /**
+ * @var bool $is_admin does the current user have admin rights
to this site?
+ */
+ var $is_admin = false;
+
function sitebo()
{
$this->catbo = &$GLOBALS['Common_BO']->cats;
@@ -226,7 +246,8 @@
}
else
{
- if ($sitemgr_info['home_page_id'])
+ if ( isset($sitemgr_info['home_page_id'])
+ && $sitemgr_info['home_page_id'] )
{
$page =
$GLOBALS['Common_BO']->pages->getPage($sitemgr_info['home_page_id']);
if ( isset($page->cat_id) &&
$page->cat_id )
@@ -260,7 +281,7 @@
$page->block->module_id =
$GLOBALS['Common_BO']->modules->getmoduleid('index');
$page->block->view = SITEMGR_VIEWABLE_EVERBODY;
$page->block->status = SITEMGR_STATE_PUBLISH;
- $page->cat_id =
$GLOBALS['Common_BO']->current_site['site_id'];
+ $page->cat_id = CURRENT_SITE_ID;
//$GLOBALS['Common_BO']->current_site['site_id'];
return true;
}
@@ -337,6 +358,7 @@
$page->block->module_id =
$GLOBALS['Common_BO']->modules->getmoduleid('news');
$page->block->view = SITEMGR_VIEWABLE_EVERBODY;
$page->block->state = SITEMGR_STATE_PUBLISH;
+ $_GET['block'][$page->block->module_id] = array('item'
=> $item, 'category' => $cat_id);
$page->block->arguments = array('item' => $item,
'category' => $cat_id);
return true;
}
@@ -390,7 +412,7 @@
//is there a more efficient way to do the same thing?
unset($GLOBALS['lang']);
$supportedLanguages =
$GLOBALS['sitemgr_info']['sitelanguages'] ?
$GLOBALS['sitemgr_info']['sitelanguages'] : array('en');
- $postlang = trim($_GET['lang']);
+ $postlang = isset($_GET['lang']) ? trim($_GET['lang'])
: '';
if ($postlang &&
in_array($postlang,$supportedLanguages))
{
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $postlang;
Index: templates/base/edit_page.tpl
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/templates/base/edit_page.tpl,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -b -r1.1.2.1 -r1.1.2.2
--- templates/base/edit_page.tpl 6 Oct 2006 04:15:20 -0000 1.1.2.1
+++ templates/base/edit_page.tpl 15 Oct 2006 05:16:34 -0000 1.1.2.2
@@ -1,54 +1,103 @@
-<!-- BEGIN form -->
-<form method ="POST">
-<input type="hidden" name="inputpageid" value="{page_id}">
-<table align='center' border ="0" width="80%" cellpadding="5" cellspacing="0">
- <tr>
- <td colspan='2' align='center'><font
size='4'><b>{add_edit}</b></font></td>
- </tr>
- <tr>
- <td colspan='2' align='center'><font size='2'
color='#ff0000'><b>{message}</b></font></td>
- </tr>
- <tr>
- <td><b>{lang_name}: <font size='2'
color='#ff0000'>*</font></b></td>
- <td><input size="40" type="text" name="inputname" id="name"
value="{name}"></td>
- </tr>
- <tr>
- <td><br></td>
- <td><i><b><font size='2' color='#ff0000'>(Do not put spaces or
punctuation in the Name field.)</font></b></i></td>
- <tr>
- <td><b>{lang_title}: <font size='2'
color='#ff0000'>*</font></b></td>
- <td><input size="40" type="text" name="inputtitle"
value="{title}"></td>
- </tr>
- <tr>
- <td><b>{lang_subtitle}: </b></td>
- <td><input size="40" type="text" name="inputsubtitle"
value="{subtitle}"></td>
- </tr>
- <tr>
- <td><b>{lang_sort}: </b></td>
- <td><input size="10" type="text" name="inputsort"
value="{sort_order}"></td>
- </tr>
- <tr>
- <td><b>{lang_category}: </b></td>
- <td>{catselect}</td>
- </tr>
- <tr>
- <td><b>{lang_state}: </b></td>
- <td><select name="inputstate">{stateselect}</select></td>
- </tr>
- <tr>
- <td align='right'><input type='checkbox' {hidden} name
="inputhidden"></td>
- <td>{lang_hide}</td>
- </tr>
- <tr>
- <td colspan="2" align='center'>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <title>{add_edit}</title>
+ <style type="text/css">
+ body, div, input, p, select, td, textarea
+ {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ }
+
+ br
+ {
+ clear: left;
+ }
+
+ fieldset
+ {
+ border: 0px;
+ }
+
+ fieldset input, fieldset label, fieldset select,
fieldset textarea
+ {
+ display: block;
+ float: left;
+ margin-bottom: 10px;
+ width: 250px;
+ }
+
+ fieldset label
+ {
+ display: block;
+ font-weight: bold;
+ width: 150px;
+ }
+
+ fieldset input.check, fieldset label.check
+ {
+ width: auto;
+ }
+
+ .msg
+ {
+ color: #f00;
+ font-weight: bold;
+ text-align: center;
+ }
+
+ .mand
+ {
+ color: #f00;
+ font-weight: bold;
+ }
+
+ form
+ {
+ width: 600px;
+ margin: 10px auto;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>{add_edit}</h1>
+ <div class="msg">{message}</div>
+ <form method="post">
+ <input type="hidden" name="inputpageid"
value="{page_id}">
+
+ <fieldset>
+ <label for="inputname">{lang_name} <span
class="mand">*</span></label>
+ <input type="text" name="inputname"
id="inputname" value="{name}" />
+ <em>(Do not put spaces or punctuation in the
Name field.)</em>
+ <br />
+
+ <label for="inputtitle">{lang_title} <span
class="mand">*</span></label>
+ <input type="text" name="inputtitle"
id="inuputtitle" value="{title}" /><br />
+
+ <label
for="inputsubtitle">{lang_subtitle}</label>
+ <input type="text" name="inputsubtitle"
id="inputsubtitle" value="{subtitle}" /><br />
+
+ <label for="inputsort">{lang_sort}</label>
+ <input type="text" id="inputsort"
name="inputsort" value="{sort_order}" /><br />
+
+ <label for="inputcats">{lang_category}</label>
+ {catselect}<br />
+
+ <label for="inputstate">{lang_state}</label>
+ <select name="inputstate"
id="inputstate">{stateselect}</select><br />
+
+ <input type='checkbox' {hidden}
id="inputhidden" name="inputhidden" class="check">
+ <label for="intputhidden"
class="check">{lang_hide}</label>
+ </fieldset>
+
+ <div class="msg">* {lang_required}</div>
+
+ <div class="button_group">
<input type="reset" value="{lang_reset}">
<input type="submit" name="btnSave"
value="{lang_save}"> {savelang}
<input type="reset"
onclick="opener.location.reload();self.close()" value="{lang_done}" />
- </td>
- </tr>
- <tr>
- <td align='center' colspan='2'><font size='2'
color='#ff0000'><b>* {lang_required}</b></font></td>
- </tr>
-</table>
-</form>
-<!-- END form -->
+ </div>
+ </form>
+ </body>
+</html>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] sitemgr inc/class.Categories_UI.inc.php inc/cla... [skwashd-16-compat],
Dave Hall <=