From f2b2e8670acc7db5aacc8730cf721a803e5828f2 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Sun, 13 Jun 2010 23:24:46 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=B0=20trunk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +YUCHENG HU+ git-svn-id: https://svn.code.sf.net/p/hawebs/svn@329 a2543c7e-f6e9-4f8a-8bff-1ffc34733512 --- .../components/com_admin/admin.admin.html.php | 335 ++++++++++++ .../components/com_admin/admin.admin.php | 48 ++ .../components/com_admin/index.html | 1 + .../components/com_admin/tmpl/index.html | 1 + .../components/com_admin/tmpl/navigation.php | 36 ++ .../com_admin/tmpl/sysinfo_config.php | 73 +++ .../com_admin/tmpl/sysinfo_directory.php | 80 +++ .../com_admin/tmpl/sysinfo_phpinfo.php | 49 ++ .../com_admin/tmpl/sysinfo_phpsettings.php | 165 ++++++ .../com_admin/tmpl/sysinfo_system.php | 98 ++++ .../com_admin/toolbar.admin.html.php | 48 ++ .../components/com_admin/toolbar.admin.php | 42 ++ .../admin.attachments.html.php | 388 +++++++++++++ .../com_attachments/admin.attachments.php | 46 ++ .../com_attachments/attachments.css | 164 ++++++ .../com_attachments/attachments.png | Bin 0 -> 1124 bytes .../com_attachments/attachments.xml | 124 +++++ .../com_attachments/attachments_admin32.png | Bin 0 -> 2859 bytes .../com_attachments/attachments_logo48.png | Bin 0 -> 5209 bytes .../components/com_attachments/config.xml | 141 +++++ .../components/com_attachments/controller.php | 441 +++++++++++++++ .../com_attachments/controllers/index.html | 1 + .../com_attachments/controllers/special.php | 180 +++++++ .../com_attachments/help/en-GB/help.css | 54 ++ .../com_attachments/help/en-GB/help.html | 509 ++++++++++++++++++ .../com_attachments/help/en-GB/index.html | 1 + .../com_attachments/help/index.html | 1 + .../components/com_attachments/index.html | 1 + .../com_attachments/install.attachments.php | 92 ++++ .../com_attachments/install.mysql.sql | 22 + .../com_attachments/install.noutf8.sql | 23 + .../com_attachments/models/index.html | 1 + .../com_attachments/models/special.php | 53 ++ .../com_attachments/tables/attachments.php | 38 ++ .../com_attachments/tables/index.html | 1 + .../toolbar.attachments.html.php | 52 ++ .../com_attachments/toolbar.attachments.php | 29 + .../com_attachments/uninstall.attachments.php | 35 ++ .../com_attachments/uninstall.mysql.sql | 1 + .../components/com_attachments/update.php | 305 +++++++++++ .../com_attachments/views/index.html | 1 + .../com_attachments/views/special/index.html | 1 + .../com_attachments/views/special/view.php | 64 +++ .../components/com_banners/admin.banners.php | 65 +++ .../components/com_banners/banners.xml | 12 + .../components/com_banners/config.xml | 14 + .../com_banners/controllers/banner.php | 447 +++++++++++++++ .../com_banners/controllers/client.php | 213 ++++++++ .../com_banners/controllers/index.html | 1 + .../com_banners/elements/bannerclient.php | 49 ++ .../com_banners/elements/index.html | 1 + .../components/com_banners/helpers/banner.php | 81 +++ .../components/com_banners/helpers/index.html | 1 + .../components/com_banners/index.html | 1 + .../components/com_banners/tables/banner.php | 131 +++++ .../com_banners/tables/bannerclient.php | 68 +++ .../components/com_banners/tables/index.html | 1 + .../components/com_banners/views/banner.php | 473 ++++++++++++++++ .../components/com_banners/views/client.php | 258 +++++++++ .../components/com_banners/views/index.html | 1 + 60 files changed, 5562 insertions(+) create mode 100644 oss/joomla/trunk/administrator/components/com_admin/admin.admin.html.php create mode 100644 oss/joomla/trunk/administrator/components/com_admin/admin.admin.php create mode 100644 oss/joomla/trunk/administrator/components/com_admin/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_admin/tmpl/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_admin/tmpl/navigation.php create mode 100644 oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_config.php create mode 100644 oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_directory.php create mode 100644 oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_phpinfo.php create mode 100644 oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_phpsettings.php create mode 100644 oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_system.php create mode 100644 oss/joomla/trunk/administrator/components/com_admin/toolbar.admin.html.php create mode 100644 oss/joomla/trunk/administrator/components/com_admin/toolbar.admin.php create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/admin.attachments.html.php create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/admin.attachments.php create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/attachments.css create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/attachments.png create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/attachments.xml create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/attachments_admin32.png create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/attachments_logo48.png create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/config.xml create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/controller.php create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/controllers/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/controllers/special.php create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/help/en-GB/help.css create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/help/en-GB/help.html create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/help/en-GB/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/help/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/install.attachments.php create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/install.mysql.sql create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/install.noutf8.sql create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/models/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/models/special.php create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/tables/attachments.php create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/tables/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/toolbar.attachments.html.php create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/toolbar.attachments.php create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/uninstall.attachments.php create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/uninstall.mysql.sql create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/update.php create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/views/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/views/special/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_attachments/views/special/view.php create mode 100644 oss/joomla/trunk/administrator/components/com_banners/admin.banners.php create mode 100644 oss/joomla/trunk/administrator/components/com_banners/banners.xml create mode 100644 oss/joomla/trunk/administrator/components/com_banners/config.xml create mode 100644 oss/joomla/trunk/administrator/components/com_banners/controllers/banner.php create mode 100644 oss/joomla/trunk/administrator/components/com_banners/controllers/client.php create mode 100644 oss/joomla/trunk/administrator/components/com_banners/controllers/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_banners/elements/bannerclient.php create mode 100644 oss/joomla/trunk/administrator/components/com_banners/elements/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_banners/helpers/banner.php create mode 100644 oss/joomla/trunk/administrator/components/com_banners/helpers/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_banners/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_banners/tables/banner.php create mode 100644 oss/joomla/trunk/administrator/components/com_banners/tables/bannerclient.php create mode 100644 oss/joomla/trunk/administrator/components/com_banners/tables/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_banners/views/banner.php create mode 100644 oss/joomla/trunk/administrator/components/com_banners/views/client.php create mode 100644 oss/joomla/trunk/administrator/components/com_banners/views/index.html diff --git a/oss/joomla/trunk/administrator/components/com_admin/admin.admin.html.php b/oss/joomla/trunk/administrator/components/com_admin/admin.admin.html.php new file mode 100644 index 00000000..336ac332 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_admin/admin.admin.html.php @@ -0,0 +1,335 @@ +setBuffer($contents, 'modules', 'submenu'); + ?> +
+ +
+
+ + + + +
+ +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+ +
+
+ +
+ + + + +
+ +
+
+
+ +
+ + * In case of the remote server it is assumed that this server provide one specific + * help set of files in one particular language. + */ + function help() + { + global $mainframe; + jimport( 'joomla.filesystem.folder' ); + jimport( 'joomla.language.help' ); + + // Get Help URL - an empty helpurl is interpreted as local help files! + $helpurl = $mainframe->getCfg('helpurl'); + if ( $helpurl == 'http://help.mamboserver.com' ) { + $helpurl = 'http://help.joomla.org'; + } + $fullhelpurl = $helpurl . '/index2.php?option=com_content&task=findkey&pop=1&keyref='; + + $helpsearch = JRequest::getString('helpsearch'); + $page = JRequest::getCmd('page', 'joomla.whatsnew15.html'); + $toc = getHelpToc( $helpsearch ); + $lang =& JFactory::getLanguage(); + $langTag = $lang->getTag(); + if( !JFolder::exists( JPATH_BASE.DS.'help'.DS.$langTag ) ) { + $langTag = 'en-GB'; // use english as fallback + } + + if (!eregi( '\.html$', $page )) { + $page .= '.xml'; + } + ?> + + + + + + +
+ + + + + +
+ : + + + + + + + 'helpFrame')) ?> + | + 'helpFrame')) ?> + | + 'helpFrame')) ?> + + 'helpFrame')) ?> | + 'helpFrame')) ?> | + 'helpFrame')) ?> + + | + 'helpFrame')) ?> + | + 'helpFrame')) ?> + | + 'helpFrame')) ?> + | + 'helpFrame')) ?> +
+
+ +
+
+ + + + +
+
    + $v) { + if ($helpurl) { + echo '
  • '; + echo JHTML::_('link', JHelp::createUrl( $k ), $v, array('target' => 'helpFrame')); + echo '
  • '; + } else { + echo '
  • '; + echo JHTML::_('link', JURI::base() .'help/'.$langTag.'/'.$k, $v, array('target' => 'helpFrame')); + echo '
  • '; + } + } + ?> +
+
+
+
+ +
+
+ + + + + + + + +
+
+ + +
+ +
+			/','',$changelog);
+
+			// Convert all other HTML entities
+			echo htmlentities($changelog);
+			?>
+		
+ '. JText::_( 'Writable' ) .''; + $unwriteable = ''. JText::_( 'Unwritable' ) .''; + + echo ''; + echo ''; + echo $text; + if ( $visible ) { + echo $folder . '/'; + } + echo ''; + echo ''; + if ( $relative ) { + echo is_writable( "../$folder" ) ? $writeable : $unwriteable; + } else { + echo is_writable( "$folder" ) ? $writeable : $unwriteable; + } + echo ''; + echo ''; +} + +/** + * Compiles the help table of contents + * @param string A specific keyword on which to filter the resulting list + */ +function getHelpTOC( $helpsearch ) +{ + global $mainframe; + + $lang =& JFactory::getLanguage(); + jimport( 'joomla.filesystem.folder' ); + + $helpurl = $mainframe->getCfg('helpurl'); + + // Check for files in the actual language + $langTag = $lang->getTag(); + if( !JFolder::exists( JPATH_BASE.DS.'help'.DS.$langTag ) ) { + $langTag = 'en-GB'; // use english as fallback + } + $files = JFolder::files( JPATH_BASE.DS.'help'.DS.$langTag, '\.xml$|\.html$' ); + + $toc = array(); + foreach ($files as $file) { + $buffer = file_get_contents( JPATH_BASE.DS.'help'.DS.$langTag.DS.$file ); + if (preg_match( '#(.*?)#', $buffer, $m )) { + $title = trim( $m[1] ); + if ($title) { + if ($helpurl) { + // strip the extension + $file = preg_replace( '#\.xml$|\.html$#', '', $file ); + } + if ($helpsearch) { + if (JString::strpos( strip_tags( $buffer ), $helpsearch ) !== false) { + $toc[$file] = $title; + } + } else { + $toc[$file] = $title; + } + } + } + } + asort( $toc ); + return $toc; +} diff --git a/oss/joomla/trunk/administrator/components/com_admin/admin.admin.php b/oss/joomla/trunk/administrator/components/com_admin/admin.admin.php new file mode 100644 index 00000000..eae282ec --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_admin/admin.admin.php @@ -0,0 +1,48 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_admin/tmpl/index.html b/oss/joomla/trunk/administrator/components/com_admin/tmpl/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_admin/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_admin/tmpl/navigation.php b/oss/joomla/trunk/administrator/components/com_admin/tmpl/navigation.php new file mode 100644 index 00000000..2a8d3d02 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_admin/tmpl/navigation.php @@ -0,0 +1,36 @@ + + +
\ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_config.php b/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_config.php new file mode 100644 index 00000000..b88cd9d7 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_config.php @@ -0,0 +1,73 @@ + +
+ + + + + + + + + + + + + + + + $v) { + if (eregi( 'var \$host', $v)) { + $cf[$k] = 'var $host = \'xxxxxx\''; + } else if (eregi( 'var \$user', $v)) { + $cf[$k] = 'var $user = \'xxxxxx\''; + } else if (eregi( 'var \$password', $v)) { + $cf[$k] = 'var $password = \'xxxxxx\''; + } else if (eregi( 'var \$db ', $v)) { + $cf[$k] = 'var $db = \'xxxxxx\''; + } else if (eregi( 'var \$ftp_user ', $v)) { + $cf[$k] = 'var $ftp_user = \'xxxxxx\''; + } else if (eregi( 'var \$ftp_pass ', $v)) { + $cf[$k] = 'var $ftp_pass = \'xxxxxx\''; + } else if (eregi( 'var \$smtpuser ', $v)) { + $cf[$k] = 'var $smtpuser = \'xxxxxx\''; + } else if (eregi( 'var \$smtppass ', $v)) { + $cf[$k] = 'var $smtppass = \'xxxxxx\''; + } else if (eregi( '', $v)) { + $cf[$k] = ''; + } else if (eregi( '}', $v)) { + $cf[$k] = ''; + } else if (eregi( 'class JConfig {', $v)) { + $cf[$k] = ''; + } + $cf[$k] = str_replace('var ','',$cf[$k]); + $cf[$k] = str_replace(';','',$cf[$k]); + $cf[$k] = str_replace(' = ',''; + if ($cf[$k] != '') { + $config_output[] = $cf[$k]; + } + } + echo implode( '', $config_output ); + ?> + + +
+ + + +
+   +
',$cf[$k]); + $cf[$k] = ''. $cf[$k] .'
+
diff --git a/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_directory.php b/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_directory.php new file mode 100644 index 00000000..a9a3853a --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_directory.php @@ -0,0 +1,80 @@ + +
+ + + + + + + + + + + + + + + get('image_path')); + writableCell( 'language' ); + + // List all site languages + $site_langs = JFolder::folders(JPATH_SITE.DS.'language'); + foreach ($site_langs as $slang) + { + writableCell( 'language/'.$slang ); + } + + writableCell( 'media' ); + writableCell( 'modules' ); + writableCell( 'plugins' ); + writableCell( 'plugins/content' ); + writableCell( 'plugins/editors' ); + writableCell( 'plugins/editors-xtd' ); + writableCell( 'plugins/search' ); + writableCell( 'plugins/system' ); + writableCell( 'plugins/user' ); + writableCell( 'plugins/xmlrpc' ); + writableCell( 'templates' ); + writableCell( JPATH_SITE.DS.'cache', 0, ''. JText::_( 'Cache Directory' ) .' ' ); + writableCell( JPATH_ADMINISTRATOR.DS.'cache', 0, ''. JText::_( 'Cache Directory' ) .' ' ); + writableCell( $config->getValue('config.log_path', JPATH_ROOT.DS.'log'),0, ''. JText::_( 'Log Directory' ) . + ' ($log_path) '); + writableCell( $config->getValue('config.tmp_path', JPATH_ROOT.DS.'tmp'),0, ''. JText::_( 'Temp Directory' ) . + ' ($tmp_path) '); + ?> + +
+ + + +
+   +
+
diff --git a/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_phpinfo.php b/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_phpinfo.php new file mode 100644 index 00000000..a1366b65 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_phpinfo.php @@ -0,0 +1,49 @@ + +
+ + + + + + + + + + + + + + + + + +
+   +
+   +
+ ]*>(.*)#siU', $phpinfo, $output); + $output = preg_replace('##', '', $output); + $output = str_replace('
', '', $output); + $output = str_replace('
', '', $output); + + echo $output; + ?> +
+
\ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_phpsettings.php b/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_phpsettings.php new file mode 100644 index 00000000..776304a5 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_phpsettings.php @@ -0,0 +1,165 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + setQuery( $query, 0, 1 ); + $editor = $db->loadResult(); + ?> + + + + + +
+ + + +
  +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+ : + + +
