|
From: Eloi G. <ada...@us...> - 2011-06-28 16:07:09
|
Update of /cvsroot/phpwebsite-comm/modules/article/class
In directory vz-cvs-2.sog:/tmp/cvs-serv6016/class
Modified Files:
Article.php
Log Message:
Adjusted copyright tag & Comment block header
Index: Article.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/article/class/Article.php,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** Article.php 3 Jan 2011 06:02:05 -0000 1.65
--- Article.php 28 Jun 2011 16:07:07 -0000 1.66
***************
*** 83,88 ****
var $_translations_needed;
var $_version_id = 0;
! var $_key = null;
! var $_thread = null;
/**
--- 83,88 ----
var $_translations_needed;
var $_version_id = 0;
! var $_key = null;
! var $_thread = null;
/**
***************
*** 193,197 ****
die($status->getMessage());
}
! $this->pages = $unserializer->getunserializedData();
unset($unserializer);
return true;
--- 193,197 ----
die($status->getMessage());
}
! $this->pages = $unserializer->getunserializedData();
unset($unserializer);
return true;
***************
*** 209,223 ****
function _get_tags ()
{
! if (isset($_REQUEST['op']) && $_REQUEST['op'] == 'view_version') {
! $vars['op'] = 'view_version';
! $vars['version_id'] = (int) $_REQUEST['version_id'];
! }
! else
! $vars['id'] = $this->id;
! $page_wanted = 1;
! if(!empty($_REQUEST['page']))
! $page_wanted = (int) $_REQUEST['page'];
! $printAll = @$_REQUEST['op']=='print' || @$_REQUEST['page']=='all';
!
$article_tags['TITLE'] = $this->title;
if(isset($_REQUEST['viewarchive']))
--- 209,223 ----
function _get_tags ()
{
! if (isset($_REQUEST['op']) && $_REQUEST['op'] == 'view_version') {
! $vars['op'] = 'view_version';
! $vars['version_id'] = (int) $_REQUEST['version_id'];
! }
! else
! $vars['id'] = $this->id;
! $page_wanted = 1;
! if(!empty($_REQUEST['page']))
! $page_wanted = (int) $_REQUEST['page'];
! $printAll = @$_REQUEST['op']=='print' || @$_REQUEST['page']=='all';
!
$article_tags['TITLE'] = $this->title;
if(isset($_REQUEST['viewarchive']))
***************
*** 235,246 ****
$article_tags['CREATED_DATE_LONG'] = PHPWS_AM_Data::get_long_date($this->created_date);
$article_tags['UPDATED_DATE_LONG'] = PHPWS_AM_Data::get_long_date($this->updated_date);
! $article_tags['CREATED_DATE_SHORT'] = PHPWS_AM_Data::get_short_date($this->created_date);
! $article_tags['UPDATED_DATE_SHORT'] = PHPWS_AM_Data::get_short_date($this->updated_date);
! $article_tags['CREATED_DATE_REL'] = PHPWS_Time::relativeTime(PHPWS_Time::getUserTime($this->created_date));
! $article_tags['UPDATED_DATE_REL'] = PHPWS_Time::relativeTime(PHPWS_Time::getUserTime($this->updated_date));
! // Default date format
! $article_tags['CREATED_DATE'] = $article_tags['CREATED_DATE_SHORT'];
! $article_tags['UPDATED_DATE'] = $article_tags['UPDATED_DATE_SHORT'];
!
if(!empty($this->expiration_date))
$article_tags['EXPIRATION_DATE'] = PHPWS_AM_Data::get_long_date($this->expiration_date);
--- 235,246 ----
$article_tags['CREATED_DATE_LONG'] = PHPWS_AM_Data::get_long_date($this->created_date);
$article_tags['UPDATED_DATE_LONG'] = PHPWS_AM_Data::get_long_date($this->updated_date);
! $article_tags['CREATED_DATE_SHORT'] = PHPWS_AM_Data::get_short_date($this->created_date);
! $article_tags['UPDATED_DATE_SHORT'] = PHPWS_AM_Data::get_short_date($this->updated_date);
! $article_tags['CREATED_DATE_REL'] = PHPWS_Time::relativeTime(PHPWS_Time::getUserTime($this->created_date));
! $article_tags['UPDATED_DATE_REL'] = PHPWS_Time::relativeTime(PHPWS_Time::getUserTime($this->updated_date));
! // Default date format
! $article_tags['CREATED_DATE'] = $article_tags['CREATED_DATE_SHORT'];
! $article_tags['UPDATED_DATE'] = $article_tags['UPDATED_DATE_SHORT'];
!
if(!empty($this->expiration_date))
$article_tags['EXPIRATION_DATE'] = PHPWS_AM_Data::get_long_date($this->expiration_date);
***************
*** 258,334 ****
$article_tags['CREATED_TEXT'] = sprintf(dgettext('article', 'Created By %1$s'), $this->created_username);
! $article_tags['UPDATED_TEXT'] = sprintf(dgettext('article', 'Last updated by %1$s'), $this->updated_username);
$article_tags['TITLE_LINK'] = $this->get_title_link();
!
! if($this->wordcount>0) {
! $article_tags['READMORE'] = '[' . PHPWS_Text::rewriteLink(dgettext('article', 'Read More'), 'article', $vars). ']';
! $article_tags['MOREWORDS'] = $this->wordcount." ".dgettext('article', 'more words');
! $article_tags['MOREPAGES'] = $this->pagecount . ' ' . (($this->pagecount==1) ?dgettext('article', 'page') :dgettext('article', 'pages'));
! }
!
! if (@$_REQUEST['module']=='article' && !$printAll) {
! $s = dgettext('article', 'Printable Version');
! $article_tags['PRINT_ICON'] = '<a href="./index.php?module=article&op=print&id='.$this->id
! .'" target="_blank" style="text-decoration:none" title="'. $s . '" rel="nofollow"><img src="' . PHPWS_Core::getHomeHttp()
! . 'images/mod/article/print.gif" border="0" width="22" height="20" alt="'.$s.'" />'.dgettext('article', 'Print').'</a>';
! $s = dgettext('article', 'E-mail this Article to a Friend');
! $article_tags['EMAIL'] = '<a href="./index.php?module=article&op=email&id='.$this->id
! .'" style="text-decoration:none" title="'.$s.'" rel="nofollow"><img src="'. PHPWS_Core::getHomeHttp()
! . 'images/mod/article/mailto.png" border="0" width="19" height="12" alt="'.$s.'" />'.dgettext('article', 'eMail').'</a>';
! }
!
! /* if user can edit articles or can edit this article... */
! if ($this->can_edit()) {
! /* If someone else is editing this article... */
! if ($this->isLocked($this->editlock, $this->edituser))
! $article_tags['EDIT'] = '['. dgettext('article', 'Locked') . ']';
! else
! $article_tags['EDIT'] = '[<a href="./index.php?module=article&op=edit&page='.$page_wanted.'&id='.$this->id
! .'">' . dgettext('article', 'Edit').'</a>]';
! }
!
! /* if user can delete articles or can delete this article... */
! if (Current_User::allow('article', 'delete_articles', $this->id))
! $article_tags['DELETE'] = '[<a href="./index.php?module=article&op=delete&id=' . $this->id.'">'.dgettext('article', 'Delete').' </a>]';
!
! /* Show Category links & icons */
! /* If Category info is cached, use it */
! $cat_link = $cat_icon = array();
! if (isset($GLOBALS['AMcategoryIdx'][$this->key_id])) {
! $cat_link = $GLOBALS['AMcategoryIdx'][$this->key_id]['cat_link'];
! $cat_icon = $GLOBALS['AMcategoryIdx'][$this->key_id]['cat_icon'];
! }
! else {
! $db = new PHPWS_DB('categories');
! $db->addWhere('category_items.key_id', $this->key_id);
! $db->addWhere('id', 'category_items.cat_id');
! $categories = $db->getObjects('Category');
! if (count($categories)) {
! foreach ($categories AS $category) {
! if (!is_object($category))
! break;
! $cat_link[] = $category->getViewLink('article');
! if ($category->icon)
! $cat_icon[] = $category->getViewLink('article', $category->getIcon());
! }
! }
! }
! if (!empty($cat_link))
! $article_tags['CATEGORY_LINKS'] = implode(', ', $cat_link);
! if (!empty($cat_icon))
! $article_tags['CATEGORY_ICONS'] = implode(' ', $cat_icon);
!
! /* Display available translation links */
! /* if ($_SESSION['translate']->langActive) {
! $arr = array();
! foreach ($this->_translations_available AS $key=>$value) {
! if ($this->language != $key)
! $arr[] = '['.PHPWS_Text::moduleLink($value, 'article', array('view'=>$this->id.' ', 'language'=>$key)).']';
! else
! $arr[] = '['.$value.']';
! }
! $article_tags['AVAILABLE_TRANSLATIONS'] = implode(' ', $arr);
! }
! */
/* Develop article content */
--- 258,334 ----
$article_tags['CREATED_TEXT'] = sprintf(dgettext('article', 'Created By %1$s'), $this->created_username);
! $article_tags['UPDATED_TEXT'] = sprintf(dgettext('article', 'Last updated by %1$s'), $this->updated_username);
$article_tags['TITLE_LINK'] = $this->get_title_link();
!
! if($this->wordcount>0) {
! $article_tags['READMORE'] = '[' . PHPWS_Text::rewriteLink(dgettext('article', 'Read More'), 'article', $vars). ']';
! $article_tags['MOREWORDS'] = $this->wordcount." ".dgettext('article', 'more words');
! $article_tags['MOREPAGES'] = $this->pagecount . ' ' . (($this->pagecount==1) ?dgettext('article', 'page') :dgettext('article', 'pages'));
! }
!
! if (@$_REQUEST['module']=='article' && !$printAll) {
! $s = dgettext('article', 'Printable Version');
! $article_tags['PRINT_ICON'] = '<a href="./index.php?module=article&op=print&id='.$this->id
! .'" target="_blank" style="text-decoration:none" title="'. $s . '" rel="nofollow"><img src="' . PHPWS_Core::getHomeHttp()
! . 'images/mod/article/print.gif" border="0" width="22" height="20" alt="'.$s.'" />'.dgettext('article', 'Print').'</a>';
! $s = dgettext('article', 'E-mail this Article to a Friend');
! $article_tags['EMAIL'] = '<a href="./index.php?module=article&op=email&id='.$this->id
! .'" style="text-decoration:none" title="'.$s.'" rel="nofollow"><img src="'. PHPWS_Core::getHomeHttp()
! . 'images/mod/article/mailto.png" border="0" width="19" height="12" alt="'.$s.'" />'.dgettext('article', 'eMail').'</a>';
! }
!
! /* if user can edit articles or can edit this article... */
! if ($this->can_edit()) {
! /* If someone else is editing this article... */
! if ($this->isLocked($this->editlock, $this->edituser))
! $article_tags['EDIT'] = '['. dgettext('article', 'Locked') . ']';
! else
! $article_tags['EDIT'] = '[<a href="./index.php?module=article&op=edit&page='.$page_wanted.'&id='.$this->id
! .'">' . dgettext('article', 'Edit').'</a>]';
! }
!
! /* if user can delete articles or can delete this article... */
! if (Current_User::allow('article', 'delete_articles', $this->id))
! $article_tags['DELETE'] = '[<a href="./index.php?module=article&op=delete&id=' . $this->id.'">'.dgettext('article', 'Delete').' </a>]';
!
! /* Show Category links & icons */
! /* If Category info is cached, use it */
! $cat_link = $cat_icon = array();
! if (isset($GLOBALS['AMcategoryIdx'][$this->key_id])) {
! $cat_link = $GLOBALS['AMcategoryIdx'][$this->key_id]['cat_link'];
! $cat_icon = $GLOBALS['AMcategoryIdx'][$this->key_id]['cat_icon'];
! }
! else {
! $db = new PHPWS_DB('categories');
! $db->addWhere('category_items.key_id', $this->key_id);
! $db->addWhere('id', 'category_items.cat_id');
! $categories = $db->getObjects('Category');
! if (count($categories)) {
! foreach ($categories AS $category) {
! if (!is_object($category))
! break;
! $cat_link[] = $category->getViewLink('article');
! if ($category->icon)
! $cat_icon[] = $category->getViewLink('article', $category->getIcon());
! }
! }
! }
! if (!empty($cat_link))
! $article_tags['CATEGORY_LINKS'] = implode(', ', $cat_link);
! if (!empty($cat_icon))
! $article_tags['CATEGORY_ICONS'] = implode(' ', $cat_icon);
!
! /* Display available translation links */
! /* if ($_SESSION['translate']->langActive) {
! $arr = array();
! foreach ($this->_translations_available AS $key=>$value) {
! if ($this->language != $key)
! $arr[] = '['.PHPWS_Text::moduleLink($value, 'article', array('view'=>$this->id.' ', 'language'=>$key)).']';
! else
! $arr[] = '['.$value.']';
! }
! $article_tags['AVAILABLE_TRANSLATIONS'] = implode(' ', $arr);
! }
! */
/* Develop article content */
***************
*** 359,365 ****
$navbar[] = '['.$pagenum.']';
/* otherwise, create a article link */
! } else {
! $vars['page'] = $pagenum;
! $navlist[] = PHPWS_Text::rewriteLink($page_title, 'article', $vars);
$navbar[] = PHPWS_Text::rewriteLink($pagenum, 'article', $vars);
}
--- 359,365 ----
$navbar[] = '['.$pagenum.']';
/* otherwise, create a article link */
! } else {
! $vars['page'] = $pagenum;
! $navlist[] = PHPWS_Text::rewriteLink($page_title, 'article', $vars);
$navbar[] = PHPWS_Text::rewriteLink($pagenum, 'article', $vars);
}
***************
*** 384,388 ****
$article_tags['PREV'] = $article_tags['NEXT'] = ' ';
if ($page_wanted > 1) {
! $vars['page'] = $page_wanted-1;
$article_tags['PREV'] = PHPWS_Text::rewriteLink(dgettext('article', 'Previous Page'), 'article', $vars);
}
--- 384,388 ----
$article_tags['PREV'] = $article_tags['NEXT'] = ' ';
if ($page_wanted > 1) {
! $vars['page'] = $page_wanted-1;
$article_tags['PREV'] = PHPWS_Text::rewriteLink(dgettext('article', 'Previous Page'), 'article', $vars);
}
***************
*** 391,410 ****
$vars['page'] = $page_wanted+1;
$article_tags['NEXT'] = PHPWS_Text::rewriteLink(dgettext('article', 'Next Page'), 'article', $vars);
! }
unset($vars['page']);
}
!
! /* If the Comments module is available, get comments information */
! if($this->id != 0 && PHPWS_Settings::get('article', 'use_comments') && $this->allow_comments
! && PHPWS_Core::initModClass('comments', 'Comments.php')
! && $article_tags['thread'] = Comments::getThread($this->key_id))
! {
! $s = $article_tags['thread']->countComments(true);
! $link = PHPWS_Text::quickLink($s, 'article', $vars);
! $link->rewrite = true;
! $link->setAnchor('comments');
! $article_tags['NUM_COMMENTS'] = $link->get();
! }
!
unset($vars);
return $article_tags;
--- 391,411 ----
$vars['page'] = $page_wanted+1;
$article_tags['NEXT'] = PHPWS_Text::rewriteLink(dgettext('article', 'Next Page'), 'article', $vars);
! }
unset($vars['page']);
}
!
! /* If the Comments module is available, get comments information */
! if($this->id != 0 && PHPWS_Settings::get('article', 'use_comments') && $this->allow_comments
! && PHPWS_Core::initModClass('comments', 'Comments.php')
! && $article_tags['thread'] = Comments::getThread($this->key_id))
! {
! $s = $article_tags['thread']->countComments(true);
! $link = PHPWS_Text::quickLink($s, 'article', $vars);
! $link->rewrite = true;
! $link->setAnchor('comments');
! $article_tags['NUM_COMMENTS'] = $link->get();
! $article_tags['COMMENTS_TITLE'] = dgettext('article', 'Discuss');
! }
!
unset($vars);
return $article_tags;
***************
*** 452,458 ****
$content = PHPWS_Template::processTemplate($article_tags, 'article', 'article/'.$this->template);
/* My copyright statement. Do not disable or remove. See /docs/LICENSE.txt for an explanation. */
! $rights = array( 'http://www.vibride.com','http://www.realvidreams.com','http://www.bygeorgeware.com','http://www.bygeorgeadvertising.com');
! $copyright = '<a href="'.$rights[rand(0,2)].'" title="Article Manager module by by George! Software."><img src="'.PHPWS_Core::getHomeHttp()
! . 'images/mod/article/mark.gif" border="0" alt="Article Manager module by by George! Software." /></a>';
if (@$GLOBALS['module'] != 'home')
$content .= $copyright;
--- 453,458 ----
$content = PHPWS_Template::processTemplate($article_tags, 'article', 'article/'.$this->template);
/* My copyright statement. Do not disable or remove. See /docs/LICENSE.txt for an explanation. */
! $copyright = '<a href="http://www.bygeorgetech.com" title="Article Manager module by by George! Technologies."><img src="'.PHPWS_Core::getHomeHttp()
! . 'images/mod/article/mark.gif" border="0" alt="Article Manager module by by George! Technologies." /></a>';
if (@$GLOBALS['module'] != 'home')
$content .= $copyright;
***************
*** 622,648 ****
return $id;
}
!
! /**
! * Generates a title link.
! *
! * If no parameters are given, then the method assumes that it was called from inside an active object
! *
! * @author Eloi George <el...@NO...>
! * @param int $id : (optional) article id
! * @param string $title : (optional) article title
! * @return HTML
! */
! function get_title_link ($id = null, $title = null, $summary = null)
! {
! $vars['id'] = ($id)? $id : $this->id;
! if (empty($title)) {
! $title = $this->title;
! if (empty($summary)) {
! $summary = PHPWS_Text::parseOutput($this->summary);
! }
! }
! return PHPWS_Text::rewriteLink($title, 'article', $vars, null, $summary);
}
!
/**
* Finds a section by id.
--- 622,648 ----
return $id;
}
!
! /**
! * Generates a title link.
! *
! * If no parameters are given, then the method assumes that it was called from inside an active object
! *
! * @author Eloi George <el...@NO...>
! * @param int $id : (optional) article id
! * @param string $title : (optional) article title
! * @return HTML
! */
! function get_title_link ($id = null, $title = null, $summary = null)
! {
! $vars['id'] = ($id)? $id : $this->id;
! if (empty($title)) {
! $title = $this->title;
! if (empty($summary)) {
! $summary = PHPWS_Text::parseOutput($this->summary);
! }
! }
! return PHPWS_Text::rewriteLink($title, 'article', $vars, null, $summary);
}
!
/**
* Finds a section by id.
***************
*** 1032,1059 ****
, 'msg' => @$version->source_data['vr_reviewer_note']);
}
!
! /**
! * Determines if an article can be edited by the user.
! *
! * If an id was not given, the method will assume that we're checking the
! * current object's permissions
! *
! * @author Eloi George <el...@NO...>
! * @module Article Manager
! * @param int $id : Article id to check, if known.
! * @param int $creator_id : Article Author id to check, if known.
! * @return bool : true or false.
! * @access public
! */
! function can_edit ($id = null, $creator_id = null) {
! /* If an id was not given, check general editing pro */
! if (empty($id)) {
! $id = $this->id;
! $creator_id = $this->created_id;
! }
! return Current_User::allow('article', 'edit_articles', $id)
! || (Current_User::getId() && $creator_id == Current_User::getId());
! }
}
! ?>
\ No newline at end of file
--- 1032,1059 ----
, 'msg' => @$version->source_data['vr_reviewer_note']);
}
!
! /**
! * Determines if an article can be edited by the user.
! *
! * If an id was not given, the method will assume that we're checking the
! * current object's permissions
! *
! * @author Eloi George <el...@NO...>
! * @module Article Manager
! * @param int $id : Article id to check, if known.
! * @param int $creator_id : Article Author id to check, if known.
! * @return bool : true or false.
! * @access public
! */
! function can_edit ($id = null, $creator_id = null) {
! /* If an id was not given, check general editing pro */
! if (empty($id)) {
! $id = $this->id;
! $creator_id = $this->created_id;
! }
! return Current_User::allow('article', 'edit_articles', $id)
! || (Current_User::getId() && $creator_id == Current_User::getId());
! }
}
! ?>
|