diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-07 12:13:19 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-07 12:13:19 +0000 |
commit | 5991e7a915191a0d7655b51794dfdc1ac05ce5d7 (patch) | |
tree | 70ac65a6211afee57892e2fb6753e0383e3a72e1 | |
parent | 63d3c9f46ecb5ebc81f095b63045d44ad3aec2d8 (diff) | |
download | elgg-5991e7a915191a0d7655b51794dfdc1ac05ce5d7.tar.gz elgg-5991e7a915191a0d7655b51794dfdc1ac05ce5d7.tar.bz2 |
added support for confirm text to ElggMenuItem
git-svn-id: http://code.elgg.org/elgg/trunk@8621 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/classes/ElggMenuItem.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php index 0204a85c7..0538ed64c 100644 --- a/engine/classes/ElggMenuItem.php +++ b/engine/classes/ElggMenuItem.php @@ -24,6 +24,11 @@ class ElggMenuItem { protected $href = null; /** + * @var string The string to display if link is clicked + */ + protected $confirm = ''; + + /** * @var array Classes to apply to the anchor tag. */ protected $linkClass = array(); @@ -249,6 +254,26 @@ class ElggMenuItem { } /** + * Set the confirm text shown when link is clicked + * + * @param string $text The text to show + * + * @return void + */ + public function setConfirmText($text) { + $this->confirm = $text; + } + + /** + * Get the confirm text + * + * @return string + */ + public function getConfirmText() { + return $this->confirm; + } + + /** * Set the anchor class * * @param mixed $class An array of class names, or a single string class name. @@ -444,6 +469,11 @@ class ElggMenuItem { $vars['is_action'] = $this->is_action; } + if ($this->confirm) { + $vars['confirm'] = $this->confirm; + return elgg_view('output/confirmlink', $vars); + } + return elgg_view('output/url', $vars); } } |