+
diff --git a/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_system.php b/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_system.php new file mode 100644 index 00000000..2e3fc114 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_admin/tmpl/sysinfo_system.php @@ -0,0 +1,98 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
  +
+ : + + +
+ : + + getVersion(); ?> +
+ : + + getCollation(); ?> +
+ : + + +
+ : + + +
+ : + + +
+ : + + getLongVersion(); + ?> +
+ : + + +
+
\ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_admin/toolbar.admin.html.php b/oss/joomla/trunk/administrator/components/com_admin/toolbar.admin.html.php new file mode 100644 index 00000000..0854b425 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_admin/toolbar.admin.html.php @@ -0,0 +1,48 @@ +get('secure',false); + $icon_dir = $mainframe->getSiteURL() . 'components/com_attachments/media/icons/'; + $num_columns = 8; + ?> +
+ + + + + + + + get('user_field_1_name', '') != '' ): $num_columns++; ?> + + + get('user_field_2_name', '') != '' ): $num_columns++; ?> + + + get('user_field_3_name', '') != '' ): $num_columns++; ?> + + + + + + + + + + + + getSiteURL() . $row->url; + if ( $secure ) { + $url = "index.php?option=com_attachments&task=download&id=" . $row->id; + $url = JRoute::_($url); + } + else + $url = $mainframe->getSiteURL() . $row->url; + $checked = JHTML::_('grid.id', $i, $row->id ); + $published = JHTML::_('grid.published', $row, $i ); + $size = intval($row->file_size / 1024); + $link = JFilterOutput::ampReplace( 'index.php?option=' . $option . '&task=edit&cid[]='. $row->id ); + $artLink = JFilterOutput::ampReplace( '../index.php?option=com_content&view=article&id=' . $row->article_id ); + $view_article_title = JText::_('VIEW ARTICLE TITLE'); + if ( strlen($row->icon_filename) > 0 ) + $icon_url = $icon_dir . $row->icon_filename; + else + $icon_url = $icon_dir . 'generic.gif'; + $add_attachment_icon = $mainframe->getSiteURL() . 'components/com_attachments/media/add_attachment.gif'; + $add_attachment_title = JText::_('ADD ATTACHMENT TITLE'); + $edit_attachment_title = JText::_('EDIT THIS ATTACHMENT TITLE'); + $access_attachment_title = JText::_('ACCESS THIS ATTACHMENT TITLE'); + + // Set up the create/modify dates + jimport( 'joomla.utilities.date' ); + $cdate = new JDate($row->create_date, -$mainframe->getCfg('offset')); + $create_date = $cdate->toFormat("%x %H:%M"); + $mdate = new JDate($row->modification_date, -$mainframe->getCfg('offset')); + $modification_date = $mdate->toFormat("%x %H:%M"); + + $add_attachment_txt = JText::_('ADD ATTACHMENT'); + if ($row->article_id != $last_article_id) { + $addAttachLink = 'index.php?option=' . $option . '&task=add&article_id='. $row->article_id; + $addAttachLink = JFilterOutput::ampReplace($addAttachLink); + $artLine = "\n"; + echo $artLine; + $k = 0; + } + $last_article_id = $row->article_id; + $download_verb = JText::_('DOWNLOAD VERB'); + ?> + "> + + + + + get('user_field_1_name', '') != '' ): ?> + + + get('user_field_2_name', '') != '' ): ?> + + + get('user_field_3_name', '') != '' ): ?> + + + + + + + + + + + + + + + + +
+ + get('user_field_1_name', '') ?>get('user_field_2_name', '') ?>get('user_field_3_name', '') ?>
"; + $artLine .= "".JText::_('ARTICLE')." " . $row->title . ""; + $artLine .= JFilterOutput::ampReplace('    '); + $artLine .= "\"$add_attachment_txt\" "; + $artLine .= "$add_attachment_txt"; + $artLine .= "
+ <?php echo $download_verb; ?> filename; ?>  <?php echo $download_verb; ?> + description; ?>user_field_1; ?>user_field_2; ?>user_field_3; ?>file_type; ?>download_count; ?>
getListFooter(); ?>
+ + + +
+ get('secure',false); + + // Set up the create/modify dates + jimport( 'joomla.utilities.date' ); + $cdate = new JDate($row->create_date, -$mainframe->getCfg('offset')); + $create_date = $cdate->toFormat("%x %H:%M"); + $mdate = new JDate($row->modification_date, -$mainframe->getCfg('offset')); + $modification_date = $mdate->toFormat("%x %H:%M"); + + $change_article_url = "index.php?option=com_attachments&task=edit&cid[]={$row->id}&change=article"; + $update_file_url = "index.php?option=com_attachments&task=edit&cid[]={$row->id}&change=file"; + + if ( $update_file ) + $enctype = "enctype=\"multipart/form-data\""; + else + $enctype = ''; + + ?> +
name="adminForm" id="adminForm"> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + get('user_field_1_name', '') != '' ): ?> + + + + + get('user_field_2_name', '') != '' ): ?> + + + + + get('user_field_3_name', '') != '' ): ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  + + + article_title; ?> + +
+ + + +  filename; ?> + +
filename_sys; ?>
  
uploader_name;?>
url; ?>
file_type; ?>
size; ?>
:
:
:download_count; ?>
+
+ + + + + +
addStyleSheet( $mainframe->getSiteURL() . 'plugins/content/attachments.css', + 'text/css', null, array() ); + + // Get the article title (if any) + $article_title = false; + if ( $article_id ) { + // Get the article names + $query = "SELECT * FROM #__content WHERE id='$article_id' LIMIT 1"; + $db->setQuery($query); + $rows = $db->loadObjectList(); + if ( count($rows) != 1 ) { + $errmsg = JText::_('ERROR INVALID ARTICLE ID') . " ($article_id)"; + JError::raiseError(500, $errmsg); + } + $article_title = $rows[0]->title; + } + if ( $article_title ) { + echo "

" . JText::_('ARTICLE') . " “$article_title”

"; + } + + // Show the existing attachments + require_once(JPATH_COMPONENT_SITE.DS.'helper.php'); + echo AttachmentsHelper::attachmentsTableHTML($article_id, + 'EXISTING ATTACHMENTS', false,false,$from); + + // Handle the from option + if ( $from ) + $fromval = $from; + else + $fromval = ''; + + $save_url = JRoute::_(JURI::root() . "administrator/index.php?option=com_attachments&task=save"); + ?> + +
+
+ + +

+ +

+   + + +

+ +

+

+

+  

+

+

+
+ + + + + +
+ +
+ + +
+ diff --git a/oss/joomla/trunk/administrator/components/com_attachments/admin.attachments.php b/oss/joomla/trunk/administrator/components/com_attachments/admin.attachments.php new file mode 100644 index 00000000..6cf0ee09 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/admin.attachments.php @@ -0,0 +1,46 @@ +addStyleSheet( $mainframe->getSiteURL() . 'administrator/components/com_attachments/attachments.css', + 'text/css', null, array() ); + +// Check for requests for named controller +$controller = JRequest::getWord('controller', False); +if ( $controller ) { + // Invoke the named controller, if it exists + $path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php'; + jimport('joomla.filesystem.file'); + if ( JFile::exists($path) ) { + require_once( $path ); + $classname = 'AttachmentsController'.ucfirst($controller); + $controller = new $classname( ); + $controller->execute( JRequest::getCmd( 'task' ) ); + $controller->redirect(); + } + else { + echo "

Error! Unable to find controller '$controller'!


