Update of /cvsroot/phpwebsite-comm/modules/podcaster/class
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18478/class
Modified Files:
PCR_Channel.php PCR_Episode.php
Log Message:
tweaks getting ready for new tag and release
Index: PCR_Episode.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/podcaster/class/PCR_Episode.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PCR_Episode.php 9 Feb 2008 19:01:10 -0000 1.3
--- PCR_Episode.php 17 Mar 2008 15:53:53 -0000 1.4
***************
*** 302,305 ****
--- 302,317 ----
$this->saveKey();
+
+ if ($this->active && $this->approved) {
+ $search = new Search($this->key_id);
+ $search->resetKeywords();
+ $search->addKeywords($this->title);
+ $search->addKeywords($this->description);
+ $result = $search->save();
+ if (PEAR::isError($result)) {
+ return $result;
+ }
+ }
+
}
***************
*** 321,330 ****
$key->setEditPermission('edit_episode');
! /* need to look at pagemaster mechanism if I'll use this */
! // if (MOD_REWRITE_ENABLED) {
! // $key->setUrl('podcaster/episodes/' . $this->id);
! // } else {
! $key->setUrl('index.php?module=podcaster&uop=view_episode&id=' . $this->id);
! // }
if ($this->approved) {
--- 333,341 ----
$key->setEditPermission('edit_episode');
! if (MOD_REWRITE_ENABLED) {
! $key->setUrl('podcaster/' . $this->channel_id . '/' . $this->id);
! } else {
! $key->setUrl('index.php?module=podcaster&uop=view_episode&episode_id=' . $this->id);
! }
if ($this->approved) {
***************
*** 427,433 ****
function viewLink()
{
! $vars['uop'] = 'view_episode';
! $vars['episode_id'] = $this->id;
! return PHPWS_Text::moduleLink($this->title, 'podcaster', $vars);
}
--- 438,445 ----
function viewLink()
{
! // $vars['uop'] = 'view_episode';
! // $vars['episode_id'] = $this->id;
! // return PHPWS_Text::moduleLink($this->title, 'podcaster', $vars);
! return PHPWS_Text::rewriteLink($this->title, 'podcaster', $this->channel_id, $this->id);
}
***************
*** 473,476 ****
--- 485,489 ----
function delete()
{
+ Key::drop($this->key_id);
$db = new PHPWS_DB('podcaster_episode');
$db->addWhere('id', $this->id);
Index: PCR_Channel.php
===================================================================
RCS file: /cvsroot/phpwebsite-comm/modules/podcaster/class/PCR_Channel.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PCR_Channel.php 9 Feb 2008 19:01:10 -0000 1.4
--- PCR_Channel.php 17 Mar 2008 15:53:53 -0000 1.5
***************
*** 341,360 ****
$db = new PHPWS_DB('podcaster_episode');
$db->addWhere('channel_id', $this->id);
!
! if (PHPWS_Settings::get('podcaster', 'rm_media')) {
! PHPWS_Core::initModClass('podcaster', 'PCR_Episode.php');
! $result = $db->getObjects('Podcaster_Episode');
! if ($result) {
! foreach ($result as $episode) {
! $media = $episode->getMedia();
! if ($media) {
! $media->delete();
! }
! }
}
}
- PHPWS_Error::logIfError($db->delete());
-
}
--- 341,352 ----
$db = new PHPWS_DB('podcaster_episode');
$db->addWhere('channel_id', $this->id);
! PHPWS_Core::initModClass('podcaster', 'PCR_Episode.php');
! $result = $db->getObjects('Podcaster_Episode');
! if ($result) {
! foreach ($result as $episode) {
! $episode->delete();
}
}
}
***************
*** 488,491 ****
--- 480,495 ----
$this->saveKey();
+
+ if ($this->active) {
+ $search = new Search($this->key_id);
+ $search->resetKeywords();
+ $search->addKeywords($this->title);
+ $search->addKeywords($this->description);
+ $result = $search->save();
+ if (PEAR::isError($result)) {
+ return $result;
+ }
+ }
+
}
|