|
From: <ada...@us...> - 2003-07-14 20:46:29
|
Update of /cvsroot/phpwebsite-comm/modules/article/class
In directory sc8-pr-cvs1:/tmp/cvs-serv28283/class
Modified Files:
Article.php ArticleManager.php Section.php
Log Message:
General bugfixes, including resolution and optimization of various article deletion issues
Index: Article.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/article/class/Article.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Article.php 10 Jul 2003 18:12:05 -0000 1.2
--- Article.php 14 Jul 2003 20:46:24 -0000 1.3
***************
*** 204,208 ****
/* My copyright statement. Do not disable or remove. */
$rights = array( 'http://www.vibride.com','http://www.realvidreams.com','http://www.bygeorgeware.com','http://www.bygeorgeadvertising.com');
! $copyright = '<div style="text-align:right;font-size:8pt"><a href="'.$rights[rand(0,2)].'">©</a></div>';
$article_tags = array();
--- 204,208 ----
/* My copyright statement. Do not disable or remove. */
$rights = array( 'http://www.vibride.com','http://www.realvidreams.com','http://www.bygeorgeware.com','http://www.bygeorgeadvertising.com');
! $copyright = '<div style="text-align:right;font-size:8pt"><a href="'.$rights[rand(0,2)].'">i</a></div>';
$article_tags = array();
***************
*** 337,352 ****
/* if user can edit articles or can edit this article... */
! if ($_SESSION['SES_ART_master']->can('edit',$this->created_username))
! /* If someone else is editing this page... */
! if ($this->isLocked(&$this->editlock, &$this->edituser))
! $article_tags['EDIT'] = '['. $_SESSION['translate']->it('Locked') . ']';
! else
! $article_tags['EDIT'] = '[<a href="index.php?module=article&edit='.$this->id
! .'" target="_blank">' . $_SESSION['translate']->it('Edit').'</a>]';
/* if user can delete articles or can delete this article... */
! if ($_SESSION['SES_ART_master']->can('delete',$this->created_username))
! $article_tags['DELETE'] = '[<a href="index.php?module=article&edit=delete&ARTICLE_id='
! . $this->id.'" target="_blank">'.$_SESSION['translate']->it('Delete').' </a>]';
/* Show FatCat Category icons */
--- 337,352 ----
/* if user can edit articles or can edit this article... */
! if ($_SESSION['SES_ART_master']->can('edit',$this->created_username))
! /* If someone else is editing this page... */
! if ($this->isLocked(&$this->editlock, &$this->edituser))
! $article_tags['EDIT'] = '['. $_SESSION['translate']->it('Locked') . ']';
! else
! $article_tags['EDIT'] = '[<a href="index.php?module=article&edit='.$this->id
! .'">' . $_SESSION['translate']->it('Edit').'</a>]';
/* if user can delete articles or can delete this article... */
! if ($_SESSION['SES_ART_master']->can('delete',$this->created_username))
! $article_tags['DELETE'] = '[<a href="index.php?module=article&edit=delete&ARTICLE_id='
! . $this->id.'">'.$_SESSION['translate']->it('Delete').' </a>]';
/* Show FatCat Category icons */
***************
*** 377,381 ****
, 'article', 'article/'.$this->template.'/content.tpl');
if ($GLOBALS['module'] != "home") $GLOBALS['CNT_article']['content'] .= $copyright;
!
/* Article Comments */
if(isset($_SESSION['PHPWS_CommentManager']) && $this->allow_comments && !$this->mainarticle)
--- 377,381 ----
, 'article', 'article/'.$this->template.'/content.tpl');
if ($GLOBALS['module'] != "home") $GLOBALS['CNT_article']['content'] .= $copyright;
!
/* Article Comments */
if(isset($_SESSION['PHPWS_CommentManager']) && $this->allow_comments && !$this->mainarticle)
***************
*** 801,826 ****
if(isset($_SESSION['OBJ_fatcat']))
PHPWS_Fatcat::deleteModuleElements('article', $this->id);
-
/* Delete references to this article in the menu */
! $result = $GLOBALS['core']->getAll('SELECT menu_item_id,menu_item_url FROM mod_menuman_items WHERE menu_item_url = "./index.php?module=article&view='.$this->id.'"', true);
! if(!is_array($result))
! echo "NO MENU RECORDS FOUND!";
! else
{
! foreach($result as $value)
{
! $children = $GLOBALS['core']->getAll('SELECT menu_item_id FROM mod_menuman_items WHERE menu_item_pid='
! .$value['menu_item_id'].' and menu_item_id !='.$value['menu_item_id'], true);
! /* If this menu item has children, just point it to nowhere */
! if(is_array($children))
{
! $isParent = TRUE;
! $GLOBALS['core']->query('UPDATE mod_menuman_items SET menu_item_url="./index.php?module=article" WHERE menu_item_id='.$value['menu_item_id'], true);
}
! /* otherwise, delete it */
! else
! $GLOBALS['core']->sqlDelete('mod_menuman_items', 'menu_item_id', $item['menu_item_id']);
}
- unset($_SESSION['OBJ_menuman']);
}
--- 801,828 ----
if(isset($_SESSION['OBJ_fatcat']))
PHPWS_Fatcat::deleteModuleElements('article', $this->id);
/* Delete references to this article in the menu */
! if($GLOBALS['core']->moduleExists('menuman'))
{
! $result = $GLOBALS['core']->getAll('SELECT menu_item_id,menu_item_url FROM mod_menuman_items WHERE menu_item_url = "./index.php?module=article&view='.$this->id.'"', true);
! if(!is_array($result))
! echo "NO MENU RECORDS FOUND!";
! else
{
! foreach($result as $value)
{
! $children = $GLOBALS['core']->getAll('SELECT menu_item_id FROM mod_menuman_items WHERE menu_item_pid='
! .$value['menu_item_id'].' and menu_item_id !='.$value['menu_item_id'], true);
! /* If this menu item has children, just point it to nowhere */
! if(is_array($children))
! {
! $isParent = TRUE;
! $GLOBALS['core']->query('UPDATE mod_menuman_items SET menu_item_url="./index.php?module=article" WHERE menu_item_id='.$value['menu_item_id'], true);
! }
! /* otherwise, delete it */
! else
! $GLOBALS['core']->sqlDelete('mod_menuman_items', 'menu_item_id', $item['menu_item_id']);
}
! unset($_SESSION['OBJ_menuman']);
}
}
***************
*** 1091,1099 ****
* @param id : Id of the article to show.
*/
! function view_category_row ($id)
! {
! $this = new PHPWS_Article($id);
! $this->view(false);
! }
}
--- 1093,1101 ----
* @param id : Id of the article to show.
*/
! function fatCatview ($id)
! {
! $this = new PHPWS_Article($id);
! return $this->view(false, true);
! }
}
Index: ArticleManager.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/article/class/ArticleManager.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ArticleManager.php 9 Jul 2003 20:24:24 -0000 1.1
--- ArticleManager.php 14 Jul 2003 20:46:24 -0000 1.2
***************
*** 287,291 ****
* @return none
*/
! function list_news ()
{
/* Set up display variables */
--- 287,291 ----
* @return none
*/
! function view_news ()
{
/* Set up display variables */
***************
*** 295,299 ****
{
$this->pager = new PHPWS_Pager;
! $this->pager->setLinkBack('./index.php?module=article&disp=news');
$this->pager->makeArray(TRUE);
$this->pager->limit = $this->val['listings_per_page'];
--- 295,299 ----
{
$this->pager = new PHPWS_Pager;
! $this->pager->setLinkBack('./index.php?module=article&view=news');
$this->pager->makeArray(TRUE);
$this->pager->limit = $this->val['listings_per_page'];
***************
*** 356,360 ****
$content = $GLOBALS['core']->processTemplate($tags,'article','pager.tpl');
! $GLOBALS['CNT_article_summaries']['content'] = $content
. $GLOBALS['CNT_article_summaries']['content'] . $content;
}
--- 356,360 ----
$content = $GLOBALS['core']->processTemplate($tags,'article','pager.tpl');
! $GLOBALS['CNT_article_summaries']['content'] = $content . '<br />'
. $GLOBALS['CNT_article_summaries']['content'] . $content;
}
Index: Section.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/article/class/Section.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Section.php 9 Jul 2003 20:24:24 -0000 1.1
--- Section.php 14 Jul 2003 20:46:24 -0000 1.2
***************
*** 211,225 ****
$myelements[0] = $GLOBALS['core']->formCheckBox('SECT_new_page',1,$this->new_page,NULL, $_SESSION['translate']->it("Start on new page?"))
! . $_SESSION['OBJ_help']->show_link('article', 'section_new_page') . "<br />";
$myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_title')
! . $_SESSION['translate']->it('Section Title').':<br />'
. $GLOBALS['core']->js_insert('wysiwyg', 'SECT_edit', 'SECT_title');
$myelements[0] .= $GLOBALS['core']->formTextField('SECT_title', htmlspecialchars($this->title), 55, 79)
! . $_SESSION['OBJ_help']->show_link('article', 'section_title') . '<br />';
! $myelements[0] .= $_SESSION['translate']->it('Text').':<br />'
. $GLOBALS['core']->js_insert('wysiwyg', 'SECT_edit', 'SECT_text');
$myelements[0] .= $GLOBALS['core']->formTextArea("SECT_text", stripslashes($this->text), 20, 79)
! . $_SESSION['OBJ_help']->show_link('article', 'section_text') . '<br />';
/* If there is a current image, show it */
if($this->image['name'])
--- 211,227 ----
$myelements[0] = $GLOBALS['core']->formCheckBox('SECT_new_page',1,$this->new_page,NULL, $_SESSION['translate']->it("Start on new page?"))
! . $_SESSION['OBJ_help']->show_link('article', 'section_new_page') . '<br />';
$myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_title')
! . $_SESSION['translate']->it('Section Title').':'
! . $_SESSION['OBJ_help']->show_link('article', 'section_title').'<br />'
. $GLOBALS['core']->js_insert('wysiwyg', 'SECT_edit', 'SECT_title');
$myelements[0] .= $GLOBALS['core']->formTextField('SECT_title', htmlspecialchars($this->title), 55, 79)
! . '<br />';
! $myelements[0] .= $_SESSION['translate']->it('Section Text').':'
! . $_SESSION['OBJ_help']->show_link('article', 'section_text') .'<br />'
. $GLOBALS['core']->js_insert('wysiwyg', 'SECT_edit', 'SECT_text');
$myelements[0] .= $GLOBALS['core']->formTextArea("SECT_text", stripslashes($this->text), 20, 79)
! . '<br />';
/* If there is a current image, show it */
if($this->image['name'])
***************
*** 271,283 ****
/* Enter alt text, link, & image_caption */
$myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_alt')
! . $_SESSION['translate']->it('Short Image Description').': '
. $GLOBALS['core']->formTextField('SECT_alt', htmlspecialchars($this->image['alt']), 79, 255)
! . $_SESSION['OBJ_help']->show_link('article', 'section_image_desc') . '<br />';
$myelements[0] .= $_SESSION['translate']->it('This Image Links To') . '...: '
. $GLOBALS['core']->formTextField('SECT_link', htmlspecialchars($this->image['link']), 79, 255)
! . $_SESSION['OBJ_help']->show_link('article', 'section_image_link') . '<br />';
$myelements[0] .= $_SESSION['translate']->it('Link caption').': '
. $GLOBALS['core']->formTextField('SECT_image_caption', htmlspecialchars($this->image['caption']), 79, 255)
! . $_SESSION['OBJ_help']->show_link('article', 'section_image_caption') . '<br />';
}
--- 273,288 ----
/* Enter alt text, link, & image_caption */
$myelements[0] .= $_SESSION['SES_ART_master']->get_error('SECT_alt')
! . $_SESSION['translate']->it('Short Image Description') .': '
! . $_SESSION['OBJ_help']->show_link('article', 'section_image_desc')
. $GLOBALS['core']->formTextField('SECT_alt', htmlspecialchars($this->image['alt']), 79, 255)
! . '<br />';
$myelements[0] .= $_SESSION['translate']->it('This Image Links To') . '...: '
+ . $_SESSION['OBJ_help']->show_link('article', 'section_image_link')
. $GLOBALS['core']->formTextField('SECT_link', htmlspecialchars($this->image['link']), 79, 255)
! . '<br />';
$myelements[0] .= $_SESSION['translate']->it('Link caption').': '
+ . $_SESSION['OBJ_help']->show_link('article', 'section_image_caption')
. $GLOBALS['core']->formTextField('SECT_image_caption', htmlspecialchars($this->image['caption']), 79, 255)
! . '<br />';
}
***************
*** 329,333 ****
$temp_name = NULL;
! if(!$this->title && !$this->text && !isset($_POST['SECT_title']) && !isset($_POST['SECT_text']))
{
$_SESSION['SES_ART_master']->error['SECT_title'][]
--- 334,339 ----
$temp_name = NULL;
! if(!$this->title && !$this->text && !isset($_POST['SECT_title']) && !isset($_POST['SECT_text'])
! && !$this->image['name'] && !isset($_POST['SECT_lib_image']))
{
$_SESSION['SES_ART_master']->error['SECT_title'][]
|