"; + exit(); + } + } + +// Use default controller +$controller = new AttachmentsController( array('default_task' => 'showAttachments') ); +$controller->execute( JRequest::getVar( 'task' ) ); +$controller->redirect(); + +?> diff --git a/oss/joomla/trunk/administrator/components/com_attachments/attachments.css b/oss/joomla/trunk/administrator/components/com_attachments/attachments.css new file mode 100644 index 00000000..b7201349 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/attachments.css @@ -0,0 +1,164 @@ +/* Styles for the main list of attachments in the administrative back end */ + +table.adminlist th { + text-align: left; + border-bottom: 0; +} +table.adminlist th.at_published { text-align: center; } +table.adminlist th.at_filename { text-align: left; } +table.adminlist th.at_description { text-align: left; } +table.adminlist th.at_user_field { text-align: left; } +table.adminlist th.at_file_type { text-align: center; } +table.adminlist th.at_file_size { text-align: center; } +table.adminlist th.at_create_date { text-align: center; } +table.adminlist th.at_mod_date { text-align: center; } +table.adminlist th.at_downloads { text-align: center; } + +table.adminlist td { + text-align: left; + border-bottom: 0; +} +table.adminlist td.at_published { text-align: center; } + +table.adminlist td.at_filename { + text-align: left; + font-size: 125%; +} +table.adminlist td.at_filename a img { + vertical-align: text-bottom; +} + +table.adminlist td.at_description { text-align: left; } +table.adminlist td.at_user_field { text-align: left; } +table.adminlist td.at_file_type { text-align: center; } +table.adminlist td.at_file_size { text-align: center; } +table.adminlist td.at_create_date { text-align: center; } +table.adminlist td.at_mod_date { text-align: center; } +table.adminlist td.at_downloads { text-align: center; } + + +table.adminlist td.at_articlesep { + height: 0.8em; + background-color: #DDD; + border-top: 1px solid #999; + border-bottom: 1px solid #BBB; + font-weight: bold; +} + + +/* For the link to download a file */ + +a.downloadAttach { + margin-left: 0px; + font-size: 80%; + color : red; + text-decoration: none; +} +a.downloadAttach:link { color : red; text-decoration: none; } +a.downloadAttach:visited { color : red; text-decoration: none; } +a.downloadAttach:hover { color : red; text-decoration: underline; } +a.downloadAttach:active { color : red; text-decoration: none; } + + + +/* For the link to add another attachment to an article */ + +a.addAttach { + font-weight: normal; + color: red; + text-decoration: none; +} +a.addAttach:link { color : red; text-decoration: none; } +a.addAttach:visited { color : red; text-decoration: none; } +a.addAttach:hover { color : red; text-decoration: underline; } +a.addAttach:active { color : red; text-decoration: none; } + +a.addAttach img { + vertical-align: text-bottom; +} + + +/* For the link to change the article */ + +a.changeButton { + padding-top: 1px; + padding-top: 1px; + padding-left: 4px; + padding-right: 4px; + margin-left: 20px; + font-size: 90%; + color : #333333; + text-decoration: none; + background-color: #CCCCCC; + border: 1px solid #888888; +} +a.changeButton:link { color : #333333; text-decoration: none; } +a.changeButton:visited { color : #333333; text-decoration: none; } +a.changeButton:hover { color : #333333; text-decoration: none; background-color: #DDDDDD; } +a.changeButton:active { color : #333333; text-decoration: none; } + +a.modal-button { + padding-top: 1px; + padding-top: 1px; + padding-left: 4px; + padding-right: 4px; + color: #333333; + background-color: #CCCCCC; + border: 1px solid #888888; + font-weight: bold; +} + +a.modal-button:link { color: #333333; text-decoration: none; } +a.modal-button:hover { color: #333333; text-decoration: none; background-color: #DDDDDD; } +a.modal-button:visited { color: #333333; text-decoration: none; } +a.modal-button:active { color: #333333; text-decoration: none; } + + +/* For the upload attachment form */ + +form.attachmentsBackend { + margin-top: 10px; + margin-left: -8px; +} + +form.attachmentsBackend legend { + font-size: 140%; + font-weight: bold; +} + + +/* Styles for attachments admin */ +div.attachmentsAdmin { + margin-left: 20px; + margin-top: 20px; +} + +div.attachmentsAdmin h1 { + line-height: normal; + font-size: 200%; + font-weight: bold; + color: #000088; +} + +div.attachmentsAdmin h2 { + line-height: normal; + font-size: 150%; + font-weight: bold; +} + +div.attachmentsAdmin li a { padding: 2px; } +div.attachmentsAdmin li a:link { color: #0000FF; text-decoration: none; } +div.attachmentsAdmin li a:hover { + color: #0000FF; text-decoration: none; + background-color: #DDDDDD; + } +div.attachmentsAdmin li a:visited { color: #0000FF; text-decoration: none; } +div.attachmentsAdmin li a:active { color: #0000FF; text-decoration: none; } + +/* For icons */ + +.icon-48-attachments { background-image: url(../../components/com_attachments/attachments_logo48.png); } + +.icon-16-attachments { background-image: url(../../components/com_attachments/icon-16-attachments.png); } + +.icon-32-admin { background-image: url(../../components/com_attachments/attachments_admin32.png); } \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/attachments.png b/oss/joomla/trunk/administrator/components/com_attachments/attachments.png new file mode 100644 index 0000000000000000000000000000000000000000..eb32422041dd6f93f5d37ceb45580a9a1f6aa3e6 GIT binary patch literal 1124 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJXMsm#F#`j)FbFd;%$g$s6l6(v z^mSxl*w|O|J8&|PuaN8!$uU)%#>C&b1=FOWud-lwkGbc};JYm9wzP`Smo}R9*u8xk5_V)JH*4CDmmgeT> zrlzLa+S=;s>hkjP!otGz^z^i}w3wI}UteE$cXwA;S0^VYOG`^LGc!$1O$`kV6%`d_ zWo0=zIayg*QBhG55fN@~ZWb06W@ct4CMKZA{{IJhWfY8t0F^^vN@r#p&`8UYAirQ> z8Y2rZSglEQ02EaktaVzAUA(xY(K+D5=aqi02go$c9n-a7>{#$!?-zi}g-z>r0 zYmZVzcRx&)a9j6)VJ|~N)8%~aovaesJ3}}Fg+vuxBux(Fb_H!On73%Nj^e5P3m)jQ zRL*3wJo3TByycEu$hZ5v4|i~|Ni9zi)G?fL-`9KResc$lAD^fE-tlHek-kCJLt}=k Wvy82GzD?l=1(v6)pUXO@geCyM0q9u( literal 0 HcmV?d00001 diff --git a/oss/joomla/trunk/administrator/components/com_attachments/attachments.xml b/oss/joomla/trunk/administrator/components/com_attachments/attachments.xml new file mode 100644 index 00000000..b3698ffe --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/attachments.xml @@ -0,0 +1,124 @@ + + + + Attachments + Jonathan M. Cameron + August 17, 2008 + (C) 2007, 2008 Jonathan M. Cameron. All rights reserved. + http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL + jmcameron@jmcameron.net + http://joomlacode.org/gf/project/attachments/ + 1.3.4 + Attachments for Articles installed: This component allows files to be uploaded and attached to articles. + install.attachments.php + uninstall.attachments.php + + + install.mysql.sql + install.noutf8.sql + + + + + uninstall.mysql.sql + + + + en-GB.com_attachments.ini + + + attachments.php + controller.php + helper.php + permissions.php + file_types.php + router.php + index.html + models/index.html + models/update.php + views/index.html + views/update/index.html + views/update/view.php + views/update/metadata.xml + views/upload/index.html + views/upload/metadata.xml + views/upload/view.php + media/index.html + media/add_attachment.gif + media/attachment.gif + media/delete.gif + media/pencil.gif + media/update.gif + media/icons/index.html + media/icons/3d.gif + media/icons/archive.gif + media/icons/audio.gif + media/icons/c.gif + media/icons/cpp.gif + media/icons/css.gif + media/icons/csv.gif + media/icons/download.gif + media/icons/eps.gif + media/icons/excel.gif + media/icons/flash.gif + media/icons/generic.gif + media/icons/h.gif + media/icons/image.gif + media/icons/js.gif + media/icons/midi.gif + media/icons/mov.gif + media/icons/music.gif + media/icons/odg.gif + media/icons/odp.gif + media/icons/ods.gif + media/icons/odt.gif + media/icons/pdf.gif + media/icons/php.gif + media/icons/ppt.gif + media/icons/ps.gif + media/icons/rtf.gif + media/icons/sql.gif + media/icons/text.gif + media/icons/video.gif + media/icons/word.gif + media/icons/xml.gif + media/icons/zip.gif + + + Attachments + + en-GB.com_attachments.ini + en-GB.com_attachments.menu.ini + + + install.mysql.sql + install.noutf8.sql + uninstall.mysql.sql + config.xml + admin.attachments.html.php + admin.attachments.php + controller.php + controllers/index.html + controllers/special.php + models/index.html + models/special.php + tables/attachments.php + tables/index.html + views/index.html + views/special/index.html + views/special/view.php + update.php + help/index.html + help/en-GB/help.html + help/en-GB/help.css + help/en-GB/index.html + toolbar.attachments.html.php + toolbar.attachments.php + attachments.css + attachments.png + attachments_admin32.png + attachments_logo48.png + index.html + + + diff --git a/oss/joomla/trunk/administrator/components/com_attachments/attachments_admin32.png b/oss/joomla/trunk/administrator/components/com_attachments/attachments_admin32.png new file mode 100644 index 0000000000000000000000000000000000000000..ea04c96995f7358ee65835eeacaa50576b909c3d GIT binary patch literal 2859 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 GG5-T0AzkbM literal 0 HcmV?d00001 diff --git a/oss/joomla/trunk/administrator/components/com_attachments/attachments_logo48.png b/oss/joomla/trunk/administrator/components/com_attachments/attachments_logo48.png new file mode 100644 index 0000000000000000000000000000000000000000..e9dd5b7211f87ce4b98b70a5d2343536a1f0b415 GIT binary patch literal 5209 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/oss/joomla/trunk/administrator/components/com_attachments/controller.php b/oss/joomla/trunk/administrator/components/com_attachments/controller.php new file mode 100644 index 00000000..78c1b0a0 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/controller.php @@ -0,0 +1,441 @@ +registerTask('apply', 'save'); + $this->registerTask('applyNew', 'saveNew'); + $this->registerTask('unpublish', 'publish'); + } + + function showAttachments() + { + global $option, $mainframe; + $limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit')); + $limitstart = JRequest::getVar('limitstart', 0); + $db =& JFactory::getDBO(); + $query = "SELECT count(*) FROM #__attachments"; + $db->setQuery($query); + $total = $db->loadResult(); + $query = "SELECT *, #__attachments.id as id, c.title as title FROM #__attachments "; + $query .= "LEFT JOIN #__content as c ON #__attachments.article_id = c.id ORDER BY c.id"; + $db->setQuery($query, $limitstart, $limit); + $rows = $db->loadObjectList(); + if ($db->getErrorNum()) { + echo $db->stderr(); + return false; + } + jimport('joomla.html.pagination'); + $pageNav = new JPagination($total, $limitstart, $limit); + HTML_attachments::showAttachments($option, $rows, $pageNav); + } + + function add() + { + global $mainframe, $option; + + // See if an article is specified + $article_id = JRequest::getVar('article_id', false); + $from = JRequest::getVar('from', false); + + // Use a different template for the iframe view + if ( $from == 'closeme') { + JRequest::setVar('tmpl', 'component'); + } + + // Add the published selection + $lists['published'] = JHTML::_('select.booleanlist', + 'published', 'class="inputbox"', false); + + if ( !$article_id ) { + // Set up the necessary javascript + $document = & JFactory::getDocument(); + $document->addScript( JURI::root(true).'/media/system/js/modal.js' ); + $js = " + function jSelectArticle(id, title) { + document.getElementById('article_id').value = id; + document.getElementById('article_title').value = title; + document.getElementById('sbox-window').close(); + }"; + $document->addScriptDeclaration($js); + JHTML::_('behavior.modal', 'a.modal-button'); + } + else { + if ( !is_numeric($article_id) ) { + $errmsg = JText::_('ERROR INVALID ARTICLE ID') . " ($article_id)"; + JError::raiseError(500, $errmsg); + } + } + + JRequest::setVar( 'hidemainmenu', 1 ); + + HTML_attachments::newAttachment($article_id, $lists, $option, $from); + } + + function edit() + { + global $option, $mainframe; + + $db =& JFactory::getDBO(); + + $row =& JTable::getInstance('Attachments', 'Table'); + $cid = JRequest::getVar( 'cid', array(0), '', 'array'); + $change_article = JRequest::getVar('change', False) == 'article'; + $update_file = JRequest::getVar('change', False) == 'file'; + $id = $cid[0]; + $row->load($id); + $lists = array(); + $lists['published'] = JHTML::_('select.booleanlist', 'published', + 'class="inputbox"', $row->published); + + // Construct the drop-down list for legal icon filenames + $icon_filenames = array(); + require_once(JPATH_COMPONENT_SITE.DS.'file_types.php'); + foreach ( AttachmentsFileTypes::unique_icon_filenames() as $ifname) { + $icon_filenames[] = JHTML::_('select.option', $ifname); + } + $lists['icon_filenames'] = JHTML::_('select.genericlist', $icon_filenames, + 'icon_filename', 'class="inputbox" size="1"', 'value', 'text', $row->icon_filename); + + // Get the uploaders name + $query = "SELECT name FROM #__users WHERE id='" . $row->uploader_id . "' LIMIT 1"; + $db->setQuery($query); + $row->uploader_name = $db->loadResult(); + + // Massage the data + $row->size = intval( $row->file_size / 1024.0 ); + $row->url = $mainframe->getSiteURL() . $row->url; + + // Get the article name + $article_id = $row->article_id; + $query = "SELECT * FROM #__content WHERE id='$article_id' LIMIT 1"; + $db->setQuery($query); + $arows = $db->loadObjectList(); + if ( count($arows) != 1 ) { + $errmsg = JText::_('ERROR INVALID ARTICLE ID') . " ($article_id)"; + JError::raiseError(500, $errmsg); + } + $row->article_title = $arows[0]->title; + + if ( $change_article ) { + $document = & JFactory::getDocument(); + $document->addScript( JURI::root(true).'/media/system/js/modal.js' ); + $js = " + function jSelectArticle(id, title) { + document.getElementById('article_id').value = id; + document.getElementById('article_title').value = title; + document.getElementById('sbox-window').close(); + }"; + $document->addScriptDeclaration($js); + JHTML::_('behavior.modal', 'a.modal-button'); + } + + JRequest::setVar( 'hidemainmenu', 1 ); + + HTML_attachments::editAttachment($row, $lists, $option, $change_article, $update_file); + } + + function save() + { + // Check for request forgeries + JRequest::checkToken() or die( 'Invalid Token'); + + global $option; + $row =& JTable::getInstance('Attachments', 'Table'); + if (!$row->bind(JRequest::get('post'))) { + JError::raiseError(500, $errmsg); + } + + // See if the article has been changed, rename files if necessary + $old_article_id = JRequest::getVar('old_article_id', false); + if ( $old_article_id && is_numeric($old_article_id) ) { + $old_article_id = intval($old_article_id); + } + $article_id = intval($row->article_id); + if ( $old_article_id && ( $article_id != $old_article_id ) ) { + require_once(JPATH_BASE.DS.'..'.DS.'components'.DS.'com_attachments'.DS.'helper.php'); + $error_msg = AttachmentsHelper::switch_article($row, $old_article_id, $article_id); + if ( $error_msg != '' ) { + $warning = JText::_($error_msg); + JError::raiseError(500, $warning); + } + } + + // Compute the update time + jimport( 'joomla.utilities.date' ); + $now = new JDate(); + $row->modification_date = $now->toMySQL(); + + // Update the record + $update_file = JRequest::getVar('update_file', False); + $msg = ""; + if ( $update_file && ( ($_FILES['upload']['size'] > 0) || + ($_FILES['upload']['tmp_name'] != '') ) ) { + // Process the uploaded file (if one was uploaded) + // (Note that this also save the record) + require_once(JPATH_BASE.DS.'..'.DS.'components'.DS.'com_attachments'.DS.'helper.php'); + $msg = AttachmentsHelper::upload_file($row, $article_id, true); + } + else { + // Save the updated attachment + if (!$row->store()) { + JError::raiseError(500, $row->getError()); + } + } + + switch ($this->_task) + { + case 'apply': + $msg = JText::_('CHANGES TO ATTACHMENT SAVED'); + $link = 'index.php?option=' . $option . '&task=edit&cid[]=' . $row->id; + break; + + case 'save': + default: + $msg = JText::_('ATTACHMENT SAVED'); + $link = 'index.php?option=' . $option; + break; + } + + $this->setRedirect($link, $msg); + } + + + function saveNew() + { + // Check for request forgeries + JRequest::checkToken() or die( 'Invalid Token'); + + // Make sure we have a user + $user =& JFactory::getUser(); + if ( $user->get('username') == '' ) { + $errmsg = JText::_('ERROR MUST BE LOGGED IN TO UPLOAD ATTACHMENT'); + JError::raiseError(500, $errmsg); + } + + // Make sure we have a valid article ID + require_once(JPATH_BASE.DS.'..'.DS.'components'.DS.'com_attachments'.DS.'helper.php'); + $article_id = AttachmentsHelper::valid_article_id($_POST['article_id']); + if ( $article_id == -1 ) { + + // Save the warning message for the pop-up window + + // ??? + // echo ""; + // echo ""; + +// require_once(JPATH_BASE.DS.'..'.DS.'components'.DS.'com_attachments'.DS.'helper.php'); +// $msg = JText::_('ERROR MUST SELECT ARTICLE'); +// AttachmentsHelper::save_warning_message($msg); +// $button->set('options', "{handler: 'iframe', size: {x: 400, y: 300}}"); +// $link = "index.php?option=com_attachments&task=warning&tmpl=component"; + + $errmsg = JText::_('ERROR MUST SELECT ARTICLE'); + echo "\n"; +// exit(); + } + + // Make sure this user has permission to upload (should never fail with admin?) + require_once(JPATH_COMPONENT_SITE.DS.'permissions.php'); + if ( !AttachmentsPermissions::user_may_add_attachment($user, $article_id) ) { + $errmsg = JText::_('ERROR NO PERMISSION TO UPLOAD'); + JError::raiseError(500, $errmsg); + exit(); + } + + // Set up the new record + $row =& JTable::getInstance('Attachments', 'Table'); + if (!$row->bind(JRequest::get('post'))) { + JError::raiseError(500, $row->getError()); + } + $row->uploader_id = $user->get('id'); + $row->article_id = $article_id; + + // Handle 'from' clause + $from = JRequest::getVar('from', ' (no from)'); + + $msg = AttachmentsHelper::upload_file($row, $article_id); + + // See where to go to next + global $option; + switch ($this->_task) + { + case 'applyNew': + $link = 'index.php?option=' . $option . '&task=edit&cid[]=' . $row->id; + break; + + case 'saveNew': + default: + $link = 'index.php?option=' . $option; + break; + } + + // If called from the editor, go back to it + if ($from == 'editor') { + $link = 'index.php?option=com_content&task=edit&cid[]=' . $article_id; + } + + // If we are supposed to close this iframe, do it now. + if ( $from == 'closeme' ) { + echo ""; + exit(); + } + + $this->setRedirect($link, $msg); + } + + + function myCancel() + { + // See if we have a special 'from' to handle + $from = JRequest::getVar('from', false); + if ( $from == 'editor' ) { + + // Make sure we have a valid article ID + require_once(JPATH_BASE.DS.'..'.DS.'components'.DS.'com_attachments'.DS.'helper.php'); + $article_id = AttachmentsHelper::valid_article_id($_POST['article_id']); + if ( $article_id == -1 ) { + $this->execute('cancel'); // Give up + } + + $link = 'index.php?option=com_content&task=edit&cid[]=' . $article_id; + $this->setRedirect($link, JText::_('UPLOAD CANCELED')); + } + + $this->execute('cancel'); + } + + + function download() + { + global $mainframe; + if ( ! $mainframe->isAdmin() ) { + $errmsg = JText::_('ERROR MUST BE LOGGED IN AS ADMIN'); + JError::raiseError(500, $errmsg); + } + + // Get the attachment ID + $id = JRequest::getVar('id', null); + if ( !is_numeric($id) ) { + JError::raiseError(500, $errmsg); + } + + require_once(JPATH_BASE.DS.'..'.DS.'components'.DS.'com_attachments'.DS.'helper.php'); + + AttachmentsHelper::download_attachment($id); + } + + + + function remove() + { + jimport('joomla.filesystem.file'); + + global $option; + $cid = JRequest::getVar('cid', array(), '', 'array'); + $db =& JFactory::getDBO(); + if (count($cid)) { + $cids = implode(',', $cid); + $query = "SELECT filename_sys, id FROM #__attachments WHERE id IN ( $cids )"; + $db->setQuery($query); + $rows = $db->loadObjectList(); + + // First delete the actual attachment files + foreach ($rows as $row) { + JFile::delete($row->filename_sys); + } + + // Delete the entries in the attachments table + $query = "DELETE FROM #__attachments WHERE id IN ( $cids )"; + $db->setQuery($query); + if (!$db->query()) { + JError::raiseError(500, $db->getErrorMsg()); + } + } + + $this->setRedirect( 'index.php?option=' . $option); + } + + + function publish() + { + global $option; + $cid = JRequest::getVar('cid', array(), '', 'array'); + if ($this->_task == 'publish') { + $publish = 1; + } + else { + $publish = 0; + } + $attachmentTable =& JTable::getInstance('attachments', 'Table'); + $attachmentTable->publish($cid, $publish); + $this->setRedirect('index.php?option=' . $option); + } + + + function admin() + { + // Set up the tooltip behavior + $opts = Array( 'hideDelay' => 0, 'showDelay' => 0 ); + JHTML::_('behavior.tooltip', '.hasTip', $opts); + + // Set up url/link/tooltip for each command + $url_top = JURI::base() . "index.php?option=com_attachments"; + + // Set up the HTML for each command + $disable_mysql_uninstall_url = "$url_top&controller=special&task=disable_sql_uninstall&tmpl=component&close=true"; + // $disable_mysql_uninstall = JText::_('DISABLE MYSQL UNINSTALLATION'); + $disable_mysql_uninstall_tooltip = JText::_('DISABLE MYSQL UNINSTALLATION TOOLTIP'); + $disable_mysql_uninstall_html = + JHTML::_('tooltip', $disable_mysql_uninstall_tooltip, null, null, + 'DISABLE MYSQL UNINSTALLATION' , $disable_mysql_uninstall_url ); + + $regenerate_system_filenames_url = "$url_top&controller=special&task=regenerate_system_filenames&tmpl=component&close=true"; + // $regenerate_system_filenames = JText::_('REGENERATE ATTACHMENT SYSTEM FILENAMES'); + $regenerate_system_filenames_tooltip = JText::_('REGENERATE ATTACHMENT SYSTEM FILENAMES TOOLTIP'); + $regenerate_system_filenames_html = + JHTML::_('tooltip', $regenerate_system_filenames_tooltip, null, null, + 'REGENERATE ATTACHMENT SYSTEM FILENAMES', $regenerate_system_filenames_url); + ?> +
+

