*/
protected $href = null;
+ /**
+ * @var string The string to display if link is clicked
+ */
+ protected $confirm = '';
+
/**
* @var array Classes to apply to the anchor tag.
*/
return $this->title;
}
+ /**
+ * 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
*
$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);
}
}