aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-04 15:03:03 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-04 15:03:03 +0000
commit43571d4d5381cc3e2a8ba3e05da6cb6982a1d960 (patch)
treeda27c4d097a784fa9cbfa410d57e0709e0c4afb7
parent36f52b47f8dc996afcc889b1fd32fd23943103c5 (diff)
downloadelgg-43571d4d5381cc3e2a8ba3e05da6cb6982a1d960.tar.gz
elgg-43571d4d5381cc3e2a8ba3e05da6cb6982a1d960.tar.bz2
Fixes #199
git-svn-id: https://code.elgg.org/elgg/trunk@1682 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--actions/entities/delete.php32
-rw-r--r--languages/en.php15
-rw-r--r--views/default/group/default.php14
-rw-r--r--views/default/object/default.php48
-rw-r--r--views/default/site/default.php4
5 files changed, 108 insertions, 5 deletions
diff --git a/actions/entities/delete.php b/actions/entities/delete.php
new file mode 100644
index 000000000..223e5557d
--- /dev/null
+++ b/actions/entities/delete.php
@@ -0,0 +1,32 @@
+<?php
+ /**
+ * Default entity delete action
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+ gatekeeper();
+
+ $guid = get_input('guid');
+
+ $entity = get_entity($guid);
+
+ if (($entity) && ($entity->canEdit()))
+ {
+ if ($entity->delete())
+ system_message(sprintf(elgg_echo('entity:delete:success'), $guid));
+ else
+ register_error(sprintf(elgg_echo('entity:delete:fail'), $guid));
+ }
+ else
+ register_error(sprintf(elgg_echo('entity:delete:fail'), $guid));
+
+ forward($_SERVER['HTTP_REFERER']);
+?> \ No newline at end of file
diff --git a/languages/en.php b/languages/en.php
index 8ead8eb40..b0f77eb49 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -428,7 +428,9 @@
'makeadmin' => "Make admin",
'option:yes' => "Yes",
- 'option:no' => "No",
+ 'option:no' => "No",
+
+ 'unknown' => 'Unknown',
/**
* Generic data words
@@ -629,7 +631,16 @@ To view %s's profile, click here:
%s
-You cannot reply to this email.",
+You cannot reply to this email.",
+
+ /**
+ * Entities
+ */
+ 'entity:default:strapline' => 'Created %s by %s',
+ 'entity:default:missingsupport:popup' => 'This entity cannot be displayed correctly. This may be because it requires support provided by a plugin that is no longer installed.',
+
+ 'entity:delete:success' => 'Entity %s has been deleted',
+ 'entity:delete:fail' => 'Entity %s could not be deleted',
/**
* Languages according to ISO 639-1
diff --git a/views/default/group/default.php b/views/default/group/default.php
new file mode 100644
index 000000000..e867035e0
--- /dev/null
+++ b/views/default/group/default.php
@@ -0,0 +1,14 @@
+<?php
+ /**
+ * ElggGroup default view.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ */
+
+ echo elgg_view('object/default', $vars);
+?> \ No newline at end of file
diff --git a/views/default/object/default.php b/views/default/object/default.php
index 93dd2ca94..c38b243ec 100644
--- a/views/default/object/default.php
+++ b/views/default/object/default.php
@@ -10,5 +10,51 @@
* @link http://elgg.org/
*/
- echo elgg_view('export/entity', $vars);
+ if ($vars['full']) {
+ echo elgg_view('export/entity', $vars);
+ } else {
+
+ $icon = elgg_view(
+ 'graphics/icon', array(
+ 'entity' => $vars['entity'],
+ 'size' => 'small',
+ )
+ );
+
+
+ $title = $vars['entity']->title;
+ if (!$title) $title = $vars['entity']->name;
+ if (!$title) $title = get_class($vars['entity']);
+
+ $controls = "";
+ if ($vars['entity']->canEdit())
+ {
+ $controls .= " (<a href=\"{$vars['url']}actions/entities/delete?guid={$vars['entity']->guid}\">" . elgg_echo('delete') . "</a>)";
+ }
+
+ $info = "<div><p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $title . "</a></b> $controls </p></div>";
+
+ if (get_input('search_viewtype') == "gallery") {
+
+ $icon = "";
+
+ }
+
+ $owner = $vars['entity']->getOwnerEntity();
+ $ownertxt = elgg_echo('unknown');
+ if ($owner)
+ "<a href=\"" . $owner->getURL() . "\">" . $owner->name ."</a>";
+
+ $info .= "<div>".sprintf(elgg_echo("entity:default:strapline"),
+ friendly_time($vars['entity']->time_created),
+ $ownertxt
+ );
+
+ $info .= "</div>";
+
+ $info = "<span title=\"" . elgg_echo('entity:default:missingsupport:popup') . "\">$info</span>";
+ $icon = "<span title=\"" . elgg_echo('entity:default:missingsupport:popup') . "\">$icon</span>";
+
+ echo elgg_view_listing($icon, $info);
+ }
?> \ No newline at end of file
diff --git a/views/default/site/default.php b/views/default/site/default.php
index 93dd2ca94..d3fc47bbb 100644
--- a/views/default/site/default.php
+++ b/views/default/site/default.php
@@ -1,6 +1,6 @@
<?php
/**
- * ElggEntity default view.
+ * ElggSite default view.
*
* @package Elgg
* @subpackage Core
@@ -10,5 +10,5 @@
* @link http://elgg.org/
*/
- echo elgg_view('export/entity', $vars);
+ echo elgg_view('object/default', $vars);
?> \ No newline at end of file