+
    +
  • + +
  • +
+
+ addStyleSheet( $mainframe->getSiteURL() . 'plugins/content/attachments.css', + 'text/css', null, array() ); + $document->addStyleDeclaration( + 'div.componentheading { display: none; } * { overflow: hidden; };'); + + echo '

' . JText::_('WARNING') . '

'; + echo '

'; + echo ''; + echo '

'; + } + +} +?> diff --git a/oss/joomla/trunk/administrator/components/com_attachments/controllers/index.html b/oss/joomla/trunk/administrator/components/com_attachments/controllers/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/controllers/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/controllers/special.php b/oss/joomla/trunk/administrator/components/com_attachments/controllers/special.php new file mode 100644 index 00000000..faa30e62 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/controllers/special.php @@ -0,0 +1,180 @@ +Special function not specified!"; + exit(); + } + + function editParams() + { + // This function allows editing the Attachments parameters + // with a form that has a regular submit button (not Javascript). + // + // This function is for automated testing of the Attachments + // extension and as exactly the same functionality as the regular + // Attachments parameter editor in the component manager, except + // that it is not a pop-up window. + // + // Due to the implementation of the component parameter editor for + // pop up frames, this save form pops back into edit mode after saving. + + $model = $this->getModel('Special'); + if ( !$model ) { + echo "Unable to find Special model!
"; + exit(); + } + + $table =& JTable::getInstance('component'); + if (!$table->loadByOption( 'com_attachments' )) + { + JError::raiseWarning( 500, 'Unable to load Attachments component' ); + return false; + } + + require_once(JPATH_COMPONENT.DS.'views'.DS.'special'.DS.'view.php'); + $view = new AttachmentsViewSpecial( ); + $view->assignRef('component', $table); + $view->setModel( $model, true ); + $view->display(); + } + + + function showSEF() + { + global $mainframe; + echo ''; + echo "SEF Status"; + echo "SEF: " . $mainframe->getCfg('sef') . "
"; + echo ""; + exit(); + } + + function listAttachmentIDs() + { + $db =& JFactory::getDBO(); + $query = "SELECT attach.id,article_id,art.sectionid,art.catid FROM #__attachments as attach "; + $query .= "LEFT JOIN #__content as art ON attach.article_id = art.id ORDER BY art.id"; + $db->setQuery($query); + $rows = $db->loadObjectList(); + echo ''; + echo "\nAttachment IDs\n"; + echo "Attachment IDS:"; + foreach ($rows as $row) { + echo " " . $row->id . "/" . $row->article_id . "/" . $row->sectionid . "/" . $row->catid; + } + echo "\n"; + exit(); + } + + + // Define some functions for URLs to invoke the udpate functions + // (We could move these to an update controller...) + // + + function add_icon_filenames() + { + global $option; + require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_attachments'.DS.'update.php'); + $msg = AttachmentsUpdate::add_icon_filenames(); + $this->setRedirect('index.php?option=' . $option, $msg); + } + + + function update_null_dates($redirect=true) + { + global $option; + require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_attachments'.DS.'update.php'); + + $numUpdated = AttachmentsUpdate::update_null_dates(); + $msg = JText::sprintf( 'UPDATED N ATTACHMENTS', $numUpdated ); + $this->setRedirect('index.php?option=' . $option, $msg); + } + + + function update_attachments_table() + { + global $option; + require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_attachments'.DS.'update.php'); + + echo ''; + echo "\nUpdating Attachments Tables\n"; + echo "

Updating Attachments Tables

\n"; + + AttachmentsUpdate::update_attachments_table(); + + $return_url = JURI::base(); + echo "
 
Return to Admin page\n"; + echo "\n"; + + exit(); + } + + function disable_sql_uninstall() + { + require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_attachments'.DS.'update.php'); + + $close =JRequest::getVar('close', false); + $msg = AttachmentsUpdate::disable_sql_uninstall(); + + if ( $close ) { + require_once(JPATH_COMPONENT_SITE.DS.'helper.php'); + AttachmentsHelper::enqueueSystemMessage($msg); + + // Close this window and refesh the parent window + echo ""; + } + else { + global $option; + $this->setRedirect('index.php?option=' . $option, $msg); + } + } + + + function regenerate_system_filenames() + { + require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_attachments'.DS.'update.php'); + + $close =JRequest::getVar('close', false); + $msg = AttachmentsUpdate::regenerate_system_filenames(); + + if ( $close ) { + require_once(JPATH_SITE.DS.'components'.DS.'com_attachments'.DS.'helper.php'); + AttachmentsHelper::enqueueSystemMessage($msg); + echo ""; + } + else { + global $option; + $this->setRedirect('index.php?option=' . $option, $msg); + } + } + + +} diff --git a/oss/joomla/trunk/administrator/components/com_attachments/help/en-GB/help.css b/oss/joomla/trunk/administrator/components/com_attachments/help/en-GB/help.css new file mode 100644 index 00000000..41a57215 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/help/en-GB/help.css @@ -0,0 +1,54 @@ +ul li { + /* border: 1px solid blue; */ + border-top: 12px solid transparent; +} + +ol li { + border-top: 4px solid transparent; + /* border: 1px solid red; */ +} + +h1 { + margin-bottom: 0px; + /* border: 1px solid red; */ +} + +h2 { + margin-top: 18px; + margin-bottom: 4px; + /* border: 1px solid red; */ +} +h3 { + margin-top: 0px; + /* border: 1px solid red; */ +} + +ul { + margin-top: 4px; +} + +span.atop { + padding-left: 1em; + font-size: 90%; +} + +a:link { color : #0033ff; text-decoration: none; } +a:visited { color : #0033ff; text-decoration: none; } +a:hover { color : #0033ff; text-decoration: underline; } +a:active { color : #0033ff; text-decoration: none; } + +ul.url { + margin-top: 4px; + padding-top: 0; +} + +ul.url li { + list-style-type: none; + padding: 0; + margin: 0; + border: 0; +} + +ul.url a { + font-weight: bold; +} \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/help/en-GB/help.html b/oss/joomla/trunk/administrator/components/com_attachments/help/en-GB/help.html new file mode 100644 index 00000000..8f5dca93 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/help/en-GB/help.html @@ -0,0 +1,509 @@ + + + + +Attachments Documentation + + + + +

Attachments Documentation

+

Version 1.3.4 - August 2008

+ +
    +
  1. Introduction
  2. +
  3. Uploading Restrictions
  4. +
  5. Settings
  6. +
  7. Display Filenames
  8. +
  9. CSS Styling of Attachment Lists
  10. +
  11. File Type Icons
  12. +
  13. Warnings
  14. +
  15. Upgrading
  16. +
  17. Acknowledgements
  18. +
+ +

Introduction

+The 'Attachments' extension for Joomla! allows files to be uploaded +and attached to content articles. 'Attachments' includes a +plugin to display the attachments and a component for uploading and managing +attachments. There are options to control who can see the attachments and +who can upload them, along with several other options to increase its +flexibility and usefulness. Note: all options are controlled through +the component manager. This extension only works for Joomla! 1.5 or later. +
 
+ +If you wish to subsribe to an email list for announcements about +this extension, please subscribe using this web page: + + +This extension provides translation capabilities and supports the following +languages (besides English): +
    +
  • Bulgarian: This translation was done by Stefan Ilivanov. (Thanks Stefan!)
  • +
  • Chinese: Traditional and simplified Chinese translations by baijianpeng + (http://www.joomlagate.com). (Thanks baijaing!)
  • +
  • Dutch: This translation was done by Parvus. (Thanks Parvus!)
  • +
  • Finnish: This translation was done by Tapani Lehtonen. (Thanks Tapani!)
  • +
  • French: This translation was done by Pascal Adalian. (Thanks Pascal!)
  • +
  • German: This translation was done by Michael Scherer. (Thanks Michael!)
  • +
  • Greek: This translation was done by Harry Nakos. (Thanks Harry!)
  • +
  • Italian: This translation was done by Lemminkainen. (Thanks Lemminkainen!)
  • +
  • Norwegian: This translation was done by Espen Gjelsvik. (Thanks Espen!)
  • +
  • Persian: This translation was done by Hossein Moradgholi of the Parsjoomla project. (Thanks Hossein!)
  • +
  • Polish: This translation was done by Piotr Wójcik. (Thanks Piotr!)
  • +
  • Portuguese/Brazilian: This translation was done by Arnaldo Giacomitti + (www.giacomitti.eng.br) and Cauan Cabral (www.cauancabral.net).
  • +
  • Spanish: This translation was done by Carlos Alfaro. (Thanks Carlos!)
  • +
+Many thanks to the translators! If you would like to help translate the +extension to any other language, please contact the author (see end). +[Back to top] + +

Uploading Restrictions

+Not all types of attachment files can be uploaded. The 'Attachments' extension +will not allow uploading of files that are not permitted by the Joomla! Media Manager. +To see (or change) what file types are allowed, go to the Global Configuration +page and click on the System tab. In the Media Settings area, there are +options for controlling what types of file extensions and mime types are permitted +for uploads. The 'Attachments' respects these limitations. However, the +restriction on 'Legal Image Extensions (File Types)' is ignored. +[Back to top] + +

Attachments Settings

+All of the settings for 'Attachments' are controlled via the + component manager. To access these settings, go to the administrative +back end and select "Article Attachments" under the "Component" menu. Click +on the "Parameters" button on the right end of the tool bar and you will see +a series of parameters for this extension. These parameters include +the following:
+
    + +
  • Who can see attachments: This setting controls +who will be able to see the links for the attachments. There are +currently two options: +
      +
    1. 'anyone' - If this option is selected, the links to the +attachments will be visible to anyone visiting the website, whether +they are logged in or not.
    2. +
    3. 'any logged-in user'. - If this option is selected, only +users who are logged into the website will be able to see the links +to the attachments.
    4. +
    +
  • + +
  • Who can add attachments: This setting controls +who is able to add attachments to articles. There are two +options: +
      +
    1. 'Article author only' - The links to upload articles will only +be visible to the author of the article (as well as other users with higher +permissions such as Editors and administrators).
    2. +
    3. 'Any logged-in user' - The links to upload articles will be +visible to any user who is logged in.
    4. +
    +
  • + +
  • Attachments published by default: This 'auto +publish' feature controls whether new attachments are published by +default when they are added. If 'Yes' is selected, when articles +are added, they will published immediately and will be visible to users. If +'No' is selected, new articles will not be published by default. +An administrator will need to publish them from the administrative back end +before the articles will be available.
  • + +
  • Auto Publish Warning: If the auto-publish option is +disabled (see previous option), you may wish to inform those adding +attachments how they can get their attachment published. You can insert an +appropriate message here. If this field is empty, a general system message +will be added suggesting that they contact their system administrator to +any newly uploaded attachments published.
  • + +
  • Show titles: If set to 'Yes', a row of titles will be +added above the list of attachments describing what is in each column.
  • + +
  • Show attachment description: This setting controls +whether the attachment description is shown in the list of attachments.
  • + +
  • Show file size: This setting controls +whether the attachment file size is shown in the list of attachments.
  • + +
  • Show number of downloads: This setting controls +whether the number of downloads is shown in the list of attachments. +WARNING: This option only works in secure mode! +In non-secure mode, files are maintained as static files and accessed +directly, without going through Joomla! code. Therefore it is impossible +to update the number of downloads for a file when it is accessed this way. +So the display of the number of downloads will only work in secure mode +when this option is set to 'Yes'.
  • + +
  • Show file modification date: If this setting +is 'Yes', the modification date for the file will be added to the +attachment list for articles that have attachments. If 'No' is +selected, no date will be added to the attachment list.
  • + +
  • Format string for modification date: You may +select the format for the modification date by using the format +used by the PHP strftime() function. Search the web with +'PHP strftime' for for examples. The default format (%x %H:%M) +gives dates with 24-hour time like 4/28/2008 14:21. To +remove the time of day part, leave out the "%H:%M" part. Note +that MS Windows and Linux PHP implementations may differ in +some of the codes that they support.
  • + +
  • Name for user-defined field 1-3: If you have some additional information about each attachment that you wish to add, the Attachments extension allows you to defined up to three optional user-defined fields. To create a new field, insert the name for it in one of the three entries. Clear the name to disable the display and editing of this field. The user-defined fields will be shown in the order listed here. The maximum length of each user-defined field name is 40 characters. The data in these fields may be up to 100 characters long.
  • + +
  • Attachments list order: This option allows you to specify the order in which attachments will be listed in the attachments lists. Most of the options are self-explanatory: +
      +
    1. 'Filename' - If this option is selected, the attachments will be sorted alphabetically by the filname.
    2. +
    3. 'File size(smallest first)'
    4. +
    5. 'File size(largest first)'
    6. + +
    7. 'Description'
    8. +
    9. 'Creation date (oldest first)'
    10. +
    11. 'Creation date (newest first)'
    12. +
    13. 'Modification date (oldest first)'
    14. +
    15. 'Modification date (newest first)'
    16. +
    17. 'Attachment ID' - If this option is selected, the attachments will be sorted by the attachment ID. This has the effect of ordering the attachments in the order they were created.
    18. +
    19. 'User-defined field 1'
    20. +
    21. 'User-defined field 2'
    22. +
    23. 'User-defined field 3'
    24. +
    +
  • + +
  • Maximum filename length: +The maximum filename length for attachments list. Filenames longer than +this will be truncated and put into the display filename (for display purposes +only, the actual filename will not be changed). A value of 0 means the +filename length is unlimited by this option (the filename field in the attachments +database table is limited to 80 characters). Note: If display filenames are truncated +by this option, the truncated filename will be inserted into the "display filename" +field. +
  • + +
  • CSS style for attachments tables: To override the CSS +styling of attachments lists, specify your own style name here. The default +style name is 'attachmentsList'. See the [Styling +Attachment Lists] section for more information. +
  • + +
  • File link open mode: +This mode how the links to attachment files will be opened. 'In same window' +means the file will be opened in the same browser window. 'In new window' +means the file will be opened in a new window. In some browsers, using the +'In new window' option will actually open the attachment in a new tab. +
  • + +
  • Prepend to system filename: This setting +controls whether a numeric prefix should be added to the start +the image filename as it is stored on the server. There are three options: +
      +
    1. 'Article ID' - If this option is selected, the filename +will be prefixed with the article's id number. This choice will +reduce chances of filename collisions and will ensure that the +attachment files for a particular article will sort together in +directory listings. Also note that this option will allow different +files with the same filenames to be attached to different articles, but +not to the same article.
    2. +
    3. 'Attachment ID' - If this option is selected, the filename +will be prefixed with the attachment's id number. This choice will +eliminates the possibility of filename collision since each attachment will +always have a unique ID number. The attachment files will sort by the +order of attachment in directory listings.
    4. +
    5. 'Nothing' - If this option is selected, the filename +will be saved as given and will not be prefixed with anything. This +option increases the chance of filename collisions since +every uploaded file will need to have a unique filename.
    6. +
    +
  • + +
  • Subdirectory for uploads: The 'Attachments' +extension code will put files into this subdirectory under the top +of the Joomla site. The default is 'attachments'. +Note that if this subdirectory is changed, it will only affect future +uploads. Previously uploaded files will stay in the old subdirectory +and records in the attachments database will still point to those files. +If you wish to move the files from the old subdirectory to the new +subdirectory, you will need move the files and then update their +entries in the attachments database table manually. +
  • + +
  • Custom titles for attachments lists: By +default, the 'Attachments' extension inserts the title +"Attachments:" above the list of attachments for an article (if it has +attachments). In some cases, you may prefer using some other term for +specific articles. You may specify the exact term you would like to +use on an article-by-article basis. For example, if you would like article +211 to use the custom title "Downloads:", then add this to this setting: +'211 Downloads' (without the quotes). Use one entry per line. +
     
    +Note: If you wish to change the titles used for attachments lists globally, +you may edit the translations file entry 'ATTACHMENTS TITLE' in the translation +files: +
    
    +    administrator/language/qq-QQ/qq-QQ.plg_frontend_attachments.ini
    
    +
    +where qq-QQ refers to the language designator code such as en-GB for English. +(If you are not familiar with Joomla! translation files, find the line that +has 'ATTACHMENTS TITLE' on left side of the '=' sign. Edit anything to the +right of the '=' sign. Do not change anything to the left of the '=' sign.) +
  • + +
  • Hide Attachments for: +Comma-separated list of keywords or Sections/Categories of articles for which +the attachments list should be hidden. Two special keywords can be used: +'frontpage' to suppress displays of attachments on the front page and +'all_but_article_views' to allow displays of attachments only in article views. +(Omit quotes when entering the keyword options.) The Section/Category IDs +should be entered as numeric section and category IDs separated with a slash(/): +Section#/Category#, Section#/Category#. Specify just 'Section#' to cover all +Categories within the Section. Examples: 23/10, 23/11, 24 +
  • + +
  • Secure attachment downloads: By default, the 'Attachments' +extension saves attachment files in a publically accessible subdirectory. If you choose +the secure option, the directory in which the attachments are saved will be made +publically inaccessible. The download links for the attachments in the front end will +download the attachment files but will not be direct links. This will prevent access +unless users have appropriate permissions. If secure downloads are not selected, +the links to the attachments will be shown as the options above indicate, but the files +will still be accessible to anyone if they know the full URL, since the subdirectory is +public. The secure option prevents access to users without appropriate +permissions even if they know the full URL, since this option prevents public access +to the attachments subdirectory. + +
  • Download mode for secure downloads: +This option controls whether files should be downloaded as separate files or displayed +in the browser (if the browser can handle that type of file). There are two options: +
      +
    • 'inline': In this mode, files that can be displayed by the browser will be + displayed in the browser (such as text files and images).
    • +
    • 'attachment': With the 'attachment' mode, files will always be downloaded + as separate files.
    • +

    +In either case, files that can't be displayed in the browser will be +downloaded as external files. +
  • + +
+[Back to top] + +

Display Filename

+Normally, when files are uploaded and listed in a list of attachments, the full +filename is shown as a link to download the attachment. In some cases, the +filenames may be too long for this to work nicely. In the upload form, there is +another field called "Display Filename" in which the person uploading the file +can insert an alternative filename or label to display instead of the full filename. +For instance, some abbreviation of the filename could be added in this field. The +field may be edited in the administrative back end when attachments are edited. +Note: There is an option called "Maximum Filename Length" in the plugin options. +It can be set to automatically truncate uploaded displayed filenames; the +resulting truncated filename will be inserted into the "Display Filename" field. + +[Back to top] + +

CSS Styling of Attachment Lists

+The lists of attachments on the front end are done using a special +'div' that contains a table for the attachments. The table has +several different CSS classes associated with it to allow the website +developer the flexibility to customize the appearance of the table. Look in +the attachments plugin file CSS file (in plugins/content/attachments.css) for +examples. If you wish to change the style, consider copying the original +styles into the end of the same file and renaming 'attachmentsList' in the +copied section to something of your choice. Edit the Attachments parameter +(in the component manager) and change the parameter attachments table style +to the new class name. Then modify the class definitions in your copied section +appropriately. This approach will allow you to quickly revert to the original +style by changing the plugin parameter attachments table style back to +its default, 'attachmentList'. This also has the advantage that the +section of modified styles can be copied to a file and easily brought back in +when the version of Attachments is upgraded. This could also be done via a +CSS @import command. + +[Back to top] + +

File Type Icons

+The 'Attachments' extension adds an icon in front of each attachment in the +list of attachments. If you wish to add a new icon type, follow these steps: +(1) Add an appropriate icon in the directory 'media/attachments/icons', if an +appropriate icon is not already there; (2) Edit the file +'components/com_attachments/file_types.php' and add an appropriate line to the +static array $attachments_icon_from_file_extension which maps a file extension to an icon +name (all in the media/attachments/icons directory). If this does not work, +you may need to add an appropriate line to the array $attachments_icon_from_mime_type. (3) +Don't forget to make copies of the icon file and the updated file_types.php to +some directory outside of the website directories before upgrading the version +of Attachments in the future. + +[Back to top] + +

Warnings

+
    +
  • If you have attachment files that are sensitive or private, use the +Secure attachment downloads option!
    If you do not use the +secure option, the attachment files are saved in a public subdirectory +and are accessible to anyone that knows the full URL. The secure option +prevents access by anyone that does not have appropriate permissions (as determined +by the options above). See the discussion of the Secure attachment downloads +option above for more detail. +
  • + +
  • Every time a file is uploaded, the existence of the upload subdirectory +is checked and it will be created if if it does not exist. By default the +subdirectory for uploaded files is 'attachments' in the root directory of +your web site files. The name of the subdirectory can be changed using the +'Subdirectory for uploads' option. If the +'Attachments' extension is unable to create the subdirectory +for uploads, you must create it yourself (and you may have problems uploading +files). Make sure to give the subdirectory suitable permissions for uploading +files. In the Unix/Linux world, that is probably something like 775. Note +the process of creating the upload subdirectory may fail if the top level +directory of your website has permissions that prevent the webserver (and PHP) +from creating subdirectories. You may need to loosen the permissions +temporarily to allow the subdirectory to be created by uploading attachments. +
  • + +
  • If this extension does not permit you to upload specific types of files +(such as zip files), be aware that the extension respects the restrictions +placed by the Media Manager on types of files permitted to be uploaded. This +is to prevent uploading of potentially harmful types of files such as html or +php files. The administrator can update the Media Manager settings to add +specific file types by going to the "Global Settings" item under the "Site" +menu, selecting the "System" tab, and added the appropriate file extension and +Mime type to the lists under the "Media Manager" section. +
  • + +
  • The second plugin, 'add_attachment_btn_plugin' (called 'Button - AddAttachment' +in the plugin manager) allows attachments to be added to articles while they +are being edited in the article editor. This plugin adds a button just below +the article editing area labeled "Add Attachment". If you have installed this +plugin but do not see the button, the add attachment button plugin probably needs to +be enabled in the plugin editor. Note: Although the button displays when an +article is being created (before it is saved once), it is not usable and will +display a warning. Articles must exist (have an article ID) before files can +be attached to them. +
  • + +
  • If you cannot see the attachments in the front end, there are several possible reasons: +
      +
    • The 'Content - Attachments' plugin is not enabled. Use the plugin manager + to enable it.
    • +
    • The option 'Who can see attachments' is set to 'logged-in' and you are + not logged in. This can be changed via the Parameter editor in the + component manager.
    • +
    • In the 'Content - Attachments' (via the plugin manager), the access + level is not set to 'Public'.
    • +
    +
  • + +
  • If you encounter limits on the sizes of files that you attempt to upload, +try adding the following lines to the .htaccess file in the root of +your Joomla! website: +
    
    +  php_value upload_max_filesize 32M
    
    +  php_value post_max_size 32M
    
    +
    +where you may change the 32M (megabytes) value to whatever you wish as the maximum +upload file size. +
  • + +
  • There is help forum and a Frequently Asked Questions forum for the Attachments +extension that is hosted on the Joomlacode website. If you encounter a problem that +is not covered in this help page, please consult the forums: + +
  • + +
+[Back to top] + +

Upgrading

+If you have previously added attachments that you wish to preserve +through an upgrade, use these steps: +
    +
  1. [This step is optional but encouraged, to make sure you have +a backup of the attachments database in case something goes wrong.]
    +Use phpMyAdmin +(or other SQL editing tool) to save the contents +of the jos_attachments table (Use the 'Export' option with +'Complete' inserts for data (not 'Extended' inserts). You should also +back up the uploaded attachments files (usually in the 'attachments' +directory ) +
  2. + +
  3. Go to the Attachments manager in the administrative back end and +click on the item labelled 'Admin' on the right end of the toolbar. +Click on the command 'Disable uninstallation of MySQL Attachments Table'. +This disables the deletion of the attachments database table during +uninstallation of the attachments component. +
  4. + +
  5. Uninstall the 'Attachments' component.
  6. + +
  7. Uninstall all of the 'Attachments' plugins
  8. + +
  9. Now install the new release by unziping the release file and +installing all of the new plugins and then the component. +During the installation of the component, the attachments database +table will be updated automatically. +
  10. + +
  11. Reenable all of the 'Attachments' plugins.
  12. + +
  13. Your attachments should be available again. Go to the Attachments +manager in the administrative back end to verify that your attachments +are okay.
  14. + +
+

Note that uninstalling the 'Attachments' extension does not +delete the previously uploaded files, but it does remove the attachments +table in the database. So after reinstalling a new version of +'Attachments', it is only necessary to restore the attachments +table to restore all the old attachments.

+ +

+If you decide not to restore the attachments database, do not forget to delete any +obsolete uploaded files in the attachments subdirectory to avoid filename conflicts +in the future. [Back to top]

+ +

Acknowledgements

+Many thanks for the following contributors or resources: + +[Back to top] + +

Please report bugs and suggestions to jmcameron@jmcameron.net.

+ + diff --git a/oss/joomla/trunk/administrator/components/com_attachments/help/en-GB/index.html b/oss/joomla/trunk/administrator/components/com_attachments/help/en-GB/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/help/en-GB/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/help/index.html b/oss/joomla/trunk/administrator/components/com_attachments/help/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/help/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/index.html b/oss/joomla/trunk/administrator/components/com_attachments/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/install.attachments.php b/oss/joomla/trunk/administrator/components/com_attachments/install.attachments.php new file mode 100644 index 00000000..4a246def --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/install.attachments.php @@ -0,0 +1,92 @@ +RELEASE < 1.5 ) { + echo "

The 'Attachments' package will only work on Joomla version 1.5 or later!

"; + return false; + } + + echo "

Updating Attachments Table...

\n"; + require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_attachments'.DS.'update.php'); + AttachmentsUpdate::update_attachments_table(); + + // Check to see if the plugin has been installed yet + $plugin_installed = false; + $plugin_published = false; + $db =& JFactory::getDBO(); + $query = "SELECT published FROM #__plugins WHERE element='attachments' AND folder='content' LIMIT 1"; + $db->setQuery($query); + $rows = $db->loadObjectList(); + if ( count($rows) > 0 ) { + $plugin_installed = true; + $plugin_published = (intval($rows[0]->published) == 1); + } + + echo '
Attachments for articles component succesfully installed!
'; + + if ( $plugin_installed ) { + if ( !$plugin_published ) + echo "Don’t forget to enable the plugins!"; + } + else { + echo "Don’t forget to install the plugins too!"; + } + ?> +
+

NOTES:

+ +

+ Once the attachment plugins and component have been installed and the plugins are enabled, + the attachments should work. The default after installation is for the attachments to be + visible to anyone that is logged in and for the link to add attachments to visible only + to the author of the article. Both of these options can be changed via the attachments + parameters which can be changed in the component manager (go to the administrative back end, + select "Article Attachments" under the "Components" menu, and click on the Parameters + item on the toolbar). +

+ +

+ Once an attachment is uploaded, it is not visible until it is published. To do this go to the + administrative backend and select "Article Attachments" under the "Components" menu. This will + show a list of attachments and has controls to publish the attachments. The option to make + attachments automatically be published after they are uploaded can be changed via the Attachments + component manager. +

+ +

+ This extension respects the options in the Media Manager regarding what types of files can + be uploaded. If you can’t attach certain file types (such as zip files), go to the + "Global Configuration" item under the "Site" menu in the administrative backend. Click + on the "System" tab and look for the "Media Settings" section. You can add appropriate + file extensions or mime types there. +

+ +

+ Please see the help page for further details, including known limitations of this extension + and suggestions on how to upgrade this extension. To get to the help page, select + "Article Attachments" under the "Components" menu in the adminstrative backend. + Click on the help icon on the toolbar to bring up the help page. Or you may use this URL: + Help File (in English). +

+ +

+ Please report bugs and suggestions to jmcameron@jmcameron.net. +

+ \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/install.mysql.sql b/oss/joomla/trunk/administrator/components/com_attachments/install.mysql.sql new file mode 100644 index 00000000..ab9b7ee5 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/install.mysql.sql @@ -0,0 +1,22 @@ +CREATE TABLE IF NOT EXISTS `#__attachments` +( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `filename` VARCHAR(80) NOT NULL, + `filename_sys` VARCHAR(255) NOT NULL, + `file_type` VARCHAR(30) NOT NULL, + `file_size` INT(11) UNSIGNED NOT NULL, + `icon_filename` VARCHAR(20) NOT NULL, + `display_filename` VARCHAR(80) NOT NULL DEFAULT '', + `description` VARCHAR(255) NOT NULL DEFAULT '', + `url` VARCHAR(255) NOT NULL, + `uploader_id` INT(11) NOT NULL, + `article_id` INT(11) UNSIGNED NOT NULL, + `published` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + `user_field_1` VARCHAR(100) NOT NULL DEFAULT '', + `user_field_2` VARCHAR(100) NOT NULL DEFAULT '', + `user_field_3` VARCHAR(100) NOT NULL DEFAULT '', + `create_date` DATETIME DEFAULT NULL, + `modification_date` DATETIME DEFAULT NULL, + `download_count` INT(11) UNSIGNED DEFAULT '0', + PRIMARY KEY (`id`) +); diff --git a/oss/joomla/trunk/administrator/components/com_attachments/install.noutf8.sql b/oss/joomla/trunk/administrator/components/com_attachments/install.noutf8.sql new file mode 100644 index 00000000..cbc9d9fd --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/install.noutf8.sql @@ -0,0 +1,23 @@ +CREATE TABLE IF NOT EXISTS `#__attachments` +( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `filename` VARCHAR(240) NOT NULL, + `filename_sys` TEXT NOT NULL, + `file_type` VARCHAR(30) NOT NULL, + `file_size` INT(11) UNSIGNED NOT NULL, + `icon_filename` VARCHAR(60) NOT NULL, + `display_filename` VARCHAR(240) NOT NULL DEFAULT '', + `description` TEXT NOT NULL DEFAULT '', + `url` TEXT NOT NULL, + `uploader_id` INT(11) NOT NULL, + `article_id` INT(11) UNSIGNED NOT NULL, + `published` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + `user_field_1` TEXT NOT NULL DEFAULT '', + `user_field_2` TEXT NOT NULL DEFAULT '', + `user_field_3` TEXT NOT NULL DEFAULT '', + `create_date` DATETIME DEFAULT NULL, + `modification_date` DATETIME DEFAULT NULL, + `download_count` INT(11) UNSIGNED DEFAULT '0', + PRIMARY KEY (`id`) +); + diff --git a/oss/joomla/trunk/administrator/components/com_attachments/models/index.html b/oss/joomla/trunk/administrator/components/com_attachments/models/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/models/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/models/special.php b/oss/joomla/trunk/administrator/components/com_attachments/models/special.php new file mode 100644 index 00000000..0a42d8d5 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/models/special.php @@ -0,0 +1,53 @@ +loadByOption( 'com_attachments' ); + + // work out file path + if ($path = JRequest::getString( 'path' )) { + $path = JPath::clean( JPATH_SITE.DS.$path ); + JPath::check( $path ); + } else { + $option = preg_replace( '#\W#', '', $table->option ); + $path = JPATH_ADMINISTRATOR.DS.'components'.DS.$option.DS.'config.xml'; + } + + jimport('joomla.filesystem.file'); + if (JFile::exists( $path )) { + $instance = new JParameter( $table->params, $path ); + } else { + $instance = new JParameter( $table->params ); + } + } + return $instance; + } +} diff --git a/oss/joomla/trunk/administrator/components/com_attachments/tables/attachments.php b/oss/joomla/trunk/administrator/components/com_attachments/tables/attachments.php new file mode 100644 index 00000000..e8415d5a --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/tables/attachments.php @@ -0,0 +1,38 @@ + diff --git a/oss/joomla/trunk/administrator/components/com_attachments/tables/index.html b/oss/joomla/trunk/administrator/components/com_attachments/tables/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/tables/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/toolbar.attachments.html.php b/oss/joomla/trunk/administrator/components/com_attachments/toolbar.attachments.html.php new file mode 100644 index 00000000..e5cb7508 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/toolbar.attachments.html.php @@ -0,0 +1,52 @@ +[ '. $text.' ]', 'attachments.png' ); + + if ( $edit ) { + JToolBarHelper::save(); + JToolBarHelper::apply(); + // for existing attachments the button is renamed `close` + JToolBarHelper::cancel( 'cancel', 'Close' ); + } + else { + JToolBarHelper::save('saveNew', 'Save'); + JToolBarHelper::apply('applyNew', 'Apply'); + JToolBarHelper::cancel('myCancel', 'Cancel'); + } + } + + function _DEFAULT() + { + JToolBarHelper::title( JText::_( 'ARTICLE ATTACHMENTS' ), 'attachments'); + + JToolBarHelper::help('help', true); + JToolBarHelper::publishList(); + JToolBarHelper::unpublishList(); + JToolBarHelper::editListX(); + JToolBarHelper::addNewX(); + JToolBarHelper::deleteList(); + JToolBarHelper::preferences( 'com_attachments', $height='500', $width='800' ); + + // Add a button for extra admin commands + $bar = & JToolBar::getInstance('toolbar'); + $bar->appendButton( 'Popup', 'admin', $alt='ADMIN', + 'index.php?option=com_attachments&task=admin&tmpl=component', + $width='600', $height='450' ); + } +} +?> \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/toolbar.attachments.php b/oss/joomla/trunk/administrator/components/com_attachments/toolbar.attachments.php new file mode 100644 index 00000000..0f2b4273 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/toolbar.attachments.php @@ -0,0 +1,29 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/uninstall.attachments.php b/oss/joomla/trunk/administrator/components/com_attachments/uninstall.attachments.php new file mode 100644 index 00000000..cf2161b8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/uninstall.attachments.php @@ -0,0 +1,35 @@ +get('attachments_subdir', 'attachments'); + if ( $upload_subdir == '' ) { + $upload_subdir = "attachments"; + } + if ( !JFolder::exists( JPATH_BASE . $upload_subdir ) ) { + $upload_subdir = null; + } + + ?> +
The article attachments component is now removed from your system.
+ Don’t forget to remove the attachments plugins too!
+ You will also need to manually delete the attachments subdirectory: '" . $upload_subdir . "'\n"; + } +} +?> \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/uninstall.mysql.sql b/oss/joomla/trunk/administrator/components/com_attachments/uninstall.mysql.sql new file mode 100644 index 00000000..dbc9d677 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/uninstall.mysql.sql @@ -0,0 +1 @@ +DROP TABLE `#__attachments`; diff --git a/oss/joomla/trunk/administrator/components/com_attachments/update.php b/oss/joomla/trunk/administrator/components/com_attachments/update.php new file mode 100644 index 00000000..cb28f500 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/update.php @@ -0,0 +1,305 @@ +isAdmin() or die('Must be admin to execute!'); + +/** +* Attachments component +* @package Attachments +* @Copyright (C) 2007, 2008 Jonathan M. Cameron, All Rights Reserved +* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL +* @link http://joomlacode.org/gf/project/attachments/frs/ +* @author Jonathan M. Cameron +**/ + +/** + * A class for update functions + */ +class AttachmentsUpdate +{ + function add_icon_filenames() + { + require_once(JPATH_COMPONENT_SITE.DS.'file_types.php'); + + // Get all the attachment IDs + $db =& JFactory::getDBO(); + $query = "SELECT id, filename, file_type, icon_filename FROM #__attachments WHERE file_type IS NULL"; + $db->setQuery($query); + $rows = $db->loadObjectList(); + if ( count($rows) == 0 ) { + return 'No file_type fields need updating'; + } + $IDs = array(); + foreach ($rows as $row) { + $IDs[] = $row->id; + } + + // Update the icon file_types all the attachments (that do not have one already) + $row =& JTable::getInstance('Attachments', 'Table'); + $numUpdated = 0; + foreach ($IDs as $id) { + + $row->load($id); + + // Only update those attachment records that don't already have an icon_filename + if ( strlen( $row->icon_filename ) == 0 ) { + $new_icon_filename = AttachmentsFileTypes::icon_filename($row->filename, $row->file_type); + if ( strlen( $new_icon_filename) > 0 ) { + $row->icon_filename = $new_icon_filename; + if (!$row->store()) { + JError::raiseError(500, $row->getError()); + } + $numUpdated++; + } + } + } + + return JText::_('ADDED ICON FILENAMES TO') . " $numUpdated " . JText::_('ATTACHMENT S'); + } + + + function update_null_dates($redirect=true) + { + global $mainframe; + + // Get all the attachment IDs + $db =& JFactory::getDBO(); + $query = "SELECT * FROM #__attachments"; + $db->setQuery($query); + $rows = $db->loadObjectList(); + if ( count($rows) == 0 ) { + return 0; + } + + // Update the dates for all the attachments + $numUpdated = 0; + foreach ($rows as $row) { + + // Update the new create and update dates if they are null + $updated = false; + $create_date = $row->create_date; + if ( is_null($create_date) || $create_date == '' ) { + jimport( 'joomla.utilities.date' ); + $cdate = new JDate(filemtime($row->filename_sys), $mainframe->getCfg('offset')); + $create_date = $cdate->toMySQL(); + $updated = true; + } + $mod_date = $row->modification_date; + if ( is_null($mod_date) || $mod_date == '' ) { + jimport( 'joomla.utilities.date' ); + $mdate = new JDate(filemtime($row->filename_sys), $mainframe->getCfg('offset')); + $mod_date = $mdate->toMySQL(); + $updated = true; + } + + // Update the record + if ( $updated ) { + $query = "UPDATE #__attachments set modification_date='{$mod_date}', create_date='{$create_date}' WHERE id='{$row->id}'"; + $db->setQuery($query); + if (!$db->query()) { + echo "Error updating {$row->filename}: " . $db->stderr(); + } + $numUpdated++; + } + } + + return $numUpdated; + } + + + function update_attachments_table() + { + // NOTE: It should be harmless to run this function multiple times + + // Get the existing field names + $db =& JFactory::getDBO(); + $query = "explain #__attachments"; + $db->setQuery($query); + $rows = $db->loadObjectList(); + $fields = array(); + foreach ($rows as $row) { + $fields[] = $row->Field; + } + + // Define the columns/fields that may need to be added + $new_fields = Array(); + $new_fields['display_filename'] = + "ALTER TABLE #__attachments ADD `display_filename` VARCHAR(80) NOT NULL DEFAULT ''"; + $new_fields['user_field_1'] = + "ALTER TABLE #__attachments ADD `user_field_1` VARCHAR(100) NOT NULL DEFAULT ''"; + $new_fields['user_field_2'] = + "ALTER TABLE #__attachments ADD `user_field_2` VARCHAR(100) NOT NULL DEFAULT ''"; + $new_fields['user_field_3'] = + "ALTER TABLE #__attachments ADD `user_field_3` VARCHAR(100) NOT NULL DEFAULT ''"; + $new_fields['create_date'] = + "ALTER TABLE #__attachments ADD `create_date` DATETIME DEFAULT NULL"; + $new_fields['modification_date'] = + "ALTER TABLE #__attachments ADD `modification_date` DATETIME DEFAULT NULL"; + $new_fields['download_count'] = + "ALTER TABLE #__attachments ADD `download_count` INT(11) UNSIGNED DEFAULT '0'"; + + // See if we need to add specific fields + $num_fields_added = 0; + $dates_added = false; + foreach ($new_fields as $field => $query) { + if ( !in_array( $field , $fields ) ) { + echo "    Adding missing column '$field'
"; + $db->setQuery($query); + if (!$db->query()) { + JError::raiseError( 500, + "Error installing field " . $field . ": " . $db->stderr() ); + return false; + } + if ( $field == 'create_date' ) + $dates_added = true; + $num_fields_added++; + } + } + + if ( $num_fields_added != 0 ) + echo ""; + + if ( $dates_added ) { + echo "    Adding missing create/modification dates (using date each attachment file was created).
"; + require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_attachments'.DS.'update.php'); + $num = AttachmentsUpdate::update_null_dates(); + if ( $num == 0 ) + echo "       No attachments needed updating
"; + elseif ( $num == 1 ) + echo "       1 attachment updated
"; + else + echo "       $num attachments updated
"; + } + + // Get the existing indexed column names + $query = "show index from #__attachments"; + $db->setQuery($query); + $rows = $db->loadObjectList(); + $indexes = array(); + foreach ($rows as $row) { + $indexes[] = $row->Key_name; + } + + // Define the indexes that may need to get added + $new_indexes = Array(); + $new_indexes['attachment_article_id_index'] = + "CREATE INDEX attachment_article_id_index ON `#__attachments` (`article_id`)"; + /* These indeces do not add any benefit + See: http://dev.mysql.com/doc/refman/5.0/en/order-by-optimization.html + $new_indexes['attachment_filename_index'] = + "CREATE INDEX attachment_filename_index ON `#__attachments` (`filename`)"; + $new_indexes['attachment_file_size_index'] = + "CREATE INDEX attachment_file_size_index ON `#__attachments` (`file_size`)"; + $new_indexes['attachment_create_date_index'] = + "CREATE INDEX attachment_create_date_index ON `#__attachments` (`create_date`)"; + $new_indexes['attachment_modification_date_index'] = + "CREATE INDEX attachment_modification_date_index ON `#__attachments` (`modification_date`)"; + */ + + // Add any missing indexes + echo "
"; + $num_indexes_added = 0; + foreach ($new_indexes as $index => $query) { + if ( !in_array( $index , $indexes ) ) { + echo "    Adding index '$index'
"; + $db->setQuery($query); + if (!$db->query()) { + JError::raiseError( 500, "Error installing index " . $index . ": " . $db->stderr() ); + return false; + } + $num_indexes_added++; + } + } + echo "

The attachments table is now up to date.

\n"; + + return true; + } + + + function disable_sql_uninstall($dbtype = 'mysql') + { + jimport('joomla.filesystem.file'); + + // Construct the filenames + $filename = JPATH_COMPONENT_ADMINISTRATOR.DS."uninstall.$dbtype.sql"; + $tempfilename = $filename.'.tmp'; + $msg = ''; + + // Read the content of the old version of the unistall sql file + $contents = JFile::read($filename); + $lines = explode("\n", $contents); + $new_lines = Array(); + for ($i=0; $i < count($lines); $i++) { + $line = trim($lines[$i]); + if ( strlen($line) != 0 ) { + if ( $line[0] != '#' ) { + $line = '# ' . $line; + } + $new_lines[] = $line; + } + } + + // Overwrite the old file with a commented out version + $new_contents = implode("\n", $new_lines); + JFile::write($tempfilename, $new_contents); + if ( ! JFile::copy( $tempfilename, $filename) ) { + $msg = JText::_('ERROR UPDATING FILE') . ": $filename!"; + } + + // Let the user know what happened + if ( $msg == '' ) { + $msg = JText::_('DISABLED UNINSTALLING MYSQL ATTACHMENTS TABLE'); + } + return $msg; + } + + + function regenerate_system_filenames() + { + // Get the component parameters + jimport('joomla.application.component.helper'); + $params = JComponentHelper::getParams('com_attachments'); + + // Define where the attachments go + $upload_url = $params->get('attachments_subdir', 'attachments'); + $upload_dir = JPATH_SITE . DS . $upload_url; + + // Get all the attachment IDs + $db =& JFactory::getDBO(); + $query = "SELECT id FROM #__attachments"; + $db->setQuery($query); + $rows = $db->loadObjectList(); + if ( count($rows) == 0 ) { + return 'No records to update null dates for.'; + } + $IDs = array(); + foreach ($rows as $row) { + $IDs[] = $row->id; + } + + // Update the system filenames for all the attachments + $attachment =& JTable::getInstance('Attachments', 'Table'); + $numUpdated = 0; + foreach ($IDs as $id) { + + $attachment->load($id); + + // Construct the updated system filename + $filename_info = pathinfo($attachment->filename_sys); + $basename = $filename_info['basename']; + $filename_sys = $upload_dir.DS.$basename; + + $attachment->filename_sys = $filename_sys; + + // Update the record + if (!$attachment->store()) { + JError::raiseError(500, $attachment->getError()); + } + $numUpdated++; + } + + return JText::sprintf( 'UPDATED N ATTACHMENTS', $numUpdated ); + } + +} diff --git a/oss/joomla/trunk/administrator/components/com_attachments/views/index.html b/oss/joomla/trunk/administrator/components/com_attachments/views/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/views/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/views/special/index.html b/oss/joomla/trunk/administrator/components/com_attachments/views/special/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/views/special/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_attachments/views/special/view.php b/oss/joomla/trunk/administrator/components/com_attachments/views/special/view.php new file mode 100644 index 00000000..a453cf45 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_attachments/views/special/view.php @@ -0,0 +1,64 @@ +getModel(); + $params = &$model->getParams(); + +?> + + + + Edit Attachments Parameters + + + + +

Edit Attachments Parameters

+
+
+ +
+
+ + + + render();?> +
+ + + + + + + + +
+ + +authorize( 'com_banners', 'manage' )) { + $mainframe->redirect( 'index.php', JText::_('ALERTNOTAUTH') ); +} + +// Set the table directory +JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_banners'.DS.'tables'); + +$controllerName = JRequest::getCmd( 'c', 'banner' ); + +if($controllerName == 'client') { + JSubMenuHelper::addEntry(JText::_('Banners'), 'index.php?option=com_banners'); + JSubMenuHelper::addEntry(JText::_('Clients'), 'index.php?option=com_banners&c=client', true ); + JSubMenuHelper::addEntry(JText::_('Categories'), 'index.php?option=com_categories§ion=com_banner'); +} else { + JSubMenuHelper::addEntry(JText::_('Banners'), 'index.php?option=com_banners', true ); + JSubMenuHelper::addEntry(JText::_('Clients'), 'index.php?option=com_banners&c=client'); + JSubMenuHelper::addEntry(JText::_('Categories'), 'index.php?option=com_categories§ion=com_banner'); +} + +switch ($controllerName) +{ + default: + $controllerName = 'banner'; + // allow fall through + + case 'banner' : + case 'client': + // Temporary interceptor + $task = JRequest::getCmd('task'); + if ($task == 'listclients') { + $controllerName = 'client'; + } + + require_once( JPATH_COMPONENT.DS.'controllers'.DS.$controllerName.'.php' ); + $controllerName = 'BannerController'.$controllerName; + + // Create the controller + $controller = new $controllerName(); + + // Perform the Request task + $controller->execute( JRequest::getCmd('task') ); + + // Redirect if set by the controller + $controller->redirect(); + break; +} \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_banners/banners.xml b/oss/joomla/trunk/administrator/components/com_banners/banners.xml new file mode 100644 index 00000000..ee860619 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/banners.xml @@ -0,0 +1,12 @@ + + + Banners + Joomla! Project + April 2006 + Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. + http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL + admin@joomla.org + www.joomla.org + 1.5.0 + This component manages banners and banner clients + diff --git a/oss/joomla/trunk/administrator/components/com_banners/config.xml b/oss/joomla/trunk/administrator/components/com_banners/config.xml new file mode 100644 index 00000000..6e6976a5 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/config.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/oss/joomla/trunk/administrator/components/com_banners/controllers/banner.php b/oss/joomla/trunk/administrator/components/com_banners/controllers/banner.php new file mode 100644 index 00000000..cbb6bd11 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/controllers/banner.php @@ -0,0 +1,447 @@ +registerTask( 'add', 'edit' ); + $this->registerTask( 'apply', 'save' ); + $this->registerTask( 'resethits', 'save' ); + $this->registerTask( 'unpublish', 'publish' ); + } + + /** + * Display the list of banners + */ + function display() + { + global $mainframe; + + $db =& JFactory::getDBO(); + + $context = 'com_banners.banner.list.'; + $filter_order = $mainframe->getUserStateFromRequest( $context.'filter_order', 'filter_order', 'cc.title', 'cmd' ); + $filter_order_Dir = $mainframe->getUserStateFromRequest( $context.'filter_order_Dir', 'filter_order_Dir', '', 'word' ); + $filter_catid = $mainframe->getUserStateFromRequest( $context.'filter_catid', 'filter_catid', '', 'int' ); + $filter_state = $mainframe->getUserStateFromRequest( $context.'filter_state', 'filter_state', '', 'word' ); + $search = $mainframe->getUserStateFromRequest( $context.'search', 'search', '', 'string' ); + + $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); + $limitstart = $mainframe->getUserStateFromRequest( $context.'limitstart', 'limitstart', 0, 'int' ); + + $where = array(); + + if ( $filter_state ) + { + if ( $filter_state == 'P' ) { + $where[] = 'b.showBanner = 1'; + } + else if ($filter_state == 'U' ) { + $where[] = 'b.showBanner = 0'; + } + } + if ($filter_catid) { + $where[] = 'cc.id = ' . (int) $filter_catid; + } + if ($search) { + $where[] = 'LOWER(b.name) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); + } + + $where = count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : ''; + $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', b.ordering'; + + // get the total number of records + $query = 'SELECT COUNT(*)' + . ' FROM #__banner AS b' + . ' LEFT JOIN #__categories AS cc ON cc.id = b.catid' + . $where + ; + $db->setQuery( $query ); + $total = $db->loadResult(); + + jimport('joomla.html.pagination'); + $pageNav = new JPagination( $total, $limitstart, $limit ); + + $query = 'SELECT b.*, c.name AS client_name, cc.title AS category_name, u.name AS editor' + . ' FROM #__banner AS b' + . ' INNER JOIN #__bannerclient AS c ON c.cid = b.cid' + . ' LEFT JOIN #__categories AS cc ON cc.id = b.catid' + . ' LEFT JOIN #__users AS u ON u.id = b.checked_out' + . $where + . $orderby + ; + $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); + $rows = $db->loadObjectList(); + + // build list of categories + $javascript = 'onchange="document.adminForm.submit();"'; + $lists['catid'] = JHTML::_('list.category', 'filter_catid', 'com_banner', (int) $filter_catid, $javascript ); + + // state filter + $lists['state'] = JHTML::_('grid.state', $filter_state ); + + // table ordering + $lists['order_Dir'] = $filter_order_Dir; + $lists['order'] = $filter_order; + + // search filter + $lists['search']= $search; + + require_once(JPATH_COMPONENT.DS.'views'.DS.'banner.php'); + BannersViewBanner::banners( $rows, $pageNav, $lists ); + } + + function edit() + { + $db =& JFactory::getDBO(); + $user =& JFactory::getUser(); + + if ($this->_task == 'edit') { + $cid = JRequest::getVar('cid', array(0), 'method', 'array'); + $cid = array((int) $cid[0]); + } else { + $cid = array( 0 ); + } + + $option = JRequest::getCmd('option'); + + $lists = array(); + + $row =& JTable::getInstance('banner', 'Table'); + $row->load( $cid[0] ); + + if ($cid[0]) { + $row->checkout( $user->get('id') ); + } else { + $row->showBanner = 1; + } + + // Build Client select list + $sql = 'SELECT cid, name' + . ' FROM #__bannerclient' + ; + $db->setQuery($sql); + if (!$db->query()) + { + $this->setRedirect( 'index.php?option=com_banners' ); + return JError::raiseWarning( 500, $db->getErrorMsg() ); + } + + $banner_params = new JParameter( $row->params ); + $lists['width'] = $banner_params->get( 'width'); + $lists['height'] = $banner_params->get( 'height'); + + $clientlist[] = JHTML::_('select.option', '0', JText::_( 'Select Client' ), 'cid', 'name' ); + $clientlist = array_merge( $clientlist, $db->loadObjectList() ); + $lists['cid'] = JHTML::_('select.genericlist', $clientlist, 'cid', 'class="inputbox" size="1"','cid', 'name', $row->cid ); + + // Imagelist + $javascript = 'onchange="changeDisplayImage();"'; + $directory = '/images/banners'; + $lists['imageurl'] = JHTML::_('list.images', 'imageurl', $row->imageurl, $javascript, $directory, "bmp|gif|jpg|png|swf" ); + + // build list of categories + $lists['catid'] = JHTML::_('list.category', 'catid', 'com_banner', intval( $row->catid ) ); + + // sticky + $lists['sticky'] = JHTML::_('select.booleanlist', 'sticky', 'class="inputbox"', $row->sticky ); + + // published + $lists['showBanner'] = JHTML::_('select.booleanlist', 'showBanner', '', $row->showBanner ); + + require_once(JPATH_COMPONENT.DS.'views'.DS.'banner.php'); + BannersViewBanner::banner( $row, $lists ); + } + + /** + * Save method + */ + function save() + { + global $mainframe; + + // Check for request forgeries + JRequest::checkToken() or jexit( 'Invalid Token' ); + + $this->setRedirect( 'index.php?option=com_banners' ); + + // Initialize variables + $db =& JFactory::getDBO(); + + $post = JRequest::get( 'post' ); + // fix up special html fields + $post['custombannercode'] = JRequest::getVar( 'custombannercode', '', 'post', 'string', JREQUEST_ALLOWRAW ); + + $row =& JTable::getInstance('banner', 'Table'); + + // Save params temp fix + $temp1 = array(); + $temp2 = array(); + $temp1['width'] = (int) $post['width']; + $temp1['height'] = (int) $post['height']; + foreach ($temp1 as $k => $v) + { + if ( $k && strlen($v) ) + { + $temp2[] = $k.'='.$v; + } + } + $row->params = implode( "\n", $temp2 ); + + if (!$row->bind( $post )) { + return JError::raiseWarning( 500, $row->getError() ); + } + + // Resets clicks when `Reset Clicks` button is used instead of `Save` button + $task = JRequest::getCmd( 'task' ); + if ( $task == 'resethits' ) + { + $row->clicks = 0; + $msg = JText::_( 'Reset Banner clicks' ); + } + + // Sets impressions to unlimited when `unlimited` checkbox ticked + $unlimited = JRequest::getBool('unlimited'); + if ($unlimited) { + $row->imptotal = 0; + } + + if (!$row->check()) { + return JError::raiseWarning( 500, $row->getError() ); + } + + // if new item order last in appropriate group + if (!$row->bid) + { + $where = 'catid = '.(int) $row->catid; + $row->ordering = $row->getNextOrder( $where ); + } + + if (!$row->store()) { + return JError::raiseWarning( 500, $row->getError() ); + } + $row->checkin(); + + switch ($task) + { + case 'apply': + $link = 'index.php?option=com_banners&task=edit&cid[]='. $row->bid ; + break; + + case 'save': + default: + $link = 'index.php?option=com_banners'; + break; + } + + $this->setRedirect( $link, JText::_( 'Item Saved' ) ); + } + + function cancel() + { + // Check for request forgeries + JRequest::checkToken() or jexit( 'Invalid Token' ); + + $this->setRedirect( 'index.php?option=com_banners' ); + + // Initialize variables + $db =& JFactory::getDBO(); + $post = JRequest::get( 'post' ); + $row =& JTable::getInstance('banner', 'Table'); + $row->bind( $post ); + $row->checkin(); + } + + /** + * Copies one or more banners + */ + function copy() + { + // Check for request forgeries + JRequest::checkToken() or jexit( 'Invalid Token' ); + + $this->setRedirect( 'index.php?option=com_banners' ); + + $cid = JRequest::getVar( 'cid', null, 'post', 'array' ); + $db =& JFactory::getDBO(); + $table =& JTable::getInstance('banner', 'Table'); + $user = &JFactory::getUser(); + $n = count( $cid ); + + if ($n > 0) + { + foreach ($cid as $id) + { + if ($table->load( (int)$id )) + { + $table->bid = 0; + $table->name = 'Copy of ' . $table->name; + $table->impmade = 0; + $table->clicks = 0; + $table->showBanner = 0; + $table->date = $db->getNullDate(); + + if (!$table->store()) { + return JError::raiseWarning( $table->getError() ); + } + } + else { + return JError::raiseWarning( 500, $table->getError() ); + } + } + } + else { + return JError::raiseWarning( 500, JText::_( 'No items selected' ) ); + } + $this->setMessage( JText::sprintf( 'Items copied', $n ) ); + } + + function publish() + { + // Check for request forgeries + JRequest::checkToken() or jexit( 'Invalid Token' ); + + $this->setRedirect( 'index.php?option=com_banners' ); + + // Initialize variables + $db =& JFactory::getDBO(); + $user =& JFactory::getUser(); + $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); + $task = JRequest::getCmd( 'task' ); + $publish = ($task == 'publish'); + $n = count( $cid ); + + if (empty( $cid )) { + return JError::raiseWarning( 500, JText::_( 'No items selected' ) ); + } + + JArrayHelper::toInteger( $cid ); + $cids = implode( ',', $cid ); + + $query = 'UPDATE #__banner' + . ' SET showBanner = ' . (int) $publish + . ' WHERE bid IN ( '. $cids.' )' + . ' AND ( checked_out = 0 OR ( checked_out = ' .(int) $user->get('id'). ' ) )' + ; + $db->setQuery( $query ); + if (!$db->query()) { + return JError::raiseWarning( 500, $db->getError() ); + } + $this->setMessage( JText::sprintf( $publish ? 'Items published' : 'Items unpublished', $n ) ); + } + + function remove() + { + // Check for request forgeries + JRequest::checkToken() or jexit( 'Invalid Token' ); + + $this->setRedirect( 'index.php?option=com_banners' ); + + // Initialize variables + $db =& JFactory::getDBO(); + $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); + $n = count( $cid ); + JArrayHelper::toInteger( $cid ); + + if ($n) + { + $query = 'DELETE FROM #__banner' + . ' WHERE bid = ' . implode( ' OR bid = ', $cid ) + ; + $db->setQuery( $query ); + if (!$db->query()) { + JError::raiseWarning( 500, $db->getError() ); + } + } + + $this->setMessage( JText::sprintf( 'Items removed', $n ) ); + } + + /** + * Save the new order given by user + */ + function saveOrder() + { + // Check for request forgeries + JRequest::checkToken() or jexit( 'Invalid Token' ); + + $this->setRedirect( 'index.php?option=com_banners' ); + + // Initialize variables + $db =& JFactory::getDBO(); + $cid = JRequest::getVar( 'cid', array(), 'post', 'array' ); + $order = JRequest::getVar( 'order', array(), 'post', 'array' ); + $row =& JTable::getInstance('banner', 'Table'); + $total = count( $cid ); + $conditions = array(); + + if (empty( $cid )) { + return JError::raiseWarning( 500, JText::_( 'No items selected' ) ); + } + + // update ordering values + for ($i = 0; $i < $total; $i++) + { + $row->load( (int) $cid[$i] ); + if ($row->ordering != $order[$i]) + { + $row->ordering = $order[$i]; + if (!$row->store()) { + return JError::raiseError( 500, $db->getErrorMsg() ); + } + // remember to reorder this category + $condition = 'catid = '.(int) $row->catid; + $found = false; + foreach ($conditions as $cond) { + if ($cond[1] == $condition) + { + $found = true; + break; + } + } + if (!$found) { + $conditions[] = array ( $row->bid, $condition ); + } + } + } + + // execute reorder for each category + foreach ($conditions as $cond) + { + $row->load( $cond[0] ); + $row->reorder( $cond[1] ); + } + + // Clear the component's cache + $cache =& JFactory::getCache('com_banners'); + $cache->clean(); + + $this->setMessage( JText::_('New ordering saved') ); + } +} diff --git a/oss/joomla/trunk/administrator/components/com_banners/controllers/client.php b/oss/joomla/trunk/administrator/components/com_banners/controllers/client.php new file mode 100644 index 00000000..70229d6d --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/controllers/client.php @@ -0,0 +1,213 @@ +registerTask( 'add', 'edit' ); + $this->registerTask( 'apply', 'save' ); + } + + function display() + { + global $mainframe; + + $db =& JFactory::getDBO(); + $user =& JFactory::getUser(); + $context = 'com_banners.bannerclient.list.'; + $filter_order = $mainframe->getUserStateFromRequest( $context.'filter_order', 'filter_order', 'a.name', 'cmd' ); + $filter_order_Dir = $mainframe->getUserStateFromRequest( $context.'filter_order_Dir', 'filter_order_Dir', '', 'word' ); + $search = $mainframe->getUserStateFromRequest( $context.'search', 'search', '', 'string' ); + $search = JString::strtolower( $search ); + + $limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' ); + $limitstart = $mainframe->getUserStateFromRequest( $context.'limitstart', 'limitstart', 0, 'int' ); + + $where = array(); + + if ($search) { + $where[] = 'LOWER(a.name) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false ); + } + + $where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' ); + $orderby = ' ORDER BY '. $filter_order .' '. $filter_order_Dir .', a.cid'; + + // get the total number of records + $query = 'SELECT a.*, count(b.bid) AS nbanners, u.name AS editor' + . ' FROM #__bannerclient AS a' + . ' LEFT JOIN #__banner AS b ON a.cid = b.cid' + . ' LEFT JOIN #__users AS u ON u.id = a.checked_out' + . $where + . ' GROUP BY a.cid' + . $orderby + ; + + $db->setQuery( $query ); + $db->query(); + $total = $db->getNumRows(); + + jimport('joomla.html.pagination'); + $pageNav = new JPagination( $total, $limitstart, $limit ); + + $db->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); + $rows = $db->loadObjectList(); + + // table ordering + $lists['order_Dir'] = $filter_order_Dir; + $lists['order'] = $filter_order; + + // search filter + $lists['search']= $search; + + require_once(JPATH_COMPONENT.DS.'views'.DS.'client.php'); + BannersViewClients::clients( $rows, $pageNav, $lists ); + } + + /** + * Edit a banner client record + */ + function edit() + { + // Initialize variables + $db =& JFactory::getDBO(); + $user =& JFactory::getUser(); + + $userId = $user->get ( 'id' ); + + if ($this->_task == 'edit') { + $cid = JRequest::getVar('cid', array(0), 'method', 'array'); + } else { + $cid = array( 0 ); + } + + $row =& JTable::getInstance('bannerclient', 'Table'); + $row->load( (int) $cid[0] ); + + // fail if checked out not by 'me' + if ($row->isCheckedOut( $userId )) { + $this->setRedirect( 'index.php?option=com_banners&c=client' ); + return JError::raiseWarning( JText::sprintf( 'WARNEDITEDBYPERSON', $row->name ) ); + } + + if ($row->cid) { + // do stuff for existing record + $row->checkout( $userId ); + } else { + // do stuff for new record + $row->published = 0; + $row->approved = 0; + } + + require_once(JPATH_COMPONENT.DS.'views'.DS.'client.php'); + BannersViewClients::client( $row ); + } + + function save() + { + // Check for request forgeries + JRequest::checkToken() or jexit( 'Invalid Token' ); + + $this->setRedirect( 'index.php?option=com_banners&c=client' ); + + // Initialize variables + $db =& JFactory::getDBO(); + $table =& JTable::getInstance('bannerclient', 'Table'); + + if (!$table->bind( JRequest::get( 'post' ) )) { + return JError::raiseWarning( 500, $table->getError() ); + } + if (!$table->check()) { + return JError::raiseWarning( 500, $table->getError() ); + } + if (!$table->store()) { + return JError::raiseWarning( 500, $table->getError() ); + } + $table->checkin(); + + switch (JRequest::getCmd( 'task' )) + { + case 'apply': + $this->setRedirect( 'index.php?option=com_banners&c=client&task=edit&cid[]='. $table->cid ); + break; + } + + $this->setMessage( JText::_( 'Item Saved' ) ); + } + + function cancel() + { + // Check for request forgeries + JRequest::checkToken() or jexit( 'Invalid Token' ); + + $this->setRedirect( 'index.php?option=com_banners&c=client' ); + + // Initialize variables + $db =& JFactory::getDBO(); + $table =& JTable::getInstance('bannerclient', 'Table'); + $table->cid = JRequest::getVar( 'cid', 0, 'post', 'int' ); + $table->checkin(); + } + + function remove() + { + // Check for request forgeries + JRequest::checkToken() or jexit( 'Invalid Token' ); + + $this->setRedirect( 'index.php?option=com_banners&c=client' ); + + // Initialize variables + $db =& JFactory::getDBO(); + $cid = JRequest::getVar( 'cid', array(0), 'post', 'array' ); + $table =& JTable::getInstance('bannerclient', 'Table'); + $n = count( $cid ); + + for ($i = 0; $i < $n; $i++) + { + $query = 'SELECT COUNT( bid )' + . ' FROM #__banner' + . ' WHERE cid = '. (int) $cid[$i] + ; + $db->setQuery($query); + $count = $db->loadResult(); + if ($count === null) { + return JError::raiseWarning( 500, $db->getErrorMsg() ); + } + else if ($count > 0) { + return JError::raiseWarning( 500, JText::_( 'WARNCANNOTDELCLIENTBANNER' ) ); + } + else { + if (!$table->delete( (int) $cid[$i] )) { + return JError::raiseWarning( 500, $table->getError() ); + } + } + } + + $this->setMessage( JText::sprintf( 'Items removed', $n ) ); + } +} \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_banners/controllers/index.html b/oss/joomla/trunk/administrator/components/com_banners/controllers/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/controllers/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_banners/elements/bannerclient.php b/oss/joomla/trunk/administrator/components/com_banners/elements/bannerclient.php new file mode 100644 index 00000000..8662a2de --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/elements/bannerclient.php @@ -0,0 +1,49 @@ +setQuery($query); + $options = $db->loadObjectList(); + array_unshift($options, JHTML::_('select.option', '0', '- '.JText::_('Select Client').' -', 'cid', 'name')); + + return JHTML::_('select.genericlist', $options, ''.$control_name.'['.$name.']', 'class="inputbox"', 'cid', 'name', $value, $control_name.$name ); + } +} diff --git a/oss/joomla/trunk/administrator/components/com_banners/elements/index.html b/oss/joomla/trunk/administrator/components/com_banners/elements/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/elements/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_banners/helpers/banner.php b/oss/joomla/trunk/administrator/components/com_banners/helpers/banner.php new file mode 100644 index 00000000..af5dfc5a --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/helpers/banner.php @@ -0,0 +1,81 @@ +get( 'tag_prefix' ); + + $instance = array(); + + if (!is_array( $keywords )) + { + $keywords = explode( ',', $keywords ); + } + + foreach ($keywords as $keyword) + { + $keyword = trim( $keyword ); + $regex = '#^' . $prefix . '#'; + if (preg_match( $regex, $keyword )) + { + $instance[] = $keyword; + } + } + } + return $instance; + } + + /** + * Checks if a URL is an image + * + * @param string + * @return URL + */ + function isImage( $url ) + { + $result = preg_match( '#(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$#i', $url ); + return $result; + } + + /** + * Checks if a URL is a Flash file + * + * @param string + * @return URL + */ + function isFlash( $url ) + { + $result = preg_match( '#\.swf$#i', $url ); + return $result; + } +} +?> \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_banners/helpers/index.html b/oss/joomla/trunk/administrator/components/com_banners/helpers/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/helpers/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_banners/index.html b/oss/joomla/trunk/administrator/components/com_banners/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_banners/tables/banner.php b/oss/joomla/trunk/administrator/components/com_banners/tables/banner.php new file mode 100644 index 00000000..c9e90eec --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/tables/banner.php @@ -0,0 +1,131 @@ +set( 'date', $now->toMySQL() ); + } + + function clicks() + { + $query = 'UPDATE #__banner' + . ' SET clicks = ( clicks + 1 )' + . ' WHERE bid = ' . (int) $this->bid + ; + $this->_db->setQuery( $query ); + $this->_db->query(); + } + + /** + * Overloaded check function + * + * @access public + * @return boolean + * @see JTable::check + * @since 1.5 + */ + function check() + { + // check for valid client id + if (is_null($this->cid) || $this->cid == 0) { + $this->setError(JText::_( 'BNR_CLIENT' )); + return false; + } + + // check for valid name + if(trim($this->name) == '') { + $this->setError(JText::_( 'BNR_NAME' )); + return false; + } + + if(empty($this->alias)) { + $this->alias = $this->name; + } + $this->alias = JFilterOutput::stringURLSafe($this->alias); + + /*if(trim($this->imageurl) == '') { + $this->setError(JText::_( 'BNR_IMAGE' )); + return false; + } + if(trim($this->clickurl) == '' && trim($this->custombannercode) == '') { + $this->setError(JText::_( 'BNR_URL' )); + return false; + }*/ + + return true; + } +} +?> diff --git a/oss/joomla/trunk/administrator/components/com_banners/tables/bannerclient.php b/oss/joomla/trunk/administrator/components/com_banners/tables/bannerclient.php new file mode 100644 index 00000000..3c28a11e --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/tables/bannerclient.php @@ -0,0 +1,68 @@ +name == '')) { + $this->setError(JText::_( 'BNR_CLIENT_NAME' )); + return false; + } + + // check for valid client contact + if (trim($this->contact == '')) { + $this->setError(JText::_( 'BNR_CONTACT' )); + return false; + } + + // check for valid client email + jimport( 'joomla.mail.helper' ); + if (!JMailHelper::isEmailAddress( $this->email )) { + $this->setError(JText::_( 'BNR_VALID_EMAIL' )); + return false; + } + + return true; + } +} diff --git a/oss/joomla/trunk/administrator/components/com_banners/tables/index.html b/oss/joomla/trunk/administrator/components/com_banners/tables/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/tables/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_banners/views/banner.php b/oss/joomla/trunk/administrator/components/com_banners/views/banner.php new file mode 100644 index 00000000..04dcf050 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_banners/views/banner.php @@ -0,0 +1,473 @@ + +
+ + + + + +
+ : + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + id = $row->bid; + $link = JRoute::_( 'index.php?option=com_banners&task=edit&cid[]='. $row->id ); + + if( $row->imptotal <= 0 ) { + $row->imptotal = JText::_('unlimited'); + } + + if ( $row->impmade != 0 ) { + $percentClicks = 100 * $row->clicks/$row->impmade; + } else { + $percentClicks = 0; + } + + $row->published = $row->showBanner; + $published = JHTML::_('grid.published', $row, $i ); + $checked = JHTML::_('grid.checkedout', $row, $i ); + ?> + "> + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ getListFooter(); ?> +
+ getRowOffset($i); ?> + + + + + get ('id'), $row->checked_out ) ) { + echo $row->name; + } else { + ?> + + + name; ?> + + + + client_name;?> + + category_name;?> + + + + + class="text_area" style="text-align: center" /> + + sticky ? JText::_( 'Yes' ) : JText::_( 'No' );?> + + impmade.' '.JText::_('of').' '.$row->imptotal?> + + clicks;?> - + + + tags; ?> + + id; ?> +
+ + + + + + + + +
+ [ '. JText::_( 'New' ) .' ]' : JText::_( 'Banner' ) . ': [ '. JText::_( 'Edit' ) .' ]', 'generic.png' ); + JToolBarHelper::save( 'save' ); + JToolBarHelper::apply('apply'); + JToolBarHelper::cancel( 'cancel' ); + JToolBarHelper::help( 'screen.banners.edit' ); + } + + function banner( &$row, &$lists ) + { + BannersViewBanner::setBannerToolbar(); + JRequest::setVar( 'hidemainmenu', 1 ); + JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'custombannercode' ); + ?> + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + imptotal == 0) { + $unlimited = 'checked="checked"'; + $row->imptotal = ''; + } + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ : + + +
+ : + + +
+ + + +
+ + + +
+ + + +
+ + + +      + + /> +
+ + + +
+ : + + clicks;?> +      + +
+ + + +
+ + + +
+
+ + + +
+ + + +
+ + + +
+ : + + imageurl)) { + ?> + + + + imageurl)) { + ?> + + + + +
+ + + +
+
+
+
+ + + + + + + + +
+ +
+ + + + + + +
+ : + + + + +
+ + + + + + + + + + + + + + + + + + + id = $row->cid; + $link = JRoute::_( 'index.php?option=com_banners&c=client&task=edit&cid[]='. $row->id ); + + $checked = JHTML::_('grid.checkedout', $row, $i ); + ?> + "> + + + + + + + + + +
+ + + + + + + + + + + +
+ getListFooter(); ?> +
+ getRowOffset( $i ); ?> + + + + get ('id'), $row->checked_out ) ) { + echo $row->name; + } else { + ?> + + + name; ?> + + + + contact; ?> + + nbanners;?> + + cid; ?> +
+ + + + + + + + +
+ [ '. JText::_( 'New' ) .' ]' : JText::_( 'Banner Client' ) . ': [ '. JText::_( 'Edit' ) .' ]', 'generic.png' ); + JToolBarHelper::save( 'save' ); + JToolBarHelper::apply('apply'); + JToolBarHelper::cancel( 'cancel' ); + JToolBarHelper::help( 'screen.banners.client.edit' ); + } + + function client( &$row ) + { + BannersViewClients::setClientToolbar(); + JRequest::setVar( 'hidemainmenu', 1 ); + JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'extrainfo' ); + ?> + + +
+ +
+
+ + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+
+
+ +
+
+ + + + + + +
+ +
+
+
+
+ + + + + + + +
+ \ No newline at end of file