aboutsummaryrefslogtreecommitdiff
path: root/mod/file/views
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-31 14:47:38 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-31 14:47:38 +0000
commit24ef7261d523155ee1c58e8297516e726b4ce80b (patch)
treedfdb6b1ef7be64237e19b70d7954f149789a72f7 /mod/file/views
parentb4bd662414f2d49f238bf0fabf05878d9d967877 (diff)
downloadelgg-24ef7261d523155ee1c58e8297516e726b4ce80b.tar.gz
elgg-24ef7261d523155ee1c58e8297516e726b4ce80b.tar.bz2
a little standardization of the file plugin code
git-svn-id: http://code.elgg.org/elgg/trunk@7789 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/file/views')
-rw-r--r--mod/file/views/default/file/upload.php66
-rw-r--r--mod/file/views/default/widgets/filerepo/content.php1
-rw-r--r--mod/file/views/rss/object/file.php41
3 files changed, 51 insertions, 57 deletions
diff --git a/mod/file/views/default/file/upload.php b/mod/file/views/default/file/upload.php
index 0ef99348c..041bd9227 100644
--- a/mod/file/views/default/file/upload.php
+++ b/mod/file/views/default/file/upload.php
@@ -1,40 +1,40 @@
<?php
- /**
- * Elgg file browser uploader
- *
- * @package ElggFile
- */
+/**
+ * Elgg file browser uploader
+ *
+ * @package ElggFile
+ */
- global $CONFIG;
+global $CONFIG;
- if (isset($vars['entity'])) {
- $action_type = "update";
- $action = "file/upload";
- $title = $vars['entity']->title;
- $description = $vars['entity']->description;
- $tags = $vars['entity']->tags;
- $access_id = $vars['entity']->access_id;
- $container_guid = $vars['entity']->container_guid;
- } else {
- $action_type = "new";
- $action = "file/upload";
- $title = isset($_SESSION['uploadtitle']) ? $_SESSION['uploadtitle'] : '';
- $description = isset($_SESSION['uploaddesc']) ? $_SESSION['uploaddesc'] : '';
- $tags = isset($_SESSION['uploadtags']) ? $_SESSION['uploadtags'] : '';
- if (defined('ACCESS_DEFAULT')) {
- $access_id = ACCESS_DEFAULT;
- } else {
- $access_id = 0;
- }
- $access_id = isset($_SESSION['uploadaccessid']) ? $_SESSION['uploadaccessid'] : $access_id;
- $container_guid = elgg_get_page_owner_guid();
+if (isset($vars['entity'])) {
+ $action_type = "update";
+ $action = "file/upload";
+ $title = $vars['entity']->title;
+ $description = $vars['entity']->description;
+ $tags = $vars['entity']->tags;
+ $access_id = $vars['entity']->access_id;
+ $container_guid = $vars['entity']->container_guid;
+} else {
+ $action_type = "new";
+ $action = "file/upload";
+ $title = isset($_SESSION['uploadtitle']) ? $_SESSION['uploadtitle'] : '';
+ $description = isset($_SESSION['uploaddesc']) ? $_SESSION['uploaddesc'] : '';
+ $tags = isset($_SESSION['uploadtags']) ? $_SESSION['uploadtags'] : '';
+ if (defined('ACCESS_DEFAULT')) {
+ $access_id = ACCESS_DEFAULT;
+ } else {
+ $access_id = 0;
}
-
- // make sure session cache is cleared
- unset($_SESSION['uploadtitle']);
- unset($_SESSION['uploaddesc']);
- unset($_SESSION['uploadtags']);
- unset($_SESSION['uploadaccessid']);
+ $access_id = isset($_SESSION['uploadaccessid']) ? $_SESSION['uploadaccessid'] : $access_id;
+ $container_guid = elgg_get_page_owner_guid();
+}
+
+// make sure session cache is cleared
+unset($_SESSION['uploadtitle']);
+unset($_SESSION['uploaddesc']);
+unset($_SESSION['uploadtags']);
+unset($_SESSION['uploadaccessid']);
?>
diff --git a/mod/file/views/default/widgets/filerepo/content.php b/mod/file/views/default/widgets/filerepo/content.php
index ee7bbe3cc..130b5e3de 100644
--- a/mod/file/views/default/widgets/filerepo/content.php
+++ b/mod/file/views/default/widgets/filerepo/content.php
@@ -68,4 +68,3 @@ if ($files) {
echo "<p class='margin-top'>" . elgg_echo("file:none") . "</p>";
}
-?> \ No newline at end of file
diff --git a/mod/file/views/rss/object/file.php b/mod/file/views/rss/object/file.php
index 52d26382f..a0660d6c8 100644
--- a/mod/file/views/rss/object/file.php
+++ b/mod/file/views/rss/object/file.php
@@ -1,26 +1,21 @@
<?php
-
- /**
- * Elgg RSS file object view
- *
- * @package ElggFile
- * @subpackage Core
- */
-
- $title = $vars['entity']->title;
- if (empty($title)) {
- $title = substr($vars['entity']->description,0,32);
- if (strlen($vars['entity']->description) > 32)
- $title .= " ...";
- }
-
+/**
+ * Elgg RSS file object view
+ *
+ * @package ElggFile
+ * @subpackage Core
+ */
+$title = $vars['entity']->title;
+if (empty($title)) {
+ $title = elgg_get_excerpt($vars['entity']->description, 32);
+}
?>
- <item>
- <guid isPermaLink='true'><?php echo $vars['entity']->getURL(); ?></guid>
- <pubDate><?php echo date("r",$vars['entity']->time_created) ?></pubDate>
- <link><?php echo $vars['entity']->getURL(); ?></link>
- <title><![CDATA[<?php echo $title; ?>]]></title>
- <description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
- <enclosure url="<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $vars['entity']->getGUID(); ?>" length="<?php echo $vars['entity']->size(); ?>" type="<?php echo $vars['entity']->getMimeType(); ?>" />
- </item>
+<item>
+ <guid isPermaLink='true'><?php echo $vars['entity']->getURL(); ?></guid>
+ <pubDate><?php echo date("r", $vars['entity']->time_created) ?></pubDate>
+ <link><?php echo $vars['entity']->getURL(); ?></link>
+ <title><![CDATA[<?php echo $title; ?>]]></title>
+ <description><![CDATA[<?php echo (autop($vars['entity']->description)); ?>]]></description>
+ <enclosure url="<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $vars['entity']->getGUID(); ?>" length="<?php echo $vars['entity']->size(); ?>" type="<?php echo $vars['entity']->getMimeType(); ?>" />
+</item>