diff options
author | Meitar Moscovitz <meitarm@gmail.com> | 2009-02-12 02:27:13 +1100 |
---|---|---|
committer | Meitar Moscovitz <meitarm@gmail.com> | 2009-02-12 02:27:13 +1100 |
commit | 2fb8c58c84ef02766364e605d28ecaf90c5fc25f (patch) | |
tree | fb72cc6b535478800bbf9e8432cd047f6be6d788 /actions | |
parent | b240a1719485b15c4a6497b6053c24e8a40a4e3c (diff) | |
parent | 27e23f2dd3e071712dc9d4765beaa33b57150fe0 (diff) |
Merge branch 'dev-0.7.x' into link-rel-paginate
Diffstat (limited to 'actions')
-rw-r--r-- | actions/avatarsettings.php | 26 | ||||
-rw-r--r-- | actions/doc.php | 12 | ||||
-rw-r--r-- | actions/noticesearch.php | 76 |
3 files changed, 88 insertions, 26 deletions
diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php index 7dd53f6eb..f38a44a24 100644 --- a/actions/avatarsettings.php +++ b/actions/avatarsettings.php @@ -145,6 +145,7 @@ class AvatarsettingsAction extends AccountSettingsAction 'height' => AVATAR_PROFILE_SIZE, 'alt' => $user->nickname)); $this->elementEnd('div'); + $this->submit('delete', _('Delete')); $this->elementEnd('li'); } @@ -256,6 +257,8 @@ class AvatarsettingsAction extends AccountSettingsAction $this->uploadAvatar(); } else if ($this->arg('crop')) { $this->cropAvatar(); + } else if ($this->arg('delete')) { + $this->deleteAvatar(); } else { $this->showForm(_('Unexpected form submission.')); } @@ -344,6 +347,29 @@ class AvatarsettingsAction extends AccountSettingsAction $this->showForm(_('Failed updating avatar.')); } } + + /** + * Get rid of the current avatar. + * + * @return void + */ + + function deleteAvatar() + { + $user = common_current_user(); + $profile = $user->getProfile(); + + $avatar = $profile->getOriginalAvatar(); + $avatar->delete(); + $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); + $avatar->delete(); + $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); + $avatar->delete(); + $avatar = $profile->getAvatar(AVATAR_MINI_SIZE); + $avatar->delete(); + + $this->showForm(_('Avatar deleted.'), true); + } /** * Add the jCrop stylesheet diff --git a/actions/doc.php b/actions/doc.php index 6957659ad..ebffb7c15 100644 --- a/actions/doc.php +++ b/actions/doc.php @@ -50,7 +50,7 @@ class DocAction extends Action /** * Class handler. - * + * * @param array $args array of arguments * * @return nothing @@ -59,7 +59,7 @@ class DocAction extends Action { parent::handle($args); $this->title = $this->trimmed('title'); - $this->filename = INSTALLDIR.'/doc/'.$this->title; + $this->filename = INSTALLDIR.'/doc-src/'.$this->title; if (!file_exists($this->filename)) { $this->clientError(_('No such document.')); return; @@ -71,14 +71,14 @@ class DocAction extends Action function showPageTitle() { $this->element('h1', array('class' => 'entry-title'), $this->title()); } - + // overrided to add hentry, and content-inner classes function showContentBlock() { $this->elementStart('div', array('id' => 'content', 'class' => 'hentry')); $this->showPageTitle(); $this->showPageNoticeBlock(); - $this->elementStart('div', array('id' => 'content_inner', + $this->elementStart('div', array('id' => 'content_inner', 'class' => 'entry-content')); // show the actual content (forms, lists, whatever) $this->showContent(); @@ -88,7 +88,7 @@ class DocAction extends Action /** * Display content. - * + * * @return nothing */ function showContent() @@ -100,7 +100,7 @@ class DocAction extends Action /** * Page title. - * + * * @return page title */ function title() diff --git a/actions/noticesearch.php b/actions/noticesearch.php index a5f01350c..2d94a7906 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -78,6 +78,62 @@ class NoticesearchAction extends SearchAction return _('Text search'); } + + function showExportData() + { + $q = $this->trimmed('q'); + if (!$q) { + return; + } + $fl = new FeedList($this); + $fl->show(array(0 => array('href' => common_local_url('noticesearchrss', array('q' => $q)), + 'type' => 'rss', + 'version' => 'RSS 1.0', + 'item' => 'noticesearchrss'))); + } + + + + function showFeeds() + { + $q = $this->trimmed('q'); + if (!$q) { + return; + } + + $this->element('link', array('rel' => 'alternate', + 'href' => common_local_url('noticesearchrss', + array('q' => $q)), + 'type' => 'application/rss+xml', + 'title' => _('Search Stream Feed'))); + } + + + /** + * Show header + * + * @param array $arr array containing the query + * + * @return void + */ + + function extraHead2() + { + $q = $this->trimmed('q'); + if ($q) { + $this->element('link', array('rel' => 'alternate', + 'href' => common_local_url('noticesearchrss', + array('q' => $q)), + 'type' => 'application/rss+xml', + 'title' => _('Search Stream Feed'))); + } + } + + + + + + /** * Show results * @@ -120,26 +176,6 @@ class NoticesearchAction extends SearchAction } /** - * Show header - * - * @param array $arr array containing the query - * - * @return void - */ - - function extraHead() - { - $q = $this->trimmed('q'); - if ($q) { - $this->element('link', array('rel' => 'alternate', - 'href' => common_local_url('noticesearchrss', - array('q' => $q)), - 'type' => 'application/rss+xml', - 'title' => _('Search Stream Feed'))); - } - } - - /** * Show notice * * @param class $notice notice |