|
From: Verdon V. <ve...@us...> - 2008-02-09 19:01:37
|
Update of /cvsroot/phpwebsite-comm/modules/podcaster/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1055/class Modified Files: PCR_Channel.php PCR_Episode.php PCR_Forms.php Podcaster.php Log Message: near ready for 1.1.0 release Index: PCR_Episode.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/podcaster/class/PCR_Episode.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PCR_Episode.php 6 Jan 2008 00:34:43 -0000 1.2 --- PCR_Episode.php 9 Feb 2008 19:01:10 -0000 1.3 *************** *** 149,172 **** } ! PHPWS_Core::initModClass('filecabinet', 'Multimedia.php'); ! $media = new PHPWS_Multimedia($this->media_id); ! if (!$media->id) { ! $media->logErrors(); return null; } ! if ($print) { ! // return $media->getTag(); ! // return $media->getThumbnail(); ! if ($icon) { ! return $media->getJSView(true); ! } elseif ($text) { ! return $media->getJSView(false,$text); } else { ! return $media->getJSView(); } - } else { - return $media; } } --- 149,197 ---- } ! PHPWS_Core::initModClass('filecabinet', 'File_Assoc.php'); ! $file = new FC_File_Assoc($this->media_id); ! if (!$file->id) { ! $file->logErrors(); return null; } ! if ($file->file_type == 3) { ! PHPWS_Core::initModClass('filecabinet', 'Multimedia.php'); ! $media = new PHPWS_Multimedia($file->file_id); ! if (!$media->id) { ! $media->logErrors(); ! return null; ! } ! if ($print) { ! if ($icon) { ! return $media->getJSView(true); ! } elseif ($text) { ! return $media->getJSView(false,$text); ! } else { ! return $media->getJSView(); ! } } else { ! return $media; ! } ! } elseif ($file->file_type == 2) { ! PHPWS_Core::initModClass('filecabinet', 'Document.php'); ! $media = new PHPWS_Document($file->file_id); ! if (!$media->id) { ! $media->logErrors(); ! return null; ! } ! if ($print) { ! if ($icon) { ! return $media->getViewLink(true, 'icon'); ! } elseif ($text) { ! return $media->getViewLink(true, 'title'); ! } else { ! return $media->getTag(); ! } ! } else { ! return $media; } } + } *************** *** 414,418 **** } - /* not sure if I need the key stuff */ $key = new Key($this->key_id); --- 439,442 ---- *************** *** 440,443 **** --- 464,469 ---- $template['EPISODE_LINKS'] = $this->episodeLinks(); + $key->flag(); + return PHPWS_Template::process($template, 'podcaster', 'view_episode.tpl'); Index: Podcaster.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/podcaster/class/Podcaster.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Podcaster.php 9 Jan 2008 21:41:12 -0000 1.4 --- Podcaster.php 9 Feb 2008 19:01:10 -0000 1.5 *************** *** 130,135 **** PHPWS_Core::reroute('index.php?module=podcaster&uop=view_channel&id=' . $this->channel->id); } - // vv huh? javascript('close_refresh'); - // vv huh? Layout::nakedDisplay(); } else { $this->loadForm('edit_episode'); --- 130,133 ---- *************** *** 401,405 **** 'link'=>$link); } ! if (Current_User::allow('podcaster', 'edit_channel') || Current_User::allow('podcaster', 'edit_episode')){ $tags['info'] = array('title'=>dgettext('podcaster', 'Read me'), 'link'=>$link); --- 399,403 ---- 'link'=>$link); } ! if (Current_User::isUnrestricted('podcaster')) { $tags['info'] = array('title'=>dgettext('podcaster', 'Read me'), 'link'=>$link); *************** *** 479,482 **** --- 477,484 ---- } + if (isset($_POST['media_type'])) { + $this->channel->setMedia_type((int)$_POST['media_type']); + } + if (isset($_POST['itunes_explicit'])) { $this->channel->setItunes_explicit((int)$_POST['itunes_explicit']); Index: PCR_Forms.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/podcaster/class/PCR_Forms.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PCR_Forms.php 9 Jan 2008 21:41:12 -0000 1.5 --- PCR_Forms.php 9 Feb 2008 19:01:10 -0000 1.6 *************** *** 98,108 **** PHPWS_Core::initModClass('filecabinet', 'Cabinet.php'); ! $manager = Cabinet::imageManager($channel->image_id, 'image_id', ! PHPWS_Settings::get('podcaster', 'max_width'), ! PHPWS_Settings::get('podcaster', 'max_height'), ! PHPWS_Settings::get('podcaster', 'mod_folders_only')); if ($manager) { ! $form->addTplTag('IMAGE_MANAGER', $manager->get()); ! $form->addTplTag('IMAGE_LABEL', dgettext('podcaster', 'Image')); } --- 98,108 ---- PHPWS_Core::initModClass('filecabinet', 'Cabinet.php'); ! $manager = Cabinet::fileManager('image_id', $channel->image_id); ! $manager->imageOnly(); ! $manager->maxImageWidth(PHPWS_Settings::get('podcaster', 'max_width')); ! $manager->maxImageHeight(PHPWS_Settings::get('podcaster', 'max_height')); ! if ($manager) { ! $form->addTplTag('FILE_MANAGER', $manager->get()); } *************** *** 113,116 **** --- 113,121 ---- } + $choices = array ('0' => dgettext('podcaster', 'Audio/Video'), '1' => dgettext('podcaster', 'Document')); + $form->addSelect('media_type', $choices); + $form->setLabel('media_type', dgettext('podcaster', 'Media type for this channel')); + $form->setMatch('media_type', $channel->getMedia_type()); + $choices = array ('0' => dgettext('podcaster', 'No'), '1' => dgettext('podcaster', 'Yes'), '2' => dgettext('podcaster', 'Clean')); $form->addSelect('itunes_explicit', $choices); *************** *** 169,175 **** $form->setLabel('description', dgettext('podcaster', 'Description')); ! $form->addText('media_id', $this->podcaster->episode->media_id); ! $form->setSize('media_id', 5); ! $form->setLabel('media_id', dgettext('podcaster', 'Media_id')); if (Current_User::isUnrestricted('podcaster')) { --- 174,188 ---- $form->setLabel('description', dgettext('podcaster', 'Description')); ! PHPWS_Core::initModClass('filecabinet', 'Cabinet.php'); ! $manager = Cabinet::fileManager('media_id', $this->podcaster->episode->media_id); ! if ($this->podcaster->channel->media_type == 0) { ! $manager->mediaOnly(); ! } elseif ($this->podcaster->channel->media_type == 1) { ! $manager->documentOnly(); ! } ! ! if ($manager) { ! $form->addTplTag('FILE_MANAGER', $manager->get()); ! } if (Current_User::isUnrestricted('podcaster')) { *************** *** 186,191 **** $tpl['INFO_LABEL'] = dgettext('podcaster', 'Information'); $tpl['MEDIA_LABEL'] = dgettext('podcaster', 'Media'); - $tpl['MEDIA_NOTE_LABEL'] = dgettext('podcaster', 'Special Note:'); - $tpl['MEDIA_NOTE'] = dgettext('podcaster', 'In a future version of podcaster, there will be a media "mini-app" embedded in add/edit episode forms, like the image mini-app in the add/edit channel forms. This is dependant on changes coming to filecabinet. Until then, use filecabinet directly to upload your media file into a Multimedia folder, make note of the multimedia_id value there, and then return and enter it here in the episode\'s Media_id field. One way you can find the multimedia_id is to mouse over the "Clip" link for your multimedia file and look in your browser\'s status bar.'); if (Current_User::isUnrestricted('podcaster')) { $tpl['SETTINGS_LABEL'] = dgettext('podcaster', 'Settings'); --- 199,202 ---- *************** *** 223,226 **** --- 234,238 ---- $pager->addPageTags($ptags); $pager->addToggle('class="toggle1"'); + $pager->setSearch('title', 'description'); $this->podcaster->content = $pager->get(); *************** *** 256,259 **** --- 268,272 ---- $pager->addPageTags($ptags); $pager->addToggle('class="toggle1"'); + $pager->setSearch('title', 'description'); if (isset($channel_id)) { *************** *** 316,320 **** $form->setLabel('rm_media', dgettext('podcaster', 'Delete media from filecabinet when deleting episode')); - $form->addTextField('max_width', PHPWS_Settings::get('podcaster', 'max_width')); $form->setLabel('max_width', dgettext('podcaster', 'Maximum image width (50-600)')); --- 329,332 ---- *************** *** 345,353 **** $tpl['TITLE'] = dgettext('podcaster', 'Important Information'); $tpl['INFO_1_LABEL'] = dgettext('podcaster', 'A note on this module:'); ! $tpl['INFO_1'] = dgettext('podcaster', 'This is the first rewriting of podcaster for the new 1.x series phpwebsite. Although I believe it to be pretty stable, there are still a few things that should be pointed out. There are a couple rough edges and a feature that is waiting for planned core filecabinet updates. I will release updated podcaster versions as they are available. Updating will be easy for the end user.'); ! $tpl['INFO_2_LABEL'] = dgettext('podcaster', 'A note on media files:'); ! $tpl['INFO_2'] = dgettext('podcaster', 'In a future version of podcaster, there will be a media "mini-app" embedded in add/edit episode forms, like the image mini-app in the add/edit channel forms. This is dependant on changes coming to filecabinet. Until then, use filecabinet directly to upload your media file into a Multimedia folder, make note of the multimedia_id value there, and then return and enter it here in the episode\'s Media_id field. One way you can find the multimedia_id is to mouse over the "Clip" link for your multimedia file and look in your browser\'s status bar.'); ! // $tpl['INFO_3_LABEL'] = dgettext('podcaster', 'A note on iTunes categories:'); ! // $tpl['INFO_3'] = dgettext('podcaster', 'iTunes categories are used to classify your podcasts in the iTunes podcast directory. They are limited and specific. Although it is OK to leave this field empty, choosing the correct categories is good for your feed and may be used by other podcast directories and readers too. I have not polished the interface for choosing iTunes categories yet. It will come in the next version of podcaster. For now, you must carefully enter these yourself when creating a channel. I have provided a few examples in the categories field, and you can click on the link in the channel settings area of an add/edit channel form, to see a complete official list that you can copy and paste from.'); $tpl['INFO_3_LABEL'] = null; $tpl['INFO_3'] = null; --- 357,363 ---- $tpl['TITLE'] = dgettext('podcaster', 'Important Information'); $tpl['INFO_1_LABEL'] = dgettext('podcaster', 'A note on this module:'); ! $tpl['INFO_1'] = dgettext('podcaster', 'This is the second release of podcaster for the new 1.x series phpwebsite. This release takes advantage of the new File Cabinet 2.0 features, and media upload/embed tools are now built right in. Support for PDF and other documents types has also been added.'); ! $tpl['INFO_2_LABEL'] = dgettext('podcaster', 'A note on media types:'); ! $tpl['INFO_2'] = dgettext('podcaster', 'You may specify at a channel level what media type you will allow for all episodes in that channel. Ideally, you should determine this before adding episodes to a channel, though it can be changed at any time.'); $tpl['INFO_3_LABEL'] = null; $tpl['INFO_3'] = null; *************** *** 356,359 **** --- 366,370 ---- $tpl['INFO_5_LABEL'] = dgettext('podcaster', 'A note on caching:'); $tpl['INFO_5'] = dgettext('podcaster', 'There is a typo in the core class Cache.php that although fixed in svn, the fix hasn\'t been released as of Jan 6 2008. If your channel RSS feeds don\'t seem to refresh after the cache duration, try disabling the cache in the Settings tab.'); + $tpl['DONATE'] = sprintf(dgettext('podcaster', 'If you would like to help out with the ongoing development of Podcaster, %s click here to donate %s.'), '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donations%40verdon%2eca&item_name=Podcaster%20Module%20Development&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=CA&bn=PP%2dDonationsBF&charset=UTF%2d8" target="new">', '</a>'); $this->podcaster->title = dgettext('podcaster', 'Read me'); Index: PCR_Channel.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/podcaster/class/PCR_Channel.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PCR_Channel.php 9 Jan 2008 21:41:12 -0000 1.3 --- PCR_Channel.php 9 Feb 2008 19:01:10 -0000 1.4 *************** *** 30,33 **** --- 30,34 ---- var $description = null; var $image_id = 0; + var $media_type = 0; var $date_created = 0; var $date_updated = 0; *************** *** 91,94 **** --- 92,101 ---- + function setMedia_type($media_type) + { + $this->media_type = $media_type; + } + + function setItunes_explicit($itunes_explicit) { *************** *** 158,161 **** --- 165,176 ---- + function getFile() + { + if (!$this->image_id) { + return null; + } + return Cabinet::getTag($this->image_id); + } + function getImage($print=false) { *************** *** 189,199 **** ! function getItunes_explicit($print=false) { ! if (empty($this->itunes_explicit)) { return null; } if ($print) { if ($this->itunes_explicit == '0') return dgettext('podcaster', 'No'); --- 204,227 ---- ! function getMedia_type($print=false) { ! if (empty($this->media_type)) { return null; } if ($print) { + if ($this->media_type == '0') + return dgettext('podcaster', 'Audio/Video'); + if ($this->media_type == '1') + return dgettext('podcaster', 'Document'); + } else { + return $this->media_type; + } + } + + + function getItunes_explicit($print=false) + { + if ($print) { if ($this->itunes_explicit == '0') return dgettext('podcaster', 'No'); *************** *** 203,206 **** --- 231,237 ---- return dgettext('podcaster', 'Clean'); } else { + if (empty($this->itunes_explicit)) { + return null; + } return $this->itunes_explicit; } *************** *** 241,245 **** } - /* not sure if I need the key stuff */ $key = new Key($this->key_id); --- 272,275 ---- *************** *** 251,255 **** $template['TITLE'] = $this->getTitle(true); $template['DESCRIPTION'] = PHPWS_Text::parseTag($this->getDescription(true)); ! $template['IMAGE'] = $this->getImage(true); if (Current_User::allow('podcaster', 'edit_episode')) { --- 281,286 ---- $template['TITLE'] = $this->getTitle(true); $template['DESCRIPTION'] = PHPWS_Text::parseTag($this->getDescription(true)); ! // $template['IMAGE'] = $this->getImage(true); ! $template['IMAGE'] = $this->getFile(); if (Current_User::allow('podcaster', 'edit_episode')) { *************** *** 289,292 **** --- 320,324 ---- } + $key->flag(); return PHPWS_Template::process($template, 'podcaster', 'view_channel.tpl'); *************** *** 506,516 **** - function flag() - { - $key = new Key($this->key_id); - $key->flag(); - } - - function loadFeeds() { --- 538,541 ---- *************** *** 563,567 **** $template['CHANNEL_DESCRIPTION'] = strip_tags($this->description); $template['CHANNEL_DESCRIPTION_PREAMBLE'] = substr(ltrim(strip_tags(str_replace('<br />', ' ', $this->description))), 0, 60); ! $template['LANGUAGE'] = CURRENT_LANGUAGE; // change later $template['SEARCH_LINK'] = sprintf('%sindex.php?module=search&mod_title=podcaster&user=search', $home_http); $template['SEARCH_DESCRIPTION'] = sprintf('Search in %s', $this->title); --- 588,592 ---- $template['CHANNEL_DESCRIPTION'] = strip_tags($this->description); $template['CHANNEL_DESCRIPTION_PREAMBLE'] = substr(ltrim(strip_tags(str_replace('<br />', ' ', $this->description))), 0, 60); ! $template['LANGUAGE'] = substr(ltrim(CURRENT_LANGUAGE), 0, 2); // change later $template['SEARCH_LINK'] = sprintf('%sindex.php?module=search&mod_title=podcaster&user=search', $home_http); $template['SEARCH_DESCRIPTION'] = sprintf('Search in %s', $this->title); *************** *** 569,574 **** $template['THUMB_URL'] = $home_http . $image->file_directory . $image->file_name; $template['COPYRIGHT'] = PHPWS_Settings::get('podcaster', 'copyright'); ! $template['WEBMASTER'] = PHPWS_Settings::get('podcaster', 'webmaster'); ! $template['MANAGING_EDITOR'] = PHPWS_Settings::get('podcaster', 'editor'); $template['LAST_BUILD_DATE'] = gmstrftime('%a, %d %b %Y %R GMT', mktime()); $template['ITUNES_EXPLICIT'] = $this->getItunes_explicit(true); --- 594,599 ---- $template['THUMB_URL'] = $home_http . $image->file_directory . $image->file_name; $template['COPYRIGHT'] = PHPWS_Settings::get('podcaster', 'copyright'); ! $template['WEBMASTER'] = PHPWS_Settings::get('podcaster', 'webmaster') . '(' . dgettext('podcaster', 'Webmaster') . ')'; ! $template['MANAGING_EDITOR'] = PHPWS_Settings::get('podcaster', 'editor') . '(' . dgettext('podcaster', 'Managing Editor') . ')'; $template['LAST_BUILD_DATE'] = gmstrftime('%a, %d %b %Y %R GMT', mktime()); $template['ITUNES_EXPLICIT'] = $this->getItunes_explicit(true); |