From 01a548a9fb078476be5f54b54cfcba4035faea5b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 20 Dec 2008 19:39:55 -0500 Subject: some modifications to assuage phpcs darcs-hash:20081221003955-84dde-d6e8067a579f70dcb707f4525e588920a2375f5c.gz --- lib/action.php | 255 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 137 insertions(+), 118 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 7a2461bb5..486b40387 100644 --- a/lib/action.php +++ b/lib/action.php @@ -1,5 +1,5 @@ . */ -if (!defined('LACONICA')) { exit(1); } - -class Action { // lawsuit - - var $args; - - function Action() { - } - - # For initializing members of the class - - function prepare($argarray) { - $this->args =& common_copy_args($argarray); - return true; - } - - # For comparison with If-Last-Modified - # If not applicable, return NULL - - function last_modified() { - return NULL; - } - - function etag() { - return NULL; - } - - function is_readonly() { - return false; - } - - function arg($key, $def=NULL) { - if (array_key_exists($key, $this->args)) { - return $this->args[$key]; - } else { - return $def; - } - } - - function trimmed($key, $def=NULL) { - $arg = $this->arg($key, $def); - return (is_string($arg)) ? trim($arg) : $arg; - } - - # Note: argarray ignored, since it's now passed in in prepare() - - function handle($argarray=NULL) { - - $lm = $this->last_modified(); - $etag = $this->etag(); - - if ($etag) { - header('ETag: ' . $etag); - } - - if ($lm) { - header('Last-Modified: ' . date(DATE_RFC1123, $lm)); - $if_modified_since = $_SERVER['HTTP_IF_MODIFIED_SINCE']; - if ($if_modified_since) { - $ims = strtotime($if_modified_since); - if ($lm <= $ims) { - if (!$etag || $this->_has_etag($etag, $_SERVER['HTTP_IF_NONE_MATCH'])) { - header('HTTP/1.1 304 Not Modified'); - # Better way to do this? - exit(0); - } - } - } - } - } - - function _has_etag($etag, $if_none_match) { - return ($if_none_match) && in_array($etag, explode(',', $if_none_match)); - } - - function boolean($key, $def=false) { - $arg = strtolower($this->trimmed($key)); - - if (is_null($arg)) { - return $def; - } else if (in_array($arg, array('true', 'yes', '1'))) { - return true; - } else if (in_array($arg, array('false', 'no', '0'))) { - return false; - } else { - return $def; - } - } - - function server_error($msg, $code=500) { - $action = $this->trimmed('action'); - common_debug("Server error '$code' on '$action': $msg", __FILE__); - common_server_error($msg, $code); - } - - function client_error($msg, $code=400) { - $action = $this->trimmed('action'); - common_debug("User error '$code' on '$action': $msg", __FILE__); - common_user_error($msg, $code); - } - - function self_url() { - $action = $this->trimmed('action'); - $args = $this->args; - unset($args['action']); - foreach (array_keys($_COOKIE) as $cookie) { - unset($args[$cookie]); - } - return common_local_url($action, $args); - } - - function nav_menu($menu) { +if (!defined('LACONICA')) { + exit(1); +} + +class Action // lawsuit +{ + + var $args; + + function Action() + { + } + + // For initializing members of the class + + function prepare($argarray) + { + $this->args =& common_copy_args($argarray); + return true; + } + + // For comparison with If-Last-Modified + // If not applicable, return null + + function last_modified() + { + return null; + } + + function etag() + { + return null; + } + + function is_readonly() + { + return false; + } + + function arg($key, $def=null) + { + if (array_key_exists($key, $this->args)) { + return $this->args[$key]; + } else { + return $def; + } + } + + function trimmed($key, $def=null) + { + $arg = $this->arg($key, $def); + return (is_string($arg)) ? trim($arg) : $arg; + } + + // Note: argarray ignored, since it's now passed in in prepare() + + function handle($argarray=null) + { + + $lm = $this->last_modified(); + $etag = $this->etag(); + + if ($etag) { + header('ETag: ' . $etag); + } + + if ($lm) { + header('Last-Modified: ' . date(DATE_RFC1123, $lm)); + $if_modified_since = $_SERVER['HTTP_IF_MODIFIED_SINCE']; + if ($if_modified_since) { + $ims = strtotime($if_modified_since); + if ($lm <= $ims) { + if (!$etag || + $this->_has_etag($etag, $_SERVER['HTTP_IF_NONE_MATCH'])) { + header('HTTP/1.1 304 Not Modified'); + // Better way to do this? + exit(0); + } + } + } + } + } + + function _has_etag($etag, $if_none_match) + { + return ($if_none_match) && in_array($etag, explode(',', $if_none_match)); + } + + function boolean($key, $def=false) + { + $arg = strtolower($this->trimmed($key)); + + if (is_null($arg)) { + return $def; + } else if (in_array($arg, array('true', 'yes', '1'))) { + return true; + } else if (in_array($arg, array('false', 'no', '0'))) { + return false; + } else { + return $def; + } + } + + function server_error($msg, $code=500) + { + $action = $this->trimmed('action'); + common_debug("Server error '$code' on '$action': $msg", __FILE__); + common_server_error($msg, $code); + } + + function client_error($msg, $code=400) + { + $action = $this->trimmed('action'); + common_debug("User error '$code' on '$action': $msg", __FILE__); + common_user_error($msg, $code); + } + + function self_url() + { + $action = $this->trimmed('action'); + $args = $this->args; + unset($args['action']); + foreach (array_keys($_COOKIE) as $cookie) { + unset($args[$cookie]); + } + return common_local_url($action, $args); + } + + function nav_menu($menu) + { $action = $this->trimmed('action'); common_element_start('ul', array('id' => 'nav_views')); foreach ($menu as $menuaction => $menudesc) { - common_menu_item(common_local_url($menuaction, isset($menudesc[2]) ? $menudesc[2] : NULL), - $menudesc[0], - $menudesc[1], - $action == $menuaction); + common_menu_item(common_local_url($menuaction, + isset($menudesc[2]) ? $menudesc[2] : null), + $menudesc[0], + $menudesc[1], + $action == $menuaction); } common_element_end('ul'); - } + } } -- cgit v1.2.3-54-g00ecf From 93e249de2a28775e3a40e63324371fec359fb93b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 13 Jan 2009 13:41:39 -0500 Subject: Move page-generation code from lib/util.php to Action class We moved the page generation code from lib/util.php to the action class. We also broke up the page generation code into a big recipe, where each element of the page has a corresponding method in the Action class. Action classes can override parts of the recipe to make their custom output, and leave the rest up to the parent class. NOTE: this change BREAKS pretty much everything. lib/action.php probably does not compile, and everything that uses it needs to be fixed to use the new framework. Stay tuned for more fun! --- lib/action.php | 405 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- lib/util.php | 179 ------------------------- 2 files changed, 400 insertions(+), 184 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 486b40387..59cc173e7 100644 --- a/lib/action.php +++ b/lib/action.php @@ -1,9 +1,12 @@ . + * + * @category Action + * @package Laconica + * @author Evan Prodromou + * @author Sarven Capadisli + * @copyright 2008 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ */ if (!defined('LACONICA')) { exit(1); } -class Action // lawsuit -{ +/** + * Base class for all actions + * + * This is the base class for all actions in the package. An action is + * more or less a "view" in an MVC framework. + * + * Actions are responsible for extracting and validating parameters; using + * model classes to read and write to the database; and doing ouput. + * + * @category Output + * @package Laconica + * @author Evan Prodromou + * @author Sarven Capadisli + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see HTMLOutputter + */ +class Action extends HTMLOutputter // lawsuit +{ var $args; function Action() @@ -38,6 +67,296 @@ class Action // lawsuit return true; } + function showPage() + { + $this->startHTML(); + $this->showHead(); + $this->showBody(); + $this->endHTML(); + } + + function showHead() + { + // XXX: attributes (profile?) + $this->startElement('head'); + $this->showTitle(); + $this->showStylesheets(); + $this->showScripts(); + $this->showOpenSearch(); + $this->showFeeds(); + $this->showDescription(); + $this->extraHead(); + $this->elementElement('head'); + } + + function showTitle() + { + $this->element('title', null, + sprintf(_("%s - %s"), + $this->title(), + common_config('site', 'name'))); + } + + // SHOULD overload + + function title() + { + return _("Untitled page"); + } + + function showStylesheets() + { + common_element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => theme_path('display.css') . '?version=' . LACONICA_VERSION, + 'media' => 'screen, projection, tv')); + foreach (array(6,7) as $ver) { + if (file_exists(theme_file('ie'.$ver.'.css'))) { + // Yes, IE people should be put in jail. + $xw->writeComment('[if lte IE '.$ver.']> 'text/javascript', + 'src' => common_path('js/jquery.min.js')), + ' '); + common_element('script', array('type' => 'text/javascript', + 'src' => common_path('js/jquery.form.js')), + ' '); + common_element('script', array('type' => 'text/javascript', + 'src' => common_path('js/xbImportNode.js')), + ' '); + common_element('script', array('type' => 'text/javascript', + 'src' => common_path('js/util.js?version='.LACONICA_VERSION)), + ' '); + } + + function showOpenSearch() + { + common_element('link', array('rel' => 'search', 'type' => 'application/opensearchdescription+xml', + 'href' => common_local_url('opensearch', array('type' => 'people')), + 'title' => common_config('site', 'name').' People Search')); + + common_element('link', array('rel' => 'search', 'type' => 'application/opensearchdescription+xml', + 'href' => common_local_url('opensearch', array('type' => 'notice')), + 'title' => common_config('site', 'name').' Notice Search')); + } + + // MAY overload + + function showFeeds() + { + // does nothing by default + } + + // SHOULD overload + + function showDescription() + { + // does nothing by default + } + + // MAY overload + + function extraHead() + { + // does nothing by default + } + + function showBody() + { + // output body + // output wrap element + $this->showHeader(); + $this->showCore(); + $this->showFooter(); + } + + function showHeader() + { + // start header div stuff + $this->showLogo(); + $this->showPrimaryNav(); + $this->showSiteNotice(); + $this->showNoticeForm(); + // end header div stuff + } + + function showLogo() + { + // show the logo here + } + + function showPrimaryNav() + { + $user = common_current_user(); + common_element_start('ul', array('id' => 'nav')); + if ($user) { + common_menu_item(common_local_url('all', array('nickname' => $user->nickname)), + _('Home')); + } + common_menu_item(common_local_url('peoplesearch'), _('Search')); + if ($user) { + common_menu_item(common_local_url('profilesettings'), + _('Settings')); + common_menu_item(common_local_url('invite'), + _('Invite')); + common_menu_item(common_local_url('logout'), + _('Logout')); + } else { + common_menu_item(common_local_url('login'), _('Login')); + if (!common_config('site', 'closed')) { + common_menu_item(common_local_url('register'), _('Register')); + } + common_menu_item(common_local_url('openidlogin'), _('OpenID')); + } + common_menu_item(common_local_url('doc', array('title' => 'help')), + _('Help')); + common_element_end('ul'); + } + + function showSiteNotice() + { + // show the site notice here + } + + // MAY overload if no notice form needed... or direct message box???? + + function showNoticeForm() + { + // show the notice form here + } + + function showCore() + { + // start core div + $this->showLocalNav(); + $this->showContentBlock(); + $this->showAside(); + // end core div + } + + // SHOULD overload + + function showLocalNav() + { + } + + function showContentBlock() + { + $this->showPageTitle(); + $this->showPageNotice(); + $this->showContent(); + } + + function showPageTitle() { + $this->element('h1', NULL, $this->title()); + } + + // SHOULD overload (unless there's not a notice) + + function showPageNotice() + { + // output page notice div + } + + // MUST overload + + function showContent() + { + // show the actual content (forms, lists, whatever) + } + + function showAside() + { + $this->showExportData(); + $this->showSections(); + } + + // MAY overload if there are feeds + + function showExportData() + { + // is there structure to this? + // list of (visible!) feed links + // can we reuse list of feeds from showFeeds() ? + } + + // SHOULD overload + + function showSections() { + // for each section, show it + } + + function showFooter() + { + // start footer div + $this->showSecondaryNav(); + $this->showLicenses(); + } + + function showSecondaryNav() + { + common_element_start('ul', array('id' => 'nav_sub')); + common_menu_item(common_local_url('doc', array('title' => 'help')), + _('Help')); + common_menu_item(common_local_url('doc', array('title' => 'about')), + _('About')); + common_menu_item(common_local_url('doc', array('title' => 'faq')), + _('FAQ')); + common_menu_item(common_local_url('doc', array('title' => 'privacy')), + _('Privacy')); + common_menu_item(common_local_url('doc', array('title' => 'source')), + _('Source')); + common_menu_item(common_local_url('doc', array('title' => 'contact')), + _('Contact')); + common_element_end('ul'); + } + + function showLicenses() + { + // start license dl + $this->showLaconicaLicense(); + $this->showContentLicense(); + // end license dl + } + + function showLaconicaLicense() + { + common_element_start('div', 'laconica'); + if (common_config('site', 'broughtby')) { + $instr = _('**%%site.name%%** is a microblogging service brought to you by [%%site.broughtby%%](%%site.broughtbyurl%%). '); + } else { + $instr = _('**%%site.name%%** is a microblogging service. '); + } + $instr .= sprintf(_('It runs the [Laconica](http://laconi.ca/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), LACONICA_VERSION); + $output = common_markup_to_html($instr); + common_raw($output); + common_element_end('div'); + // do it + } + + function showContentLicense() + { + common_element_start('div', array('id' => 'footer')); + common_element('img', array('id' => 'cc', + 'src' => $config['license']['image'], + 'alt' => $config['license']['title'])); + common_element_start('p'); + common_text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the ')); + common_element('a', array('class' => 'license', + 'rel' => 'license', + 'href' => $config['license']['url']), + $config['license']['title']); + common_text(_('. Contributors should be attributed by full name or nickname.')); + common_element_end('p'); + common_element_end('div'); + } + // For comparison with If-Last-Modified // If not applicable, return null @@ -158,4 +477,80 @@ class Action // lawsuit } common_element_end('ul'); } + + function common_show_header($pagetitle, $callable=null, $data=null, $headercall=null) + { + global $config, $xw; + global $action; /* XXX: kind of cheating here. */ + + common_start_html(); + + common_element_start('head'); + + if ($callable) { + if ($data) { + call_user_func($callable, $data); + } else { + call_user_func($callable); + } + } + common_element_end('head'); + common_element_start('body', $action); + common_element_start('div', array('id' => 'wrap')); + common_element_start('div', array('id' => 'header')); + common_nav_menu(); + if ((isset($config['site']['logo']) && is_string($config['site']['logo']) && (strlen($config['site']['logo']) > 0)) + || file_exists(theme_file('logo.png'))) + { + common_element_start('a', array('href' => common_local_url('public'))); + common_element('img', array('src' => isset($config['site']['logo']) ? + ($config['site']['logo']) : theme_path('logo.png'), + 'alt' => $config['site']['name'], + 'id' => 'logo')); + common_element_end('a'); + } else { + common_element_start('p', array('id' => 'branding')); + common_element('a', array('href' => common_local_url('public')), + $config['site']['name']); + common_element_end('p'); + } + + common_element('h1', 'pagetitle', $pagetitle); + + if ($headercall) { + if ($data) { + call_user_func($headercall, $data); + } else { + call_user_func($headercall); + } + } + common_element_end('div'); + common_element_start('div', array('id' => 'content')); + } + + function common_show_footer() + { + global $xw, $config; + common_element_end('div'); // content div + common_foot_menu(); + common_element_end('div'); + common_element_end('body'); + common_element_end('html'); + common_end_xml(); + } + + function common_menu_item($url, $text, $title=null, $is_selected=false) + { + $lattrs = array(); + if ($is_selected) { + $lattrs['class'] = 'current'; + } + common_element_start('li', $lattrs); + $attrs['href'] = $url; + if ($title) { + $attrs['title'] = $title; + } + common_element('a', $attrs, $text); + common_element_end('li'); + } } diff --git a/lib/util.php b/lib/util.php index 914257608..009a0457c 100644 --- a/lib/util.php +++ b/lib/util.php @@ -108,185 +108,6 @@ function common_init_language() } } -function common_show_header($pagetitle, $callable=null, $data=null, $headercall=null) -{ - - global $config, $xw; - global $action; /* XXX: kind of cheating here. */ - - common_start_html(); - - common_element_start('head'); - common_element('title', null, - $pagetitle . " - " . $config['site']['name']); - common_element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('display.css') . '?version=' . LACONICA_VERSION, - 'media' => 'screen, projection, tv')); - foreach (array(6,7) as $ver) { - if (file_exists(theme_file('ie'.$ver.'.css'))) { - // Yes, IE people should be put in jail. - $xw->writeComment('[if lte IE '.$ver.']> 'text/javascript', - 'src' => common_path('js/jquery.min.js')), - ' '); - common_element('script', array('type' => 'text/javascript', - 'src' => common_path('js/jquery.form.js')), - ' '); - common_element('script', array('type' => 'text/javascript', - 'src' => common_path('js/xbImportNode.js')), - ' '); - common_element('script', array('type' => 'text/javascript', - 'src' => common_path('js/util.js?version='.LACONICA_VERSION)), - ' '); - common_element('link', array('rel' => 'search', 'type' => 'application/opensearchdescription+xml', - 'href' => common_local_url('opensearch', array('type' => 'people')), - 'title' => common_config('site', 'name').' People Search')); - - common_element('link', array('rel' => 'search', 'type' => 'application/opensearchdescription+xml', - 'href' => common_local_url('opensearch', array('type' => 'notice')), - 'title' => common_config('site', 'name').' Notice Search')); - - if ($callable) { - if ($data) { - call_user_func($callable, $data); - } else { - call_user_func($callable); - } - } - common_element_end('head'); - common_element_start('body', $action); - common_element_start('div', array('id' => 'wrap')); - common_element_start('div', array('id' => 'header')); - common_nav_menu(); - if ((isset($config['site']['logo']) && is_string($config['site']['logo']) && (strlen($config['site']['logo']) > 0)) - || file_exists(theme_file('logo.png'))) - { - common_element_start('a', array('href' => common_local_url('public'))); - common_element('img', array('src' => isset($config['site']['logo']) ? - ($config['site']['logo']) : theme_path('logo.png'), - 'alt' => $config['site']['name'], - 'id' => 'logo')); - common_element_end('a'); - } else { - common_element_start('p', array('id' => 'branding')); - common_element('a', array('href' => common_local_url('public')), - $config['site']['name']); - common_element_end('p'); - } - - common_element('h1', 'pagetitle', $pagetitle); - - if ($headercall) { - if ($data) { - call_user_func($headercall, $data); - } else { - call_user_func($headercall); - } - } - common_element_end('div'); - common_element_start('div', array('id' => 'content')); -} - -function common_show_footer() -{ - global $xw, $config; - common_element_end('div'); // content div - common_foot_menu(); - common_element_start('div', array('id' => 'footer')); - common_element_start('div', 'laconica'); - if (common_config('site', 'broughtby')) { - $instr = _('**%%site.name%%** is a microblogging service brought to you by [%%site.broughtby%%](%%site.broughtbyurl%%). '); - } else { - $instr = _('**%%site.name%%** is a microblogging service. '); - } - $instr .= sprintf(_('It runs the [Laconica](http://laconi.ca/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), LACONICA_VERSION); - $output = common_markup_to_html($instr); - common_raw($output); - common_element_end('div'); - common_element('img', array('id' => 'cc', - 'src' => $config['license']['image'], - 'alt' => $config['license']['title'])); - common_element_start('p'); - common_text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the ')); - common_element('a', array('class' => 'license', - 'rel' => 'license', - 'href' => $config['license']['url']), - $config['license']['title']); - common_text(_('. Contributors should be attributed by full name or nickname.')); - common_element_end('p'); - common_element_end('div'); - common_element_end('div'); - common_element_end('body'); - common_element_end('html'); - common_end_xml(); -} - -function common_nav_menu() -{ - $user = common_current_user(); - common_element_start('ul', array('id' => 'nav')); - if ($user) { - common_menu_item(common_local_url('all', array('nickname' => $user->nickname)), - _('Home')); - } - common_menu_item(common_local_url('peoplesearch'), _('Search')); - if ($user) { - common_menu_item(common_local_url('profilesettings'), - _('Settings')); - common_menu_item(common_local_url('invite'), - _('Invite')); - common_menu_item(common_local_url('logout'), - _('Logout')); - } else { - common_menu_item(common_local_url('login'), _('Login')); - if (!common_config('site', 'closed')) { - common_menu_item(common_local_url('register'), _('Register')); - } - common_menu_item(common_local_url('openidlogin'), _('OpenID')); - } - common_menu_item(common_local_url('doc', array('title' => 'help')), - _('Help')); - common_element_end('ul'); -} - -function common_foot_menu() -{ - common_element_start('ul', array('id' => 'nav_sub')); - common_menu_item(common_local_url('doc', array('title' => 'help')), - _('Help')); - common_menu_item(common_local_url('doc', array('title' => 'about')), - _('About')); - common_menu_item(common_local_url('doc', array('title' => 'faq')), - _('FAQ')); - common_menu_item(common_local_url('doc', array('title' => 'privacy')), - _('Privacy')); - common_menu_item(common_local_url('doc', array('title' => 'source')), - _('Source')); - common_menu_item(common_local_url('doc', array('title' => 'contact')), - _('Contact')); - common_element_end('ul'); -} - -function common_menu_item($url, $text, $title=null, $is_selected=false) -{ - $lattrs = array(); - if ($is_selected) { - $lattrs['class'] = 'current'; - } - common_element_start('li', $lattrs); - $attrs['href'] = $url; - if ($title) { - $attrs['title'] = $title; - } - common_element('a', $attrs, $text); - common_element_end('li'); -} - function common_timezone() { if (common_logged_in()) { -- cgit v1.2.3-54-g00ecf From 0093b035c12bf21c88f57e4f0931b0abce214f43 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 13 Jan 2009 23:48:05 -0500 Subject: Modify public stream to use new UI framework I modified public.php to use the new UI framework. Since the Action class isn't functional yet, I don't know if it works. I took some of the functionality, like the public tabs nav and the feeds list, and made them widgets. I also moved the navigation from common_navigation() to a method of Action. --- actions/public.php | 197 ++++++++++++++++++++++++++++++++++++------------- lib/action.php | 34 +++++++++ lib/feedlist.php | 156 +++++++++++++++++++++++++++++++++++++++ lib/personal.php | 108 ++------------------------- lib/publicgroupnav.php | 83 +++++++++++++++++++++ lib/stream.php | 26 ------- lib/util.php | 35 --------- 7 files changed, 422 insertions(+), 217 deletions(-) create mode 100644 lib/feedlist.php create mode 100644 lib/publicgroupnav.php (limited to 'lib/action.php') diff --git a/actions/public.php b/actions/public.php index 039e885e6..e00f8efba 100644 --- a/actions/public.php +++ b/actions/public.php @@ -1,9 +1,12 @@ . + * + * @category Public + * @package Laconica + * @author Evan Prodromou + * @copyright 2008-2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('LACONICA')) { + exit(1); +} -require_once(INSTALLDIR.'/lib/stream.php'); +/** + * Action for displaying the public stream + * + * @category Public + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see PublicrssAction + * @see PublicxrdsAction + */ -class PublicAction extends StreamAction +class PublicAction extends Action { + /** + * page of the stream we're on; default = 1 + */ - function handle($args) - { - parent::handle($args); + var $page = null; - $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; + /** + * Read and validate arguments + * + * @param array $args URL parameters + * + * @return boolean success value + */ - header('X-XRDS-Location: '. common_local_url('publicxrds')); + function prepare($args) + { + parent::prepare($args); + $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; + return true; + } - common_show_header(_('Public timeline'), - array($this, 'show_header'), null, - array($this, 'show_top')); + /** + * handle request + * + * Show the public stream, using recipe method showPage() + * + * @param array $args arguments, mostly unused + * + * @return void + */ - # XXX: Public sidebar here? + function handle($args) + { + parent::handle($args); - $this->show_notices($page); + header('X-XRDS-Location: '. common_local_url('publicxrds')); - common_show_footer(); + $this->showPage(); } - function show_top() + /** + * Title of the page + * + * @return page title, including page number if over 1 + */ + + function title() { - if (common_logged_in()) { - common_notice_form('public'); + if ($this->page > 1) { + return sprintf(_('Public timeline, page %d'), $this->page); } else { - $instr = $this->get_instructions(); - $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + return _('Public timeline'); } - - $this->public_views_menu(); - - $this->show_feeds_list(array(0=>array('href'=>common_local_url('publicrss'), - 'type' => 'rss', - 'version' => 'RSS 1.0', - 'item' => 'publicrss'), - 1=>array('href'=>common_local_url('publicatom'), - 'type' => 'atom', - 'version' => 'Atom 1.0', - 'item' => 'publicatom'))); } - function get_instructions() - { - return _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . - 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' . - '[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ([Read more](%%doc.help%%))'); - } + /** + * Output elements for RSS and Atom feeds + * + * @return void + */ - function show_header() + function showFeeds() { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('publicrss'), 'type' => 'application/rss+xml', 'title' => _('Public Stream Feed'))); - # for client side of OpenID authentication - common_element('meta', array('http-equiv' => 'X-XRDS-Location', + } + + /** + * Extra head elements + * + * We include a element linking to the publicxrds page, for OpenID + * client-side authentication. + * + * @return void + */ + + function extraHead() + { + // for client side of OpenID authentication + $this->element('meta', array('http-equiv' => 'X-XRDS-Location', 'content' => common_local_url('publicxrds'))); } - function show_notices($page) + /** + * Show tabset for this page + * + * Uses the PublicGroupNav widget + * + * @return void + * @see PublicGroupNav + */ + + function showLocalNav() { + $nav = new PublicGroupNav($this); + $nav->show(); + } + + /** + * Fill the content area + * + * Shows a list of the notices in the public stream, with some pagination + * controls. + * + * @return void + */ - $cnt = 0; - $notice = Notice::publicStream(($page-1)*NOTICES_PER_PAGE, + function showContent() + { + $notice = Notice::publicStream(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); if (!$notice) { @@ -97,9 +165,32 @@ class PublicAction extends StreamAction return; } - $cnt = $this->show_notice_list($notice); + $nl = new NoticeList($notice); + + $cnt = $nl->show(); - common_pagination($page > 1, $cnt > NOTICES_PER_PAGE, - $page, 'public'); + $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, + $this->page, 'public'); + } + + /** + * Makes a list of exported feeds for this page + * + * @return void + * + * @todo I18N + */ + + function showExportData() + { + $fl = new FeedList($this); + $fl->show(array(0 => array('href' => common_local_url('publicrss'), + 'type' => 'rss', + 'version' => 'RSS 1.0', + 'item' => 'publicrss'), + 1 => array('href' => common_local_url('publicatom'), + 'type' => 'atom', + 'version' => 'Atom 1.0', + 'item' => 'publicatom'))); } } diff --git a/lib/action.php b/lib/action.php index 59cc173e7..95178c65e 100644 --- a/lib/action.php +++ b/lib/action.php @@ -553,4 +553,38 @@ class Action extends HTMLOutputter // lawsuit common_element('a', $attrs, $text); common_element_end('li'); } + + // Does a little before-after block for next/prev page + + function pagination($have_before, $have_after, $page, $action, $args=null) + { + if ($have_before || $have_after) { + $this->elementStart('div', array('id' => 'pagination')); + $this->elementStart('ul', array('id' => 'nav_pagination')); + } + + if ($have_before) { + $pargs = array('page' => $page-1); + $newargs = ($args) ? array_merge($args,$pargs) : $pargs; + + $this->elementStart('li', 'before'); + $this->element('a', array('href' => common_local_url($action, $newargs), 'rel' => 'prev'), + _('« After')); + $this->elementEnd('li'); + } + + if ($have_after) { + $pargs = array('page' => $page+1); + $newargs = ($args) ? array_merge($args,$pargs) : $pargs; + $this->elementStart('li', 'after'); + $this->element('a', array('href' => common_local_url($action, $newargs), 'rel' => 'next'), + _('Before »')); + $this->elementEnd('li'); + } + + if ($have_before || $have_after) { + $this->elementEnd('ul'); + $this->elementEnd('div'); + } + } } diff --git a/lib/feedlist.php b/lib/feedlist.php new file mode 100644 index 000000000..0ff88cb25 --- /dev/null +++ b/lib/feedlist.php @@ -0,0 +1,156 @@ +. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @author Sarven Capadisli + * @copyright 2008 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Widget for showing a list of feeds + * + * Typically used for Action::showExportList() + * + * @category Widget + * @package Laconica + * @author Evan Prodromou + * @author Sarven Capadisli + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see Action::showExportList() + */ + +class FeedList +{ + var $out = null; + + function __construct($out=null) + { + $this->out = $out; + } + + function show($feeds) + { + $this->out->elementStart('div', array('class' => 'feeds')); + $this->out->element('p', null, 'Feeds:'); + $this->out->elementStart('ul', array('class' => 'xoxo')); + + foreach ($feeds as $key => $value) { + $this->feedItem($feeds[$key]); + } + + $this->out->elementEnd('ul'); + $this->out->elementEnd('div'); + } + + function feedItem($feed) + { + $nickname = $this->trimmed('nickname'); + + switch($feed['item']) { + case 'notices': default: + $feed_classname = $feed['type']; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "$nickname's ".$feed['version']." notice feed"; + $feed['textContent'] = "RSS"; + break; + + case 'allrss': + $feed_classname = $feed['type']; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = $feed['version']." feed for $nickname and friends"; + $feed['textContent'] = "RSS"; + break; + + case 'repliesrss': + $feed_classname = $feed['type']; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = $feed['version']." feed for replies to $nickname"; + $feed['textContent'] = "RSS"; + break; + + case 'publicrss': + $feed_classname = $feed['type']; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "Public timeline ".$feed['version']." feed"; + $feed['textContent'] = "RSS"; + break; + + case 'publicatom': + $feed_classname = "atom"; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "Public timeline ".$feed['version']." feed"; + $feed['textContent'] = "Atom"; + break; + + case 'tagrss': + $feed_classname = $feed['type']; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = $feed['version']." feed for this tag"; + $feed['textContent'] = "RSS"; + break; + + case 'favoritedrss': + $feed_classname = $feed['type']; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "Favorited ".$feed['version']." feed"; + $feed['textContent'] = "RSS"; + break; + + case 'foaf': + $feed_classname = "foaf"; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "$nickname's FOAF file"; + $feed['textContent'] = "FOAF"; + break; + + case 'favoritesrss': + $feed_classname = "favorites"; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "Feed for favorites of $nickname"; + $feed['textContent'] = "RSS"; + break; + + case 'usertimeline': + $feed_classname = "atom"; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "$nickname's ".$feed['version']." notice feed"; + $feed['textContent'] = "Atom"; + break; + } + $this->out->elementStart('li'); + $this->out->element('a', array('href' => $feed['href'], + 'class' => $feed_classname, + 'type' => $feed_mimetype, + 'title' => $feed_title), + $feed['textContent']); + $this->out->elementEnd('li'); + } +} diff --git a/lib/personal.php b/lib/personal.php index 02b01fece..4e56c9566 100644 --- a/lib/personal.php +++ b/lib/personal.php @@ -21,12 +21,12 @@ if (!defined('LACONICA')) { exit(1); } class PersonalAction extends Action { - + function is_readonly() { return true; } - + function handle($args) { parent::handle($args); @@ -69,11 +69,11 @@ class PersonalAction extends Action _('Favorites'), sprintf(_('%s\'s favorite notices'), ($user_profile) ? $user_profile->getBestName() : _('User')), $action == 'showfavorites'); - + $cur = common_current_user(); - + if ($cur && $cur->id == $user->id) { - + common_menu_item(common_local_url('inbox', array('nickname' => $nickname)), _('Inbox'), @@ -85,108 +85,10 @@ class PersonalAction extends Action _('Your sent messages'), $action == 'outbox'); } - - common_element_end('ul'); - } - function show_feeds_list($feeds) - { - common_element_start('div', array('class' => 'feeds')); - common_element('p', null, 'Feeds:'); - common_element_start('ul', array('class' => 'xoxo')); - - foreach ($feeds as $key => $value) { - $this->common_feed_item($feeds[$key]); - } common_element_end('ul'); - common_element_end('div'); - } - - function common_feed_item($feed) - { - $nickname = $this->trimmed('nickname'); - - switch($feed['item']) { - case 'notices': default: - $feed_classname = $feed['type']; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "$nickname's ".$feed['version']." notice feed"; - $feed['textContent'] = "RSS"; - break; - - case 'allrss': - $feed_classname = $feed['type']; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = $feed['version']." feed for $nickname and friends"; - $feed['textContent'] = "RSS"; - break; - - case 'repliesrss': - $feed_classname = $feed['type']; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = $feed['version']." feed for replies to $nickname"; - $feed['textContent'] = "RSS"; - break; - - case 'publicrss': - $feed_classname = $feed['type']; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "Public timeline ".$feed['version']." feed"; - $feed['textContent'] = "RSS"; - break; - - case 'publicatom': - $feed_classname = "atom"; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "Public timeline ".$feed['version']." feed"; - $feed['textContent'] = "Atom"; - break; - - case 'tagrss': - $feed_classname = $feed['type']; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = $feed['version']." feed for this tag"; - $feed['textContent'] = "RSS"; - break; - - case 'favoritedrss': - $feed_classname = $feed['type']; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "Favorited ".$feed['version']." feed"; - $feed['textContent'] = "RSS"; - break; - - case 'foaf': - $feed_classname = "foaf"; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "$nickname's FOAF file"; - $feed['textContent'] = "FOAF"; - break; - - case 'favoritesrss': - $feed_classname = "favorites"; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "Feed for favorites of $nickname"; - $feed['textContent'] = "RSS"; - break; - - case 'usertimeline': - $feed_classname = "atom"; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "$nickname's ".$feed['version']." notice feed"; - $feed['textContent'] = "Atom"; - break; - } - common_element_start('li'); - common_element('a', array('href' => $feed['href'], - 'class' => $feed_classname, - 'type' => $feed_mimetype, - 'title' => $feed_title), - $feed['textContent']); - common_element_end('li'); } - function source_link($source) { $source_name = _($source); diff --git a/lib/publicgroupnav.php b/lib/publicgroupnav.php new file mode 100644 index 000000000..d21d0a458 --- /dev/null +++ b/lib/publicgroupnav.php @@ -0,0 +1,83 @@ +. + * + * @category Action + * @package Laconica + * @author Evan Prodromou + * @author Sarven Capadisli + * @copyright 2008 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Base class for all actions + * + * This is the base class for all actions in the package. An action is + * more or less a "view" in an MVC framework. + * + * Actions are responsible for extracting and validating parameters; using + * model classes to read and write to the database; and doing ouput. + * + * @category Output + * @package Laconica + * @author Evan Prodromou + * @author Sarven Capadisli + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see HTMLOutputter + */ + +class PublicGroupNav +{ + var $action = null; + + function __construct($action=null) + { + $this->action = $action; + } + + function show() + { + $this->action->elementStart('ul', array('id' => 'nav_views')); + + common_menu_item(common_local_url('public'), _('Public'), + _('Public timeline'), $this->action == 'public'); + + common_menu_item(common_local_url('tag'), _('Recent tags'), + _('Recent tags'), $this->action == 'tag'); + + if (count(common_config('nickname', 'featured')) > 0) { + common_menu_item(common_local_url('featured'), _('Featured'), + _('Featured users'), $this->action == 'featured'); + } + + common_menu_item(common_local_url('favorited'), _('Popular'), + _("Popular notices"), $this->action == 'favorited'); + + common_element_end('ul'); + } +} diff --git a/lib/stream.php b/lib/stream.php index 73758adee..0cb9e0bf4 100644 --- a/lib/stream.php +++ b/lib/stream.php @@ -24,32 +24,6 @@ require_once(INSTALLDIR.'/lib/noticelist.php'); class StreamAction extends PersonalAction { - - function public_views_menu() - { - - $action = $this->trimmed('action'); - - common_element_start('ul', array('id' => 'nav_views')); - - common_menu_item(common_local_url('public'), _('Public'), - _('Public timeline'), $action == 'public'); - - common_menu_item(common_local_url('tag'), _('Recent tags'), - _('Recent tags'), $action == 'tag'); - - if (count(common_config('nickname', 'featured')) > 0) { - common_menu_item(common_local_url('featured'), _('Featured'), - _('Featured users'), $action == 'featured'); - } - - common_menu_item(common_local_url('favorited'), _('Popular'), - _("Popular notices"), $action == 'favorited'); - - common_element_end('ul'); - - } - function show_notice_list($notice) { $nl = new NoticeList($notice); diff --git a/lib/util.php b/lib/util.php index 009a0457c..a1e325204 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1459,41 +1459,6 @@ function common_valid_tag($tag) return false; } -// Does a little before-after block for next/prev page - -function common_pagination($have_before, $have_after, $page, $action, $args=null) -{ - - if ($have_before || $have_after) { - common_element_start('div', array('id' => 'pagination')); - common_element_start('ul', array('id' => 'nav_pagination')); - } - - if ($have_before) { - $pargs = array('page' => $page-1); - $newargs = ($args) ? array_merge($args,$pargs) : $pargs; - - common_element_start('li', 'before'); - common_element('a', array('href' => common_local_url($action, $newargs), 'rel' => 'prev'), - _('« After')); - common_element_end('li'); - } - - if ($have_after) { - $pargs = array('page' => $page+1); - $newargs = ($args) ? array_merge($args,$pargs) : $pargs; - common_element_start('li', 'after'); - common_element('a', array('href' => common_local_url($action, $newargs), 'rel' => 'next'), - _('Before »')); - common_element_end('li'); - } - - if ($have_before || $have_after) { - common_element_end('ul'); - common_element_end('div'); - } -} - /* Following functions are copied from MediaWiki GlobalFunctions.php * and written by Evan Prodromou. */ -- cgit v1.2.3-54-g00ecf From 3c283332b6f851fda537f3c81efe2677a3da6118 Mon Sep 17 00:00:00 2001 From: sarven Date: Wed, 14 Jan 2009 06:34:22 +0000 Subject: Updated showLogo(). --- lib/action.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 95178c65e..d7ffa41d4 100644 --- a/lib/action.php +++ b/lib/action.php @@ -188,7 +188,21 @@ class Action extends HTMLOutputter // lawsuit function showLogo() { - // show the logo here + $this->element_start('address', array('id' => 'site_contact', + 'class' => 'vcard')); + $this->element_start('a', array('class' => 'url home bookmark', + 'href' => common_local_url('public'))); + if ((isset($config['site']['logo']) && is_string($config['site']['logo']) && (strlen($config['site']['logo']) > 0)) + || file_exists(theme_file('logo.png'))) + { + $this->element('img', array('class' => 'logo photo', + 'src' => isset($config['site']['logo']) ? + ($config['site']['logo']) : theme_path('logo.png'), + 'alt' => $config['site']['name']); + } + $this->element('span', array('class' => 'fn org'), $config['site']['name'])); + $this->element_end('a'); + $this->element_end('address'); } function showPrimaryNav() @@ -499,21 +513,7 @@ class Action extends HTMLOutputter // lawsuit common_element_start('div', array('id' => 'wrap')); common_element_start('div', array('id' => 'header')); common_nav_menu(); - if ((isset($config['site']['logo']) && is_string($config['site']['logo']) && (strlen($config['site']['logo']) > 0)) - || file_exists(theme_file('logo.png'))) - { - common_element_start('a', array('href' => common_local_url('public'))); - common_element('img', array('src' => isset($config['site']['logo']) ? - ($config['site']['logo']) : theme_path('logo.png'), - 'alt' => $config['site']['name'], - 'id' => 'logo')); - common_element_end('a'); - } else { - common_element_start('p', array('id' => 'branding')); - common_element('a', array('href' => common_local_url('public')), - $config['site']['name']); - common_element_end('p'); - } + common_element('h1', 'pagetitle', $pagetitle); -- cgit v1.2.3-54-g00ecf From 0f7e8585cdf1a18d0fe9f1b2e3290a579f202296 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 14 Jan 2009 01:59:30 -0500 Subject: Update lib/action.php to use the right XMLOutputter functions Global search and replace for common_element_* --- lib/action.php | 81 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 40 insertions(+), 41 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index d7ffa41d4..55d3b8221 100644 --- a/lib/action.php +++ b/lib/action.php @@ -106,7 +106,7 @@ class Action extends HTMLOutputter // lawsuit function showStylesheets() { - common_element('link', array('rel' => 'stylesheet', + $this->element('link', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => theme_path('display.css') . '?version=' . LACONICA_VERSION, 'media' => 'screen, projection, tv')); @@ -121,27 +121,27 @@ class Action extends HTMLOutputter // lawsuit function showScripts() { - common_element('script', array('type' => 'text/javascript', + $this->element('script', array('type' => 'text/javascript', 'src' => common_path('js/jquery.min.js')), ' '); - common_element('script', array('type' => 'text/javascript', + $this->element('script', array('type' => 'text/javascript', 'src' => common_path('js/jquery.form.js')), ' '); - common_element('script', array('type' => 'text/javascript', + $this->element('script', array('type' => 'text/javascript', 'src' => common_path('js/xbImportNode.js')), ' '); - common_element('script', array('type' => 'text/javascript', + $this->element('script', array('type' => 'text/javascript', 'src' => common_path('js/util.js?version='.LACONICA_VERSION)), ' '); } function showOpenSearch() { - common_element('link', array('rel' => 'search', 'type' => 'application/opensearchdescription+xml', + $this->element('link', array('rel' => 'search', 'type' => 'application/opensearchdescription+xml', 'href' => common_local_url('opensearch', array('type' => 'people')), 'title' => common_config('site', 'name').' People Search')); - common_element('link', array('rel' => 'search', 'type' => 'application/opensearchdescription+xml', + $this->element('link', array('rel' => 'search', 'type' => 'application/opensearchdescription+xml', 'href' => common_local_url('opensearch', array('type' => 'notice')), 'title' => common_config('site', 'name').' Notice Search')); } @@ -188,9 +188,9 @@ class Action extends HTMLOutputter // lawsuit function showLogo() { - $this->element_start('address', array('id' => 'site_contact', + $this->elementStart('address', array('id' => 'site_contact', 'class' => 'vcard')); - $this->element_start('a', array('class' => 'url home bookmark', + $this->elementStart('a', array('class' => 'url home bookmark', 'href' => common_local_url('public'))); if ((isset($config['site']['logo']) && is_string($config['site']['logo']) && (strlen($config['site']['logo']) > 0)) || file_exists(theme_file('logo.png'))) @@ -201,14 +201,14 @@ class Action extends HTMLOutputter // lawsuit 'alt' => $config['site']['name']); } $this->element('span', array('class' => 'fn org'), $config['site']['name'])); - $this->element_end('a'); - $this->element_end('address'); + $this->elementEnd('a'); + $this->elementEnd('address'); } function showPrimaryNav() { $user = common_current_user(); - common_element_start('ul', array('id' => 'nav')); + $this->elementStart('ul', array('id' => 'nav')); if ($user) { common_menu_item(common_local_url('all', array('nickname' => $user->nickname)), _('Home')); @@ -230,7 +230,7 @@ class Action extends HTMLOutputter // lawsuit } common_menu_item(common_local_url('doc', array('title' => 'help')), _('Help')); - common_element_end('ul'); + $this->elementEnd('ul'); } function showSiteNotice() @@ -315,7 +315,7 @@ class Action extends HTMLOutputter // lawsuit function showSecondaryNav() { - common_element_start('ul', array('id' => 'nav_sub')); + $this->elementStart('ul', array('id' => 'nav_sub')); common_menu_item(common_local_url('doc', array('title' => 'help')), _('Help')); common_menu_item(common_local_url('doc', array('title' => 'about')), @@ -328,7 +328,7 @@ class Action extends HTMLOutputter // lawsuit _('Source')); common_menu_item(common_local_url('doc', array('title' => 'contact')), _('Contact')); - common_element_end('ul'); + $this->elementEnd('ul'); } function showLicenses() @@ -341,7 +341,7 @@ class Action extends HTMLOutputter // lawsuit function showLaconicaLicense() { - common_element_start('div', 'laconica'); + $this->elementStart('div', 'laconica'); if (common_config('site', 'broughtby')) { $instr = _('**%%site.name%%** is a microblogging service brought to you by [%%site.broughtby%%](%%site.broughtbyurl%%). '); } else { @@ -350,25 +350,25 @@ class Action extends HTMLOutputter // lawsuit $instr .= sprintf(_('It runs the [Laconica](http://laconi.ca/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), LACONICA_VERSION); $output = common_markup_to_html($instr); common_raw($output); - common_element_end('div'); + $this->elementEnd('div'); // do it } function showContentLicense() { - common_element_start('div', array('id' => 'footer')); - common_element('img', array('id' => 'cc', + $this->elementStart('div', array('id' => 'footer')); + $this->element('img', array('id' => 'cc', 'src' => $config['license']['image'], 'alt' => $config['license']['title'])); - common_element_start('p'); + $this->elementStart('p'); common_text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the ')); - common_element('a', array('class' => 'license', + $this->element('a', array('class' => 'license', 'rel' => 'license', 'href' => $config['license']['url']), $config['license']['title']); common_text(_('. Contributors should be attributed by full name or nickname.')); - common_element_end('p'); - common_element_end('div'); + $this->elementEnd('p'); + $this->elementEnd('div'); } // For comparison with If-Last-Modified @@ -481,7 +481,7 @@ class Action extends HTMLOutputter // lawsuit function nav_menu($menu) { $action = $this->trimmed('action'); - common_element_start('ul', array('id' => 'nav_views')); + $this->elementStart('ul', array('id' => 'nav_views')); foreach ($menu as $menuaction => $menudesc) { common_menu_item(common_local_url($menuaction, isset($menudesc[2]) ? $menudesc[2] : null), @@ -489,7 +489,7 @@ class Action extends HTMLOutputter // lawsuit $menudesc[1], $action == $menuaction); } - common_element_end('ul'); + $this->elementEnd('ul'); } function common_show_header($pagetitle, $callable=null, $data=null, $headercall=null) @@ -499,7 +499,7 @@ class Action extends HTMLOutputter // lawsuit common_start_html(); - common_element_start('head'); + $this->elementStart('head'); if ($callable) { if ($data) { @@ -508,14 +508,13 @@ class Action extends HTMLOutputter // lawsuit call_user_func($callable); } } - common_element_end('head'); - common_element_start('body', $action); - common_element_start('div', array('id' => 'wrap')); - common_element_start('div', array('id' => 'header')); + $this->elementEnd('head'); + $this->elementStart('body', $action); + $this->elementStart('div', array('id' => 'wrap')); + $this->elementStart('div', array('id' => 'header')); common_nav_menu(); - - common_element('h1', 'pagetitle', $pagetitle); + $this->element('h1', 'pagetitle', $pagetitle); if ($headercall) { if ($data) { @@ -524,18 +523,18 @@ class Action extends HTMLOutputter // lawsuit call_user_func($headercall); } } - common_element_end('div'); - common_element_start('div', array('id' => 'content')); + $this->elementEnd('div'); + $this->elementStart('div', array('id' => 'content')); } function common_show_footer() { global $xw, $config; - common_element_end('div'); // content div + $this->elementEnd('div'); // content div common_foot_menu(); - common_element_end('div'); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('div'); + $this->elementEnd('body'); + $this->elementEnd('html'); common_end_xml(); } @@ -545,13 +544,13 @@ class Action extends HTMLOutputter // lawsuit if ($is_selected) { $lattrs['class'] = 'current'; } - common_element_start('li', $lattrs); + $this->elementStart('li', $lattrs); $attrs['href'] = $url; if ($title) { $attrs['title'] = $title; } - common_element('a', $attrs, $text); - common_element_end('li'); + $this->element('a', $attrs, $text); + $this->elementEnd('li'); } // Does a little before-after block for next/prev page -- cgit v1.2.3-54-g00ecf From 24d8814bc59276d5f10b57086973911d413fa305 Mon Sep 17 00:00:00 2001 From: sarven Date: Wed, 14 Jan 2009 08:44:23 +0000 Subject: Updated: showHeader() -- incomplete showPrimaryNav() -- should be updated when common_menu_item() is redone/fixed showSiteNotice() showLocalNav() -- needs a revisit for common_menu_item() showContentBlock -- needs a revisit for basic pages showPageNotice() showContent() -- inner should be opened for content showFooter() showLicenses() showLaconicaLicense() showContentLicense() common_menu_item() -- Added @id for list-items. Revisit. pagination() Needs attention for common_menu_item() and then they can be removed: nav_menu common_show_header() --- lib/action.php | 125 +++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 85 insertions(+), 40 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 55d3b8221..96d2a8798 100644 --- a/lib/action.php +++ b/lib/action.php @@ -178,12 +178,23 @@ class Action extends HTMLOutputter // lawsuit function showHeader() { - // start header div stuff + $this->elementStart('div', array('id' => 'header')); $this->showLogo(); + +// common_element('h1', 'pagetitle', $pagetitle); + + if ($headercall) { + if ($data) { + call_user_func($headercall, $data); + } else { + call_user_func($headercall); + } + } + //common_nav_menu(); $this->showPrimaryNav(); $this->showSiteNotice(); $this->showNoticeForm(); - // end header div stuff + $this->elementEnd('div'); } function showLogo() @@ -198,15 +209,17 @@ class Action extends HTMLOutputter // lawsuit $this->element('img', array('class' => 'logo photo', 'src' => isset($config['site']['logo']) ? ($config['site']['logo']) : theme_path('logo.png'), - 'alt' => $config['site']['name']); + 'alt' => $config['site']['name'])); } - $this->element('span', array('class' => 'fn org'), $config['site']['name'])); + $this->element('span', array('class' => 'fn org'), $config['site']['name']); $this->elementEnd('a'); $this->elementEnd('address'); } function showPrimaryNav() { + $this->elementStart('dl', array('id' => 'site_nav_global_primary')); + $this->element('dt', null, _('Primary site navigation')); $user = common_current_user(); $this->elementStart('ul', array('id' => 'nav')); if ($user) { @@ -231,11 +244,19 @@ class Action extends HTMLOutputter // lawsuit common_menu_item(common_local_url('doc', array('title' => 'help')), _('Help')); $this->elementEnd('ul'); + $this->elementEnd('dl'); } + + // Revist. Should probably do an hAtom pattern here function showSiteNotice() { - // show the site notice here + $this->elementStart('dl', array('id' => 'site_notice', + 'class' => 'system_notice')); + $this->element('dt', null, _('Site notice')); + $this->elementStart('dd', null); + // Output a bunch of paragraphs here + $this->elementEnd('dd'); } // MAY overload if no notice form needed... or direct message box???? @@ -254,17 +275,35 @@ class Action extends HTMLOutputter // lawsuit // end core div } - // SHOULD overload + // SHOULD overload (perhaps this should be a MUST because sometimes it is not used) - function showLocalNav() + function showLocalNav($menu) { + $action = $this->trimmed('action'); + + $this->elementStart('dl', array('id' => 'site_nav_local_views')); + $this->element('dt', null, _('Local views')); + $this->elementStart('ul', array('id' => 'nav')); + foreach ($menu as $menuaction => $menudesc) { + common_menu_item(common_local_url($menuaction, + isset($menudesc[2]) ? $menudesc[2] : null), + $menudesc[0], + $menudesc[1], + $action == $menuaction); + } + $this->elementEnd('ul'); + $this->elementEnd('dd'); + $this->elementEnd('dl'); } function showContentBlock() { + $this->elementStart('div', array('id' => 'content', + (is_null("basic single content page e.g., about")) ? null : 'class' => 'hentry')); $this->showPageTitle(); $this->showPageNotice(); $this->showContent(); + $this->elementEnd('div'); } function showPageTitle() { @@ -275,7 +314,12 @@ class Action extends HTMLOutputter // lawsuit function showPageNotice() { - // output page notice div + $this->elementStart('dl', array('id' => 'page_notice', + 'class' => 'system_notice')); + $this->element('dt', null, _('Page notice')); + $this->elementStart('dd', null); + // Output a bunch of paragraphs here + $this->elementEnd('dd'); } // MUST overload @@ -283,6 +327,9 @@ class Action extends HTMLOutputter // lawsuit function showContent() { // show the actual content (forms, lists, whatever) + $this->elementStart('div', array('id' => 'content_inner', + (is_null("basic single content page e.g., about")) ? null : 'class' => 'entry-content')); + $this->elementEnd('div'); } function showAside() @@ -308,9 +355,10 @@ class Action extends HTMLOutputter // lawsuit function showFooter() { - // start footer div + $this->elementStart('div', array('id' => 'footer')); $this->showSecondaryNav(); $this->showLicenses(); + $this->elementEnd('div'); } function showSecondaryNav() @@ -333,15 +381,16 @@ class Action extends HTMLOutputter // lawsuit function showLicenses() { - // start license dl + $this->elementStart('dl', array('id' => 'licenses')); $this->showLaconicaLicense(); $this->showContentLicense(); - // end license dl + $this->elementEnd('dl'); } function showLaconicaLicense() { - $this->elementStart('div', 'laconica'); + $this->element('dt', array('id' => 'site_laconica_license'), _('Laconica software license')); + $this->elementStart('dd', null); if (common_config('site', 'broughtby')) { $instr = _('**%%site.name%%** is a microblogging service brought to you by [%%site.broughtby%%](%%site.broughtbyurl%%). '); } else { @@ -350,25 +399,26 @@ class Action extends HTMLOutputter // lawsuit $instr .= sprintf(_('It runs the [Laconica](http://laconi.ca/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), LACONICA_VERSION); $output = common_markup_to_html($instr); common_raw($output); - $this->elementEnd('div'); + $this->elementEnd('dd'); // do it } function showContentLicense() { - $this->elementStart('div', array('id' => 'footer')); - $this->element('img', array('id' => 'cc', - 'src' => $config['license']['image'], - 'alt' => $config['license']['title'])); + $this->element('dt', array('id' => 'site_content_license'), _('Laconica software license')); + $this->elementStart('dd', array('id' => 'site_content_license_cc')); $this->elementStart('p'); common_text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the ')); $this->element('a', array('class' => 'license', - 'rel' => 'license', + 'rel' => 'external license', 'href' => $config['license']['url']), $config['license']['title']); common_text(_('. Contributors should be attributed by full name or nickname.')); $this->elementEnd('p'); - $this->elementEnd('div'); + $this->element('img', array('id' => 'license_cc', + 'src' => $config['license']['image'], + 'alt' => $config['license']['title'])); + $this->elementEnd('dd'); } // For comparison with If-Last-Modified @@ -511,19 +561,6 @@ class Action extends HTMLOutputter // lawsuit $this->elementEnd('head'); $this->elementStart('body', $action); $this->elementStart('div', array('id' => 'wrap')); - $this->elementStart('div', array('id' => 'header')); - common_nav_menu(); - - $this->element('h1', 'pagetitle', $pagetitle); - - if ($headercall) { - if ($data) { - call_user_func($headercall, $data); - } else { - call_user_func($headercall); - } - } - $this->elementEnd('div'); $this->elementStart('div', array('id' => 'content')); } @@ -538,13 +575,16 @@ class Action extends HTMLOutputter // lawsuit common_end_xml(); } - function common_menu_item($url, $text, $title=null, $is_selected=false) + + // Added @id to li for some control. We might want to move this to htmloutputter.php + function common_menu_item($id=null, $url, $text, $title=null, $is_selected=false) { $lattrs = array(); if ($is_selected) { $lattrs['class'] = 'current'; } - $this->elementStart('li', $lattrs); + + $this->elementStart('li', (is_null($id)) ? null : array('id' => $id), $lattrs); $attrs['href'] = $url; if ($title) { $attrs['title'] = $title; @@ -558,31 +598,36 @@ class Action extends HTMLOutputter // lawsuit function pagination($have_before, $have_after, $page, $action, $args=null) { if ($have_before || $have_after) { - $this->elementStart('div', array('id' => 'pagination')); - $this->elementStart('ul', array('id' => 'nav_pagination')); + $this->elementStart('div', array('class' => 'pagination')); + $this->elementStart('dl', null); + $this->element('dt', null, _('Pagination')); + $this->elementStart('dd', null); + $this->elementStart('ul', array('class' => 'nav')); } if ($have_before) { $pargs = array('page' => $page-1); $newargs = ($args) ? array_merge($args,$pargs) : $pargs; - $this->elementStart('li', 'before'); + $this->elementStart('li', array('class' => 'nav_prev')); $this->element('a', array('href' => common_local_url($action, $newargs), 'rel' => 'prev'), - _('« After')); + _('After')); $this->elementEnd('li'); } if ($have_after) { $pargs = array('page' => $page+1); $newargs = ($args) ? array_merge($args,$pargs) : $pargs; - $this->elementStart('li', 'after'); + $this->elementStart('li', array('class' => 'nav_next')); $this->element('a', array('href' => common_local_url($action, $newargs), 'rel' => 'next'), - _('Before »')); + _('Before')); $this->elementEnd('li'); } if ($have_before || $have_after) { $this->elementEnd('ul'); + $this->elementEnd('dd'); + $this->elementEnd('dl'); $this->elementEnd('div'); } } -- cgit v1.2.3-54-g00ecf From efe9d28efa3ce03799e0e0dcd5cca52e3862bfe9 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 14 Jan 2009 12:01:53 -0500 Subject: Add notice form --- lib/action.php | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 96d2a8798..bca6a0e3c 100644 --- a/lib/action.php +++ b/lib/action.php @@ -32,6 +32,9 @@ if (!defined('LACONICA')) { exit(1); } +require_once INSTALLDIR.'/lib/form.php'; +require_once INSTALLDIR.'/lib/htmloutputter.php'; + /** * Base class for all actions * @@ -180,17 +183,6 @@ class Action extends HTMLOutputter // lawsuit { $this->elementStart('div', array('id' => 'header')); $this->showLogo(); - -// common_element('h1', 'pagetitle', $pagetitle); - - if ($headercall) { - if ($data) { - call_user_func($headercall, $data); - } else { - call_user_func($headercall); - } - } - //common_nav_menu(); $this->showPrimaryNav(); $this->showSiteNotice(); $this->showNoticeForm(); @@ -219,7 +211,7 @@ class Action extends HTMLOutputter // lawsuit function showPrimaryNav() { $this->elementStart('dl', array('id' => 'site_nav_global_primary')); - $this->element('dt', null, _('Primary site navigation')); + $this->element('dt', null, _('Primary site navigation')); $user = common_current_user(); $this->elementStart('ul', array('id' => 'nav')); if ($user) { @@ -247,7 +239,6 @@ class Action extends HTMLOutputter // lawsuit $this->elementEnd('dl'); } - // Revist. Should probably do an hAtom pattern here function showSiteNotice() { @@ -263,7 +254,8 @@ class Action extends HTMLOutputter // lawsuit function showNoticeForm() { - // show the notice form here + $notice_form = new NoticeForm(); + $notice_form->show(); } function showCore() @@ -275,14 +267,14 @@ class Action extends HTMLOutputter // lawsuit // end core div } - // SHOULD overload (perhaps this should be a MUST because sometimes it is not used) + // SHOULD overload (perhaps this should be a MUST because sometimes it is not used) function showLocalNav($menu) { $action = $this->trimmed('action'); - + $this->elementStart('dl', array('id' => 'site_nav_local_views')); - $this->element('dt', null, _('Local views')); + $this->element('dt', null, _('Local views')); $this->elementStart('ul', array('id' => 'nav')); foreach ($menu as $menuaction => $menudesc) { common_menu_item(common_local_url($menuaction, @@ -389,7 +381,7 @@ class Action extends HTMLOutputter // lawsuit function showLaconicaLicense() { - $this->element('dt', array('id' => 'site_laconica_license'), _('Laconica software license')); + $this->element('dt', array('id' => 'site_laconica_license'), _('Laconica software license')); $this->elementStart('dd', null); if (common_config('site', 'broughtby')) { $instr = _('**%%site.name%%** is a microblogging service brought to you by [%%site.broughtby%%](%%site.broughtbyurl%%). '); @@ -405,7 +397,7 @@ class Action extends HTMLOutputter // lawsuit function showContentLicense() { - $this->element('dt', array('id' => 'site_content_license'), _('Laconica software license')); + $this->element('dt', array('id' => 'site_content_license'), _('Laconica software license')); $this->elementStart('dd', array('id' => 'site_content_license_cc')); $this->elementStart('p'); common_text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the ')); @@ -575,7 +567,6 @@ class Action extends HTMLOutputter // lawsuit common_end_xml(); } - // Added @id to li for some control. We might want to move this to htmloutputter.php function common_menu_item($id=null, $url, $text, $title=null, $is_selected=false) { @@ -583,7 +574,7 @@ class Action extends HTMLOutputter // lawsuit if ($is_selected) { $lattrs['class'] = 'current'; } - + $this->elementStart('li', (is_null($id)) ? null : array('id' => $id), $lattrs); $attrs['href'] = $url; if ($title) { @@ -600,7 +591,7 @@ class Action extends HTMLOutputter // lawsuit if ($have_before || $have_after) { $this->elementStart('div', array('class' => 'pagination')); $this->elementStart('dl', null); - $this->element('dt', null, _('Pagination')); + $this->element('dt', null, _('Pagination')); $this->elementStart('dd', null); $this->elementStart('ul', array('class' => 'nav')); } -- cgit v1.2.3-54-g00ecf From f8b758932442cf468167e7b317d67162b6fac561 Mon Sep 17 00:00:00 2001 From: sarven Date: Wed, 14 Jan 2009 17:26:23 +0000 Subject: showBody() -- revisit to add @id and @class to showContentBlock() showContent() added endHTML() to class HTMLOutputter --- lib/action.php | 26 ++++++++------------------ lib/htmloutputter.php | 13 +++++++++++++ 2 files changed, 21 insertions(+), 18 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index bca6a0e3c..85042871e 100644 --- a/lib/action.php +++ b/lib/action.php @@ -172,11 +172,13 @@ class Action extends HTMLOutputter // lawsuit function showBody() { - // output body - // output wrap element + $this->elementStart('body'); + $this->elementStart('wrap'); $this->showHeader(); $this->showCore(); $this->showFooter(); + $this->elementEnd('wrap'); + $this->elementEnd('body'); } function showHeader() @@ -260,11 +262,11 @@ class Action extends HTMLOutputter // lawsuit function showCore() { - // start core div + $this->elementStart('div' array('class' => 'core')); $this->showLocalNav(); $this->showContentBlock(); $this->showAside(); - // end core div + $this->elementEnd('div'); } // SHOULD overload (perhaps this should be a MUST because sometimes it is not used) @@ -290,8 +292,7 @@ class Action extends HTMLOutputter // lawsuit function showContentBlock() { - $this->elementStart('div', array('id' => 'content', - (is_null("basic single content page e.g., about")) ? null : 'class' => 'hentry')); + $this->elementStart('div', array('id' => 'content')); $this->showPageTitle(); $this->showPageNotice(); $this->showContent(); @@ -319,8 +320,7 @@ class Action extends HTMLOutputter // lawsuit function showContent() { // show the actual content (forms, lists, whatever) - $this->elementStart('div', array('id' => 'content_inner', - (is_null("basic single content page e.g., about")) ? null : 'class' => 'entry-content')); + $this->elementStart('div', array('id' => 'content_inner')); $this->elementEnd('div'); } @@ -556,16 +556,6 @@ class Action extends HTMLOutputter // lawsuit $this->elementStart('div', array('id' => 'content')); } - function common_show_footer() - { - global $xw, $config; - $this->elementEnd('div'); // content div - common_foot_menu(); - $this->elementEnd('div'); - $this->elementEnd('body'); - $this->elementEnd('html'); - common_end_xml(); - } // Added @id to li for some control. We might want to move this to htmloutputter.php function common_menu_item($id=null, $url, $text, $title=null, $is_selected=false) diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 095f4d478..43e4a59a9 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -122,6 +122,19 @@ class HTMLOutputter extends XMLOutputter 'lang' => $language)); } + + /** + * Ends an HTML document + * + * @return void + */ + function endHTML() + { + $this->elementEnd('html'); + $this->endXML(); + } + + /** * Output an HTML text input element * -- cgit v1.2.3-54-g00ecf From b72322b9e786a0e1fd0eecb2705fee0bf470ac8a Mon Sep 17 00:00:00 2001 From: sarven Date: Wed, 14 Jan 2009 17:30:03 +0000 Subject: Parse error fix --- lib/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 85042871e..0419828b3 100644 --- a/lib/action.php +++ b/lib/action.php @@ -262,7 +262,7 @@ class Action extends HTMLOutputter // lawsuit function showCore() { - $this->elementStart('div' array('class' => 'core')); + $this->elementStart('div', array('class' => 'core')); $this->showLocalNav(); $this->showContentBlock(); $this->showAside(); -- cgit v1.2.3-54-g00ecf From 3ce62aae1b1a0e176db32fac142218f05bc57731 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 14 Jan 2009 13:57:29 -0500 Subject: Add comment() method, have action use it --- lib/action.php | 5 ++--- lib/xmloutputter.php | 13 +++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 0419828b3..8d0fb2634 100644 --- a/lib/action.php +++ b/lib/action.php @@ -116,8 +116,8 @@ class Action extends HTMLOutputter // lawsuit foreach (array(6,7) as $ver) { if (file_exists(theme_file('ie'.$ver.'.css'))) { // Yes, IE people should be put in jail. - $xw->writeComment('[if lte IE '.$ver.']>comment('[if lte IE '.$ver.']>elementStart('div', array('id' => 'content')); } - // Added @id to li for some control. We might want to move this to htmloutputter.php function common_menu_item($id=null, $url, $text, $title=null, $is_selected=false) { diff --git a/lib/xmloutputter.php b/lib/xmloutputter.php index 5bbd35627..9ca0c91bd 100644 --- a/lib/xmloutputter.php +++ b/lib/xmloutputter.php @@ -226,4 +226,17 @@ class XMLOutputter { $this->xw->writeRaw($xml); } + + /** + * output a comment + * + * @param string $txt text of the comment + * + * @return void + */ + + function comment($txt) + { + $this->xw->writeComment($txt); + } } -- cgit v1.2.3-54-g00ecf From caaf237de8e07cecf9d1bbe20e98ca5c1a957f34 Mon Sep 17 00:00:00 2001 From: sarven Date: Wed, 14 Jan 2009 22:19:17 +0000 Subject: Base theme stylesheet includes layout, and typography information Identica theme stylesheet includes colour and background information --- lib/action.php | 10 +- theme/base/css/display.css | 1081 ++++++++++++++++++++ theme/base/css/initial_states.css | 1 + theme/base/css/jquery.Jcrop.css | 45 + theme/base/css/thickbox.css | 163 +++ theme/base/images/icons/icon_atom.jpg | Bin 0 -> 1117 bytes theme/base/images/icons/icon_foaf.gif | Bin 0 -> 1144 bytes theme/base/images/icons/icon_rss.jpg | Bin 0 -> 1166 bytes theme/base/images/icons/icon_vcard.gif | Bin 0 -> 331 bytes theme/base/images/illustrations/illu_jcrop.gif | Bin 0 -> 329 bytes .../illustrations/illu_progress_loading-01.gif | Bin 0 -> 5886 bytes theme/identica/css/display.css | 226 ++++ theme/identica/images/icons/icon_atom.jpg | Bin 0 -> 1117 bytes theme/identica/images/icons/icon_foaf.gif | Bin 0 -> 1144 bytes theme/identica/images/icons/icon_rss.jpg | Bin 0 -> 1166 bytes theme/identica/images/icons/icon_vcard.gif | Bin 0 -> 331 bytes .../images/icons/twotone/green/against.gif | Bin 0 -> 85 bytes .../images/icons/twotone/green/arrow-down.gif | Bin 0 -> 75 bytes .../images/icons/twotone/green/arrow-downleft.gif | Bin 0 -> 75 bytes .../images/icons/twotone/green/arrow-downright.gif | Bin 0 -> 75 bytes .../images/icons/twotone/green/arrow-left.gif | Bin 0 -> 73 bytes .../images/icons/twotone/green/arrow-right.gif | Bin 0 -> 74 bytes .../images/icons/twotone/green/arrow-up.gif | Bin 0 -> 74 bytes .../images/icons/twotone/green/arrow-upleft.gif | Bin 0 -> 75 bytes .../images/icons/twotone/green/arrow-upright.gif | Bin 0 -> 73 bytes .../images/icons/twotone/green/back-forth.gif | Bin 0 -> 79 bytes .../images/icons/twotone/green/bookmark.gif | Bin 0 -> 82 bytes theme/identica/images/icons/twotone/green/bulb.gif | Bin 0 -> 83 bytes .../images/icons/twotone/green/calendar.gif | Bin 0 -> 83 bytes .../images/icons/twotone/green/calendar2.gif | Bin 0 -> 79 bytes .../identica/images/icons/twotone/green/camera.gif | Bin 0 -> 79 bytes theme/identica/images/icons/twotone/green/cart.gif | Bin 0 -> 86 bytes .../images/icons/twotone/green/caution.gif | Bin 0 -> 82 bytes .../identica/images/icons/twotone/green/chart.gif | Bin 0 -> 81 bytes .../images/icons/twotone/green/checkmark.gif | Bin 0 -> 76 bytes .../images/icons/twotone/green/clipboard.gif | Bin 0 -> 80 bytes .../identica/images/icons/twotone/green/clock.gif | Bin 0 -> 81 bytes .../images/icons/twotone/green/closed-folder.gif | Bin 0 -> 78 bytes .../images/icons/twotone/green/database.gif | Bin 0 -> 82 bytes .../images/icons/twotone/green/diskette.gif | Bin 0 -> 85 bytes .../images/icons/twotone/green/document.gif | Bin 0 -> 81 bytes .../images/icons/twotone/green/double-arrow.gif | Bin 0 -> 78 bytes theme/identica/images/icons/twotone/green/edit.gif | Bin 0 -> 75 bytes .../identica/images/icons/twotone/green/eject.gif | Bin 0 -> 73 bytes .../images/icons/twotone/green/exclaim.gif | Bin 0 -> 74 bytes .../images/icons/twotone/green/fastforward.gif | Bin 0 -> 77 bytes .../images/icons/twotone/green/favourite.gif | Bin 0 -> 73 bytes theme/identica/images/icons/twotone/green/flag.gif | Bin 0 -> 80 bytes .../identica/images/icons/twotone/green/graph.gif | Bin 0 -> 82 bytes theme/identica/images/icons/twotone/green/grow.gif | Bin 0 -> 90 bytes .../images/icons/twotone/green/headphones.gif | Bin 0 -> 78 bytes theme/identica/images/icons/twotone/green/home.gif | Bin 0 -> 81 bytes .../images/icons/twotone/green/hourglass.gif | Bin 0 -> 85 bytes theme/identica/images/icons/twotone/green/info.gif | Bin 0 -> 73 bytes theme/identica/images/icons/twotone/green/key.gif | Bin 0 -> 76 bytes theme/identica/images/icons/twotone/green/lock.gif | Bin 0 -> 83 bytes theme/identica/images/icons/twotone/green/mail.gif | Bin 0 -> 82 bytes theme/identica/images/icons/twotone/green/move.gif | Bin 0 -> 80 bytes .../identica/images/icons/twotone/green/music.gif | Bin 0 -> 80 bytes theme/identica/images/icons/twotone/green/news.gif | Bin 0 -> 76 bytes theme/identica/images/icons/twotone/green/note.gif | Bin 0 -> 82 bytes .../images/icons/twotone/green/open-folder.gif | Bin 0 -> 79 bytes .../images/icons/twotone/green/paper-clip.gif | Bin 0 -> 78 bytes .../images/icons/twotone/green/paper-clip2.gif | Bin 0 -> 80 bytes .../identica/images/icons/twotone/green/pause.gif | Bin 0 -> 75 bytes .../identica/images/icons/twotone/green/phone.gif | Bin 0 -> 79 bytes theme/identica/images/icons/twotone/green/play.gif | Bin 0 -> 75 bytes theme/identica/images/icons/twotone/green/plus.gif | Bin 0 -> 74 bytes .../identica/images/icons/twotone/green/print.gif | Bin 0 -> 85 bytes .../images/icons/twotone/green/question-mark.gif | Bin 0 -> 74 bytes .../identica/images/icons/twotone/green/quote.gif | Bin 0 -> 79 bytes .../images/icons/twotone/green/refresh.gif | Bin 0 -> 82 bytes .../identica/images/icons/twotone/green/rewind.gif | Bin 0 -> 77 bytes .../identica/images/icons/twotone/green/search.gif | Bin 0 -> 76 bytes .../identica/images/icons/twotone/green/shield.gif | Bin 0 -> 85 bytes .../images/icons/twotone/green/skip-back.gif | Bin 0 -> 76 bytes theme/identica/images/icons/twotone/green/skip.gif | Bin 0 -> 78 bytes .../identica/images/icons/twotone/green/skull.gif | Bin 0 -> 85 bytes .../images/icons/twotone/green/statusbar.gif | Bin 0 -> 82 bytes theme/identica/images/icons/twotone/green/stop.gif | Bin 0 -> 72 bytes .../images/icons/twotone/green/template.gif | Bin 0 -> 81 bytes .../images/icons/twotone/green/text-bigger.gif | Bin 0 -> 82 bytes .../images/icons/twotone/green/text-smaller.gif | Bin 0 -> 80 bytes .../identica/images/icons/twotone/green/trash.gif | Bin 0 -> 77 bytes .../images/icons/twotone/green/two-docs.gif | Bin 0 -> 83 bytes .../images/icons/twotone/green/twotone.gif | Bin 0 -> 2461 bytes theme/identica/images/icons/twotone/green/undo.gif | Bin 0 -> 79 bytes theme/identica/images/icons/twotone/green/user.gif | Bin 0 -> 77 bytes .../images/icons/twotone/green/vegetable.gif | Bin 0 -> 82 bytes theme/identica/images/icons/twotone/green/x.gif | Bin 0 -> 79 bytes .../images/icons/twotone/green/zoom-in.gif | Bin 0 -> 86 bytes .../images/icons/twotone/green/zoom-out.gif | Bin 0 -> 85 bytes theme/identica/logo.png | Bin 818 -> 2059 bytes 93 files changed, 1525 insertions(+), 1 deletion(-) create mode 100644 theme/base/css/display.css create mode 100644 theme/base/css/initial_states.css create mode 100644 theme/base/css/jquery.Jcrop.css create mode 100644 theme/base/css/thickbox.css create mode 100644 theme/base/images/icons/icon_atom.jpg create mode 100644 theme/base/images/icons/icon_foaf.gif create mode 100644 theme/base/images/icons/icon_rss.jpg create mode 100644 theme/base/images/icons/icon_vcard.gif create mode 100644 theme/base/images/illustrations/illu_jcrop.gif create mode 100644 theme/base/images/illustrations/illu_progress_loading-01.gif create mode 100644 theme/identica/css/display.css create mode 100644 theme/identica/images/icons/icon_atom.jpg create mode 100644 theme/identica/images/icons/icon_foaf.gif create mode 100644 theme/identica/images/icons/icon_rss.jpg create mode 100644 theme/identica/images/icons/icon_vcard.gif create mode 100644 theme/identica/images/icons/twotone/green/against.gif create mode 100644 theme/identica/images/icons/twotone/green/arrow-down.gif create mode 100644 theme/identica/images/icons/twotone/green/arrow-downleft.gif create mode 100644 theme/identica/images/icons/twotone/green/arrow-downright.gif create mode 100644 theme/identica/images/icons/twotone/green/arrow-left.gif create mode 100644 theme/identica/images/icons/twotone/green/arrow-right.gif create mode 100644 theme/identica/images/icons/twotone/green/arrow-up.gif create mode 100644 theme/identica/images/icons/twotone/green/arrow-upleft.gif create mode 100644 theme/identica/images/icons/twotone/green/arrow-upright.gif create mode 100644 theme/identica/images/icons/twotone/green/back-forth.gif create mode 100644 theme/identica/images/icons/twotone/green/bookmark.gif create mode 100644 theme/identica/images/icons/twotone/green/bulb.gif create mode 100644 theme/identica/images/icons/twotone/green/calendar.gif create mode 100644 theme/identica/images/icons/twotone/green/calendar2.gif create mode 100644 theme/identica/images/icons/twotone/green/camera.gif create mode 100644 theme/identica/images/icons/twotone/green/cart.gif create mode 100644 theme/identica/images/icons/twotone/green/caution.gif create mode 100644 theme/identica/images/icons/twotone/green/chart.gif create mode 100644 theme/identica/images/icons/twotone/green/checkmark.gif create mode 100644 theme/identica/images/icons/twotone/green/clipboard.gif create mode 100644 theme/identica/images/icons/twotone/green/clock.gif create mode 100644 theme/identica/images/icons/twotone/green/closed-folder.gif create mode 100644 theme/identica/images/icons/twotone/green/database.gif create mode 100644 theme/identica/images/icons/twotone/green/diskette.gif create mode 100644 theme/identica/images/icons/twotone/green/document.gif create mode 100644 theme/identica/images/icons/twotone/green/double-arrow.gif create mode 100644 theme/identica/images/icons/twotone/green/edit.gif create mode 100644 theme/identica/images/icons/twotone/green/eject.gif create mode 100644 theme/identica/images/icons/twotone/green/exclaim.gif create mode 100644 theme/identica/images/icons/twotone/green/fastforward.gif create mode 100644 theme/identica/images/icons/twotone/green/favourite.gif create mode 100644 theme/identica/images/icons/twotone/green/flag.gif create mode 100644 theme/identica/images/icons/twotone/green/graph.gif create mode 100644 theme/identica/images/icons/twotone/green/grow.gif create mode 100644 theme/identica/images/icons/twotone/green/headphones.gif create mode 100644 theme/identica/images/icons/twotone/green/home.gif create mode 100644 theme/identica/images/icons/twotone/green/hourglass.gif create mode 100644 theme/identica/images/icons/twotone/green/info.gif create mode 100644 theme/identica/images/icons/twotone/green/key.gif create mode 100644 theme/identica/images/icons/twotone/green/lock.gif create mode 100644 theme/identica/images/icons/twotone/green/mail.gif create mode 100644 theme/identica/images/icons/twotone/green/move.gif create mode 100644 theme/identica/images/icons/twotone/green/music.gif create mode 100644 theme/identica/images/icons/twotone/green/news.gif create mode 100644 theme/identica/images/icons/twotone/green/note.gif create mode 100644 theme/identica/images/icons/twotone/green/open-folder.gif create mode 100644 theme/identica/images/icons/twotone/green/paper-clip.gif create mode 100644 theme/identica/images/icons/twotone/green/paper-clip2.gif create mode 100644 theme/identica/images/icons/twotone/green/pause.gif create mode 100644 theme/identica/images/icons/twotone/green/phone.gif create mode 100644 theme/identica/images/icons/twotone/green/play.gif create mode 100644 theme/identica/images/icons/twotone/green/plus.gif create mode 100644 theme/identica/images/icons/twotone/green/print.gif create mode 100644 theme/identica/images/icons/twotone/green/question-mark.gif create mode 100644 theme/identica/images/icons/twotone/green/quote.gif create mode 100644 theme/identica/images/icons/twotone/green/refresh.gif create mode 100644 theme/identica/images/icons/twotone/green/rewind.gif create mode 100644 theme/identica/images/icons/twotone/green/search.gif create mode 100644 theme/identica/images/icons/twotone/green/shield.gif create mode 100644 theme/identica/images/icons/twotone/green/skip-back.gif create mode 100644 theme/identica/images/icons/twotone/green/skip.gif create mode 100644 theme/identica/images/icons/twotone/green/skull.gif create mode 100644 theme/identica/images/icons/twotone/green/statusbar.gif create mode 100644 theme/identica/images/icons/twotone/green/stop.gif create mode 100644 theme/identica/images/icons/twotone/green/template.gif create mode 100644 theme/identica/images/icons/twotone/green/text-bigger.gif create mode 100644 theme/identica/images/icons/twotone/green/text-smaller.gif create mode 100644 theme/identica/images/icons/twotone/green/trash.gif create mode 100644 theme/identica/images/icons/twotone/green/two-docs.gif create mode 100644 theme/identica/images/icons/twotone/green/twotone.gif create mode 100644 theme/identica/images/icons/twotone/green/undo.gif create mode 100644 theme/identica/images/icons/twotone/green/user.gif create mode 100644 theme/identica/images/icons/twotone/green/vegetable.gif create mode 100644 theme/identica/images/icons/twotone/green/x.gif create mode 100644 theme/identica/images/icons/twotone/green/zoom-in.gif create mode 100644 theme/identica/images/icons/twotone/green/zoom-out.gif (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 8d0fb2634..8694bf47c 100644 --- a/lib/action.php +++ b/lib/action.php @@ -111,7 +111,15 @@ class Action extends HTMLOutputter // lawsuit { $this->element('link', array('rel' => 'stylesheet', 'type' => 'text/css', - 'href' => theme_path('display.css') . '?version=' . LACONICA_VERSION, + 'href' => theme_path('display.css', 'base') . '?version=' . LACONICA_VERSION, + 'media' => 'screen, projection, tv')); + $this->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => theme_path('thickbox.css', 'base') . '?version=' . LACONICA_VERSION, + 'media' => 'screen, projection, tv')); + $this->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => theme_path('display.css', null) . '?version=' . LACONICA_VERSION, 'media' => 'screen, projection, tv')); foreach (array(6,7) as $ver) { if (file_exists(theme_file('ie'.$ver.'.css'))) { diff --git a/theme/base/css/display.css b/theme/base/css/display.css new file mode 100644 index 000000000..5fc24779b --- /dev/null +++ b/theme/base/css/display.css @@ -0,0 +1,1081 @@ +/* theme: base */ +* { margin:0; padding:0; } +img { display:block; border:0; } +a abbr { cursor: pointer; border-bottom:0; } +table { border-collapse:collapse; } +ol { list-style-position:inside; } +html { font-size: 87.5%; background-color:#fff; height:100%; } +body { +background-color:#fff; +color:#000; +font-family:sans-serif; +font-size:1em; +line-height:1.65; +position:relative; +margin:0 auto; +width:1004px; +width:71.714em; +max-width:100%; +} +h1 { +font-size:2.1em; +line-height:1.1; +margin-bottom:0.25em; +} +h2 { font-size:1.3em; } +h3 { font-size:1.2em; } +h4 { font-size:1.1em; } +h5 { font-size:1em; } +h6 { font-size:0.9em; } +h1,h2,h3,h4,h5,h6 { + text-transform:uppercase; + margin-bottom:7px; +} +legend { font-weight:bold; } +input, textarea, select, option { +padding:4px; +font-family:sans-serif; +font-size:1em; +-moz-border:radius:4px; +} +select, option { +padding-bottom:0; +} +fieldset { +padding:11px; +} +input:focus, textarea:focus, select:focus { +border-width:2px; +border-style: solid; +-moz-border:radius:4px; +} +caption { +font-weight:bold; +} +.opened { display: block !important;} +.closed { display: none !important;} +span.required { font-weight:bold; } +form ul li { +list-style-type:none; +margin:0 0 18px 0; +} +form label { +font-weight:bold; +/*margin:0 0 11px 0;*/ +} +form ul li input { +} +form .error { +margin-right:11px; +} +form label.submit { +display:none; +} +form .error_message { +display:block; +} +.form_response { +margin-bottom:18px; +} +.form_response dt { +} +.form_response dd { +} + +form input.remove, +form input.submit { +-moz-border-radius:4px; +} +form input.submit { +} + + + + +/* FORM SETTINGS */ +.form_settings fieldset { +padding:0; +border:0; +} +.form_settings legend { +display:none; +} +.form_settings .form_datas label { +display:block; +} + +.form_guide { +font-style:italic; +} + +.form_settings .form_actions label { +display:none; +} + +.form_settings #settings_autosubscribe label { +display:inline; +font-weight:bold; +} + + + +/* FORM SETTINGS */ + + + + +address { +float:left; +margin-bottom:18px; +} +address .fn, +address .email { +display:none; +} + + + +#header { +width:100%; +position:relative; +float:left; +padding-top:18px; +margin-bottom:29px; +} + +#site_nav_global_primary { +float:right; +} +#site_nav_global_primary ul li { +display:inline; +margin-left:11px; +} + + +.system_notice dt { +font-weight:bold; +text-transform:uppercase; +display:none; +} + +#site_notice { +position:absolute; +right:0; +top:49px; +float:right; +width:322px; +} +#page_notice { +clear:both; +margin-bottom:18px; +} + + + + +#footer { +float:left; +width:100%; +padding-bottom:11px; +} + + + +#site_nav_local_views { +width:100%; +float:left; +} +#site_nav_local_views dt { +display:none; +} +#site_nav_local_views li { +float:left; +margin-right:18px; +list-style-type:none; +} +#site_nav_local_views a { +float:left; +text-decoration:none; +padding:4px 11px; +-moz-border-radius-topleft:4px; +-moz-border-radius-topright:4px; +border-width:1px; +border-style:dashed; +border-bottom:0; +} +#site_nav_local_views .nav { +float:left; +width:100%; +} + + +#site_nav_global_primary dt, +#site_nav_global_secondary dt { +display:none; +} +/* +#site_nav_global_primary .current a { +font-weight:bold; +border-style:solid; +} +*/ +#site_nav_global_secondary { +margin-bottom:11px; +} + +#site_nav_global_secondary ul li { +display:inline; +margin-right:11px; +} +#export_data li a { +padding-left:20px; +} +#export_data li a.foaf { +padding-left:30px; +} +#export_data li a.export_vcard { +padding-left:28px; +} + + + +#export_data ul { +display:inline; +} +#export_data li { +list-style-type:none; +display:inline; +margin-left:11px; +} +#export_data li:first-child { +margin-left:0; +} + + + + +#licenses dt { +font-weight:bold; +display:none; +} +#licenses dd { +margin-bottom:11px; +} + + +#site_content_license_cc p { +float:left; +margin-left:10%; +width:90%; +} +#site_content_license_cc img { +float:left; +margin-left:-100%; +} + + +#wrap { + float:left; + margin:0 auto; + width:1004px; + width:71.714em; +} + + +#core { +position:relative; +width:100%; +float:left; +margin-bottom:1em; +} + +#content { +width:644px; +padding:18px; +float:left; +-moz-border-radius:7px; +-moz-border-radius-topleft:0; +} + +#content_inner { +position:relative; +} + +#supplemental_primary { +width:300px; +float:left; +margin-left:2px; +padding:18px 4px 18px 18px; +-moz-border-radius:7px; +} + + + + +/*Start: FORM NOTICE*/ +#form_notice { +width:384px; +float:left; +margin-left:86px; +position:relative; +line-height:1; +} +#form_notice fieldset { +border:0; +padding:0; +} +#form_notice legend { +display:none; +} +#form_notice textarea { +-moz-border-radius:4px; +width:304px; +height:95px; +line-height:1.5; +padding:7px 7px 14px 7px; +} +#form_notice label { +display:block; +font-size:1.3em; +margin-bottom:7px; +} +#form_notice .form_datas li { +float:left; +} + +#form_notice #notice_attach_file label, +#form_notice #notice_submit label { +display:none; +} + +#form_notice #notice_attachment { +margin-top:25px; +margin-left:4px; +} + +#form_notice .form_note { +position:absolute; +top:125px; +right:98px; +z-index:9; +} + +#form_notice .form_note dt { +font-weight:bold; +display:none; +} +#notice_text-count { +font-weight:bold; +line-height:1.15; +} + +#form_notice #notice_data-attach_view { +/*position:absolute;*/ +top:25px; +right:30px; +margin-left:4px; +padding:0; +cursor:pointer; +width:16px; +height:16px; +border:0; +text-indent:-9999px; +} +#form_notice .form_actions { +position:absolute; +top:107px; +right:0; +} +#form_notice li { +margin-bottom:0; +} +/*end FORM NOTICE*/ + + + + + +/* user_profile */ +#user_profile { +position:relative; +width:633px; +min-height:123px; +float:left; +margin-bottom:17px; +margin-left:0; +} +#user_profile dt, +#user_statistics dt { +font-weight:bold; +} +#user_profile .user_depiction { +float:left; +position:absolute; +top:0; +left:0; +width:96px; +} +#user_profile .user_fn, +#user_profile .user_nickname, +#user_profile .user_location, +#user_profile .user_url, +#user_profile .user_note, +#user_profile .user_tags { +float:left; +clear:left; +margin-left:125px; +width:322px; +margin-bottom:4px; +} + +#user_profile .user_fn, +#user_profile .user_nickname { +width:auto; +clear:none; +} +#user_profile .user_nickname { +margin-left:11px; +} +#user_profile .user_nickname .nickname { +font-style:italic; +font-weight:bold; +margin-left:4px; +margin-right:4px; +} + +#user_profile .user_nickname dd:before { +content: "("; +} +#user_profile .user_nickname dd:after { +content: ")"; +} + +#user_profile dt { +display:none; +} +#user_profile h2 { +display:none; +} +/* user_profile */ + +/*user_actions*/ +#user_actions { +clear:left; +float:left; +position:absolute; +top:0; +right:0; +} +#user_actions h2 { +display:none; +} +#user_actions ul { +list-style-type:none; +} +#user_actions li { +border-top-width:1px; +border-top-style:dotted; +} +#user_actions li:first-child { +border-top:0; +} +#user_actions fieldset { +border:0; +padding:0; +} +#user_actions legend { +display:none; +} + +#user_actions a, +#user_actions input.submit { +display:block; +text-align:left; +padding:4px 0 4px 19px; +} +#user_actions a { +text-decoration:none; +} +#user_subscribe a, +#TB_window input.submit, +#user_actions input.submit { +border:0; +cursor:pointer; +padding-left:16px; +width:100%; +font-size:0.9em; +} + +#user_subscribe a { +width:auto; +padding-left:20px; +} + +#user_subscribe a, +#TB_window input.submit, +.form_user_subscribe input.submit { +font-weight:bold; +} + + + +#user_send-a-message form { +clear:left; +width:322px; +margin-top:18px; +} + +#user_send-a-message textarea { +width:96%; +} + +.user_tags ul { +list-style-type:none; +} +.user_tags li { +display:inline; +margin-right:1em; +float:left; +} + + + +.aside .section { +margin-bottom:29px; +clear:both; +} +.aside .section h2 { +text-transform:uppercase; +font-size:1em; +} + +#user_statistics dt, +#user_statistics dd { +display:inline; +} +#user_statistics dt:after { +content: ":"; +} + + +#user_subscriptions, +#user_subscriptions-common { +float:left; +} +#user_subscriptions ul.users { +width:220px; +float:left; +} +#user_subscriptions .users li { +list-style-type:none; +float:left; +margin-right:7px; +margin-bottom:7px; +} +#user_subscriptions .users li .photo { +width:24px; +height:24px; +margin-right:0; +} +#user_subscriptions .users li .fn { +display:none; +} +.aside .section .more { +clear:both; +} + + + + + +/* NOTICE */ +.notice { +position:relative; +padding-top:18px; +padding-bottom:18px; +clear:both; +float:left; +width:644px; +width:96.699%; +width:100%; +border-top:1px dashed #D1D9E4; +/*-moz-border-radius:7px;*/ +} +.notices li { +list-style-type:none; +/*margin-bottom:11px;*/ +} + + +/* NOTICES */ +#notices_primary { +float:left; +width:644px; +-moz-border-radius:7px; +} +#notices_primary h2 { +display:none; +} +.notice-data a span { +display:block; +padding-left:28px; +} + + +.notice .author { +float:left; +width:96px; +width:199px; +margin-left:-217px; +margin-left:-199px; +} +.notice .author a { +} +.notice .author:after { +content:":"; +} + +.vcard .photo { +display:inline; +margin-right:11px; +margin-right:4px; +vertical-align:top; +} +.vcard .url { +text-decoration:none; +} +.vcard .fn { +border-bottom-width:1px; +border-bottom-style:dotted; +font-style:italic; +} +.vcard .fn:hover { +border-bottom-width:1px; +border-bottom-style:solid; +} + + +.notice .entry-title { +float:left; +margin-bottom:11px; +margin-left:217px; +margin-left:199px; +} +.notice p.entry-content { +float:left; +width:427px; +width:100%; +} + +.notice_video p.entry-content, +.notice_audio p.entry-content, +.notice_image p.entry-content, +.notice_location p.entry-content, +.notice_event p.entry-content, +.notice_document p.entry-content { +width:322px; +width:75.41%; +} +#laconicat .notice p.entry-content { +/*margin-left:199px;*/ +} +.notice p.entry-content a { + +} +.notice p.entry-content a:hover { + +} +.notice p.entry-content .tag a { + +} +.notice p.entry-content .tag a:hover { + +} + + +.notice div.entry-content { +/*border:1px solid blue;*/ +clear:left; +float:left; +margin-left:11px; +margin-left:0; +margin-bottom:4px; +width:199px; +width:149px; +} +.notice div.entry-content, +.notice .notice-options a, +.notice .notice-options input { +font-size:0.9em; +} + + +#laconicat .notice div.entry-content { +/*margin-left:0;*/ +} + +.notice div.entry-content dl, +.notice div.entry-content dt, +.notice div.entry-content dd { +display:inline; +} +.notice div.entry-content .timestamp dt, +.notice div.entry-content .response dt { +display:none; +} +.notice div.entry-content .timestamp { + +} +.notice div.entry-content .device dt { +text-transform:lowercase; +} +.notice div.entry-content a { +text-decoration:none; +border-bottom-width:1px; +border-bottom-style:dotted; +} +.notice div.entry-content a:hover { +border-bottom-width:1px; +border-bottom-style:solid; +} + + + +.notice-data { +position:absolute; +top:18px; +right:0; +min-height:50px; +margin-bottom:4px; +} +.notice .entry-content .notice-data dt { +display:none; +} + +.notice-data a { +display:block; +outline:none; +} + + + +.notice-options { +margin-left:18px; +margin-left:260px; +margin-left:304px; +margin-left:18px; +margin-left:50px; +float:left; +} +.notice-options .reply, +.notice-options .notice_delete , +.notice-options .notice_favorite { +float:left; +margin-right:11px; +} +.notice-options .reply dt { +display:none; +} +.notice-options .reply a, +.notice-options form input.submit { +display:block; +border:0; +border-bottom-width:1px; +border-bottom-style:dotted; +padding-left:20px; + +} +.notice-options .reply a { +text-decoration:none; +} +.notice-options form input.submit { +cursor:pointer; +width:16px; +width:auto; +height:16px; +height:auto; +padding-top:0; +padding-right:0; +padding-bottom:0; +} + +.notice-options .notice_delete legend, +.notice-options .notice_favorite legend { +display:none; +} +.notice-options .notice_delete fieldset, +.notice-options .notice_favorite fieldset { +border:0; +padding:0; +} + + +.notice-options form.notice_delete { +margin-left:2em; +} +/*END: NOTICES */ + + + + + +.pagination dt { +font-weight:bold; +display:none; +} + +.pagination .nav { +float:left; +width:100%; +list-style-type:none; +} + +.pagination .nav_prev { +float:left; +} +.pagination .nav_next { +float:right; +} + +.pagination a { +display:block; +text-decoration:none; +font-weight:bold; +padding:7px; +border:1px dotted #D1D9E4; +border-bottom:0; +} + +.pagination .nav_prev a { +-moz-border-radius-topright:4px; +padding-left:20px; +border-left:0; +} +.pagination .nav_next a { +-moz-border-radius-topleft:4px; +padding-right:20px; +border-right:0; +} + + +/* END: NOTICE */ + + + + + + + +/*START: LOAD ALONG WITH JS*/ +.notice .in-reply-to { + width:98%; + margin-left:2%; +} +.notice .in-reply-to li { +background-color:#F7F9FB; +} +.notice .in-reply-to li .in-reply-to li { +background-color:#E4E9F0; +} +.notice .in-reply-to li .in-reply-to li .in-reply-to li { +background-color:#D1D9E4; +} + + + +#user_actions #user_subscribe .form_note, +#user_actions #user_subscribe .form_datas, +#user_actions #user_subscribe .form_actions label { +display:none; +} +#form_user-relationship .form_note, +#form_user-relationship .form_datas, +#form_user-relationship .form_actions label { +display:block; +} + +#user_actions #user-relationship_submit { +margin-bottom:0; +} +#form_user-relationship .form_datas li label { +margin-right:11px; +} + +#user_relationship_xfn { +/*z-index:1000; +position:absolute; +width:521px; +height:322px;*/ +display:none; +} +#user_relationship_xfn fieldset { +background-color:#fff; +} + +/*END: LOAD ALONG WITH JS*/ + + + +/* TOP_POSTERS */ +#top-posters caption { +text-align:left; +text-transform:uppercase; +} + +#top-posters thead { +display:none; +} +#top-poster_user { +width:199px; +} +#top-poster_number-of-notices { +width:123px; +} +#top-posters tbody td { +padding-right:11px; +padding-bottom:4px; +} +#top-posters img { +margin-right:7px; +height:24px; +width:24px; +} + + + +/* tagcloud */ +#tagcloud ul { +list-style-type:none; +} +#tagcloud ul li { +display:inline; +margin-right:7px; +line-height:1.4; +} + +#tagcloud.section dt { +text-transform:uppercase; +font-weight:bold; +} +#tagcloud .weight_1 { +font-size:1em; +} +#tagcloud .weight_2 { +font-size:1.3em; +} +#tagcloud .weight_3 { +font-size:1.6em; +} +#tagcloud .weight_4 { +font-size:1.9em; +} +#tagcloud .weight_5 { +font-size:2.2em; +} + + + +#form_settings_photo .form_datas { +clear:both; +} + + + + +#photo_original, +#photo_preview { +float:left; +} +#photo_preview, +#settings_photo_action-crop { +margin-left:29px; +} +#photo_preview_view { +height:96px; +width:96px; +overflow:hidden; +} + + + + +.section .groups, +#users_featured ul { +list-style-type:none; +} +.section .groups li, +#users_featured li { +margin-top:11px; +float:left; +width:100%; +} +.section .groups li:first-child, +#users_featured li:first-child { +margin-top:0; +} + +.section .groups .vcard, +#users_featured .vcard { +float:left; +margin-bottom:-23px; +} + +.section .groups dl, +#users_featured dl { +float:left; +margin-left:63px; +clear:left; +} +.section .groups dt, +#users_featured dt { +display:none; +font-weight:bold; +} + + + +#home.logged_out h1 { +display:none; +} + +#home #intro { +margin-bottom:29px; +float:left; +width:100%; +} + +#home #intro p { +margin-bottom:18px; +font-size:1.8em; +} + +#home #intro #guide_steps { +list-style-type:none; +} +#home #intro #guide_steps li { +float:left; +margin-left:18px; +} +#home #intro #guide_steps li:first-child { +margin-left:0; +} +#home #intro #guide_steps li a { +display:block; +float:left; +width:185px; +height:109px; +border-width:1px; +border-style:dotted; +text-decoration:none; +-moz-border-radius:7px; +padding:7px; +font-size:1.6em; +font-weight:bold; +text-align:center; +} + + +c +#testimonials { +clear:both; +} diff --git a/theme/base/css/initial_states.css b/theme/base/css/initial_states.css new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/theme/base/css/initial_states.css @@ -0,0 +1 @@ + diff --git a/theme/base/css/jquery.Jcrop.css b/theme/base/css/jquery.Jcrop.css new file mode 100644 index 000000000..6c6dfb503 --- /dev/null +++ b/theme/base/css/jquery.Jcrop.css @@ -0,0 +1,45 @@ +/* Fixes issue here http://code.google.com/p/jcrop/issues/detail?id=1 */ +.jcrop-holder +{ + text-align: left; +} + +.jcrop-vline, .jcrop-hline +{ + font-size: 0; + position: absolute; + background: #fff url(../images/illustrations/illu_jcrop.gif) top left repeat; + /* + opacity: .5; + *filter:alpha(opacity=50); + */ +} +.jcrop-vline { height: 100%; width: 1px !important; } +.jcrop-hline { width: 100%; height: 1px !important; } +.jcrop-handle { + font-size: 1px; + width: 7px !important; + height: 7px !important; + border: 1px #eee solid; + background-color: #333; + /*width: 9px; + height: 9px;*/ +} + +.jcrop-tracker { + /*background-color: gray;*/ + width: 100%; height: 100%; +} + +.custom .jcrop-vline, +.custom .jcrop-hline +{ + background: yellow; +} +.custom .jcrop-handle +{ + border-color: black; + background-color: #C7BB00; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} diff --git a/theme/base/css/thickbox.css b/theme/base/css/thickbox.css new file mode 100644 index 000000000..d24b9bedf --- /dev/null +++ b/theme/base/css/thickbox.css @@ -0,0 +1,163 @@ +/* ----------------------------------------------------------------------------------------------------------------*/ +/* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/ +/* ----------------------------------------------------------------------------------------------------------------*/ +*{padding: 0; margin: 0;} + +/* ----------------------------------------------------------------------------------------------------------------*/ +/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/ +/* ----------------------------------------------------------------------------------------------------------------*/ +#TB_window { + font: 12px Arial, Helvetica, sans-serif; + color: #333333; +} + +#TB_secondLine { + font: 10px Arial, Helvetica, sans-serif; + color:#666666; +} + +#TB_window a:link {color: #666666;} +#TB_window a:visited {color: #666666;} +#TB_window a:hover {color: #000;} +#TB_window a:active {color: #666666;} +#TB_window a:focus{color: #666666;} + +/* ----------------------------------------------------------------------------------------------------------------*/ +/* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/ +/* ----------------------------------------------------------------------------------------------------------------*/ +#TB_overlay { + position: fixed; + z-index:100; + top: 0px; + left: 0px; + height:100%; + width:100%; +} + +.TB_overlayMacFFBGHack {background: url(macFFBgHack.png) repeat;} +.TB_overlayBG { + background-color:#000; + filter:alpha(opacity=75); + -moz-opacity: 0.75; + opacity: 0.75; +} + +* html #TB_overlay { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#TB_window { + position: fixed; + background: #ffffff; + z-index: 102; + color:#000000; + display:none; + border: 4px solid #525252; + text-align:left; + top:50%; + left:50%; +} + +* html #TB_window { /* ie6 hack */ +position: absolute; +margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} + +#TB_window img#TB_Image { + display:block; + margin: 15px 0 0 15px; + border-right: 1px solid #ccc; + border-bottom: 1px solid #ccc; + border-top: 1px solid #666; + border-left: 1px solid #666; +} + +#TB_caption{ + height:25px; + padding:7px 30px 10px 25px; + float:left; +} + +#TB_closeWindow{ + height:25px; + padding:11px 25px 10px 0; + float:right; +} + +#TB_closeAjaxWindow{ + padding:7px 10px 5px 0; + margin-bottom:1px; + text-align:right; + float:right; +} + +#TB_ajaxWindowTitle{ + float:left; + padding:7px 0 5px 10px; + margin-bottom:1px; +} + +#TB_title{ + background-color:#e8e8e8; + height:27px; +} + +#TB_ajaxContent{ + clear:both; + padding:2px 15px 15px 15px; + overflow:auto; + text-align:left; + line-height:1.4em; +} + +#TB_ajaxContent.TB_modal{ + padding:15px; +} + +#TB_ajaxContent p{ + padding:5px 0px 5px 0px; +} + +#TB_load{ + position: fixed; + display:none; + height:13px; + width:208px; + z-index:103; + top: 50%; + left: 50%; + margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ +} + +* html #TB_load { /* ie6 hack */ +position: absolute; +margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} + +#TB_HideSelect{ + z-index:99; + position:fixed; + top: 0; + left: 0; + background-color:#fff; + border:none; + filter:alpha(opacity=0); + -moz-opacity: 0; + opacity: 0; + height:100%; + width:100%; +} + +* html #TB_HideSelect { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#TB_iframeContent{ + clear:both; + border:none; + margin-bottom:-1px; + margin-top:1px; + _margin-bottom:1px; +} diff --git a/theme/base/images/icons/icon_atom.jpg b/theme/base/images/icons/icon_atom.jpg new file mode 100644 index 000000000..22853edc4 Binary files /dev/null and b/theme/base/images/icons/icon_atom.jpg differ diff --git a/theme/base/images/icons/icon_foaf.gif b/theme/base/images/icons/icon_foaf.gif new file mode 100644 index 000000000..f8f784423 Binary files /dev/null and b/theme/base/images/icons/icon_foaf.gif differ diff --git a/theme/base/images/icons/icon_rss.jpg b/theme/base/images/icons/icon_rss.jpg new file mode 100644 index 000000000..da23422d0 Binary files /dev/null and b/theme/base/images/icons/icon_rss.jpg differ diff --git a/theme/base/images/icons/icon_vcard.gif b/theme/base/images/icons/icon_vcard.gif new file mode 100644 index 000000000..6d52947f3 Binary files /dev/null and b/theme/base/images/icons/icon_vcard.gif differ diff --git a/theme/base/images/illustrations/illu_jcrop.gif b/theme/base/images/illustrations/illu_jcrop.gif new file mode 100644 index 000000000..72ea7ccb5 Binary files /dev/null and b/theme/base/images/illustrations/illu_jcrop.gif differ diff --git a/theme/base/images/illustrations/illu_progress_loading-01.gif b/theme/base/images/illustrations/illu_progress_loading-01.gif new file mode 100644 index 000000000..82290f483 Binary files /dev/null and b/theme/base/images/illustrations/illu_progress_loading-01.gif differ diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css new file mode 100644 index 000000000..4659c7f2a --- /dev/null +++ b/theme/identica/css/display.css @@ -0,0 +1,226 @@ +/* theme: identica */ +html { + background-color:#ddd; +} +body { + font-family: sans-serif; + font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; + font-size:1em; + +} +input, textarea, select, option { + font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; +} +input:focus, textarea:focus, select:focus { +border-color:#B2D0DD; +} +form span.required { color:#f00; } +form .error { +background-color:#f00; +color:#fff; +} +form .error_message { +color:#EC008C; +} + +a { +color:#002E6E; +} + + + +#supplemental_primary { +background-color:#CEE1E9; +} + + + +#form_notice label { +color:#88171A; +} +#notice_text-count { +color:#333; +} +#notice_text-count.warning { +color:#FDFF00; +background-color:#000; +} +#notice_data-text.warning { +border-color:#FDFF00; +} + +#form_notice #notice_data-attach_view { +background-image:url(../images/icons/twotone/green/paper-clip.gif); +background-repeat:no-repeat; +background-position:0 45%; +background-color:transparent; +} + + +#site_nav_local_views a { +border-color:#fff; +} + +/* +#site_nav_global_primary .current a { +font-weight:bold; +border-color:#ccc; +border-style:solid; +} +*/ + +#content, +#site_nav_local_views .current a { +background-color:#fff; +} + + + + + +#export_data li a { +background-repeat:no-repeat; +background-position:0 45%; +} +#export_data li a.rss { +background-image:url(../images/icons/icon_rss.jpg); +} +#export_data li a.atom { +background-image:url(../images/icons/icon_atom.jpg); +} +#export_data li a.foaf { +background-image:url(../images/icons/icon_foaf.gif); +=} +#export_data li a.export_vcard { +background-image:url(../images/icons/icon_vcard.gif); +} + + +/*user_actions*/ +#user_actions li { +border-top-color:#eee; +} +#user_actions a { +color:#000; +} +#user_subscribe a, +#TB_window input.submit, +.form_user_subscribe input.submit { +background:#CEE1E9 url(../images/icons/twotone/green/shield.gif) 0 45% no-repeat; +} +.form_user_unsubscribe input.submit { +background-color:#647819; +color:#fff; +} +#user_send-a-message a { +background:url(../images/icons/twotone/green/quote.gif) 0 45% no-repeat; +} +.form_user_nudge input.submit { +background:url(../images/icons/twotone/green/mail.gif) 0 45% no-repeat; +} +.form_user_block input.submit { +background:url(../images/icons/twotone/green/against.gif) 0 45% no-repeat; +} + + +.user_tags .mark_hash { +color:#555; +} + + + +.vcard .fn { +border-bottom-color:#ccc; +} +.vcard .fn:hover { +border-bottom-color:#555; +} + + + + +/* NOTICES */ +.notice div.entry-content a { +color:#333; +border-bottom-color:#ccc; +} +.notice div.entry-content a:hover { +border-bottom-color:#555; +} + + +.notice-data a span { +background-color:transparent; +background-repeat:no-repeat; +background-position:0 45%; +} +.notice_video .notice-data a span { +background-image:url(../images/icons/twotone/green/camera.gif); +} +.notice_audio .notice-data a span { +background-image:url(../images/icons/twotone/green/music.gif); +} +.notice_image .notice-data a span { +background-image:url(../images/icons/twotone/green/search.gif); +} +.notice_event .notice-data a span { +background-image:url(../images/icons/twotone/green/calendar.gif); +} +.notice_location .notice-data a span { +background-image:url(../images/icons/twotone/green/flag.gif); +} +.notice_document .notice-data a span { +background-image:url(../images/icons/twotone/green/document.gif); +} + +.notice-options .reply a, +.notice-options form input.submit { +background-color:transparent; +color:#333333; +border-bottom-color:#ccc; +} +.notice-options .reply a { +background:transparent url(../images/icons/twotone/green/undo.gif) no-repeat 0 45%; +} +.notice-options form.notice_favorite input.submit { +background:transparent url(../images/icons/twotone/green/favourite.gif) no-repeat 0 45%; +} +.notice-options form.notice_delete input.submit { +background:transparent url(../images/icons/twotone/green/trash.gif) no-repeat 0 45%; +} +/*END: NOTICES */ + + + +.pagination .nav_prev a, +.pagination .nav_next a { +background-repeat:no-repeat; +} +.pagination .nav_prev a { +background-image:url(../images/icons/twotone/green/arrow-left.gif); +background-position:0 45%; +} +.pagination .nav_next a { +background-image:url(../images/icons/twotone/green/arrow-right.gif); +background-position:100% 45%; +} + + + +#home #intro #guide_steps li a { +border-color:#ccc; +color:#fff; +} +#home #intro #step_join-now a { +background-color:#f00; +} +#home #intro #step_start-a-group a { +background-color:#0f0; +} +#home #intro #step_create-a-community a { +background-color:#00f; +} + + + + diff --git a/theme/identica/images/icons/icon_atom.jpg b/theme/identica/images/icons/icon_atom.jpg new file mode 100644 index 000000000..22853edc4 Binary files /dev/null and b/theme/identica/images/icons/icon_atom.jpg differ diff --git a/theme/identica/images/icons/icon_foaf.gif b/theme/identica/images/icons/icon_foaf.gif new file mode 100644 index 000000000..f8f784423 Binary files /dev/null and b/theme/identica/images/icons/icon_foaf.gif differ diff --git a/theme/identica/images/icons/icon_rss.jpg b/theme/identica/images/icons/icon_rss.jpg new file mode 100644 index 000000000..da23422d0 Binary files /dev/null and b/theme/identica/images/icons/icon_rss.jpg differ diff --git a/theme/identica/images/icons/icon_vcard.gif b/theme/identica/images/icons/icon_vcard.gif new file mode 100644 index 000000000..6d52947f3 Binary files /dev/null and b/theme/identica/images/icons/icon_vcard.gif differ diff --git a/theme/identica/images/icons/twotone/green/against.gif b/theme/identica/images/icons/twotone/green/against.gif new file mode 100644 index 000000000..ca796c8a3 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/against.gif differ diff --git a/theme/identica/images/icons/twotone/green/arrow-down.gif b/theme/identica/images/icons/twotone/green/arrow-down.gif new file mode 100644 index 000000000..c709e5877 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/arrow-down.gif differ diff --git a/theme/identica/images/icons/twotone/green/arrow-downleft.gif b/theme/identica/images/icons/twotone/green/arrow-downleft.gif new file mode 100644 index 000000000..a4a98035d Binary files /dev/null and b/theme/identica/images/icons/twotone/green/arrow-downleft.gif differ diff --git a/theme/identica/images/icons/twotone/green/arrow-downright.gif b/theme/identica/images/icons/twotone/green/arrow-downright.gif new file mode 100644 index 000000000..3e6001a61 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/arrow-downright.gif differ diff --git a/theme/identica/images/icons/twotone/green/arrow-left.gif b/theme/identica/images/icons/twotone/green/arrow-left.gif new file mode 100644 index 000000000..afed19084 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/arrow-left.gif differ diff --git a/theme/identica/images/icons/twotone/green/arrow-right.gif b/theme/identica/images/icons/twotone/green/arrow-right.gif new file mode 100644 index 000000000..ee1707ed9 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/arrow-right.gif differ diff --git a/theme/identica/images/icons/twotone/green/arrow-up.gif b/theme/identica/images/icons/twotone/green/arrow-up.gif new file mode 100644 index 000000000..d0f5fbeaa Binary files /dev/null and b/theme/identica/images/icons/twotone/green/arrow-up.gif differ diff --git a/theme/identica/images/icons/twotone/green/arrow-upleft.gif b/theme/identica/images/icons/twotone/green/arrow-upleft.gif new file mode 100644 index 000000000..1e9e6935b Binary files /dev/null and b/theme/identica/images/icons/twotone/green/arrow-upleft.gif differ diff --git a/theme/identica/images/icons/twotone/green/arrow-upright.gif b/theme/identica/images/icons/twotone/green/arrow-upright.gif new file mode 100644 index 000000000..c7fecc8a0 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/arrow-upright.gif differ diff --git a/theme/identica/images/icons/twotone/green/back-forth.gif b/theme/identica/images/icons/twotone/green/back-forth.gif new file mode 100644 index 000000000..33a9540c8 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/back-forth.gif differ diff --git a/theme/identica/images/icons/twotone/green/bookmark.gif b/theme/identica/images/icons/twotone/green/bookmark.gif new file mode 100644 index 000000000..23f318ecc Binary files /dev/null and b/theme/identica/images/icons/twotone/green/bookmark.gif differ diff --git a/theme/identica/images/icons/twotone/green/bulb.gif b/theme/identica/images/icons/twotone/green/bulb.gif new file mode 100644 index 000000000..f70652c03 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/bulb.gif differ diff --git a/theme/identica/images/icons/twotone/green/calendar.gif b/theme/identica/images/icons/twotone/green/calendar.gif new file mode 100644 index 000000000..a09b65aca Binary files /dev/null and b/theme/identica/images/icons/twotone/green/calendar.gif differ diff --git a/theme/identica/images/icons/twotone/green/calendar2.gif b/theme/identica/images/icons/twotone/green/calendar2.gif new file mode 100644 index 000000000..7884b02dd Binary files /dev/null and b/theme/identica/images/icons/twotone/green/calendar2.gif differ diff --git a/theme/identica/images/icons/twotone/green/camera.gif b/theme/identica/images/icons/twotone/green/camera.gif new file mode 100644 index 000000000..1a85fbad0 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/camera.gif differ diff --git a/theme/identica/images/icons/twotone/green/cart.gif b/theme/identica/images/icons/twotone/green/cart.gif new file mode 100644 index 000000000..47eaa0a2e Binary files /dev/null and b/theme/identica/images/icons/twotone/green/cart.gif differ diff --git a/theme/identica/images/icons/twotone/green/caution.gif b/theme/identica/images/icons/twotone/green/caution.gif new file mode 100644 index 000000000..3ad2c322b Binary files /dev/null and b/theme/identica/images/icons/twotone/green/caution.gif differ diff --git a/theme/identica/images/icons/twotone/green/chart.gif b/theme/identica/images/icons/twotone/green/chart.gif new file mode 100644 index 000000000..136d74517 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/chart.gif differ diff --git a/theme/identica/images/icons/twotone/green/checkmark.gif b/theme/identica/images/icons/twotone/green/checkmark.gif new file mode 100644 index 000000000..892429d48 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/checkmark.gif differ diff --git a/theme/identica/images/icons/twotone/green/clipboard.gif b/theme/identica/images/icons/twotone/green/clipboard.gif new file mode 100644 index 000000000..9317bdcd0 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/clipboard.gif differ diff --git a/theme/identica/images/icons/twotone/green/clock.gif b/theme/identica/images/icons/twotone/green/clock.gif new file mode 100644 index 000000000..d1410f925 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/clock.gif differ diff --git a/theme/identica/images/icons/twotone/green/closed-folder.gif b/theme/identica/images/icons/twotone/green/closed-folder.gif new file mode 100644 index 000000000..0410fc6e8 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/closed-folder.gif differ diff --git a/theme/identica/images/icons/twotone/green/database.gif b/theme/identica/images/icons/twotone/green/database.gif new file mode 100644 index 000000000..29ce02492 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/database.gif differ diff --git a/theme/identica/images/icons/twotone/green/diskette.gif b/theme/identica/images/icons/twotone/green/diskette.gif new file mode 100644 index 000000000..e970b0a30 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/diskette.gif differ diff --git a/theme/identica/images/icons/twotone/green/document.gif b/theme/identica/images/icons/twotone/green/document.gif new file mode 100644 index 000000000..9c08f4a3a Binary files /dev/null and b/theme/identica/images/icons/twotone/green/document.gif differ diff --git a/theme/identica/images/icons/twotone/green/double-arrow.gif b/theme/identica/images/icons/twotone/green/double-arrow.gif new file mode 100644 index 000000000..2e8648264 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/double-arrow.gif differ diff --git a/theme/identica/images/icons/twotone/green/edit.gif b/theme/identica/images/icons/twotone/green/edit.gif new file mode 100644 index 000000000..c746aca60 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/edit.gif differ diff --git a/theme/identica/images/icons/twotone/green/eject.gif b/theme/identica/images/icons/twotone/green/eject.gif new file mode 100644 index 000000000..7e0906cfe Binary files /dev/null and b/theme/identica/images/icons/twotone/green/eject.gif differ diff --git a/theme/identica/images/icons/twotone/green/exclaim.gif b/theme/identica/images/icons/twotone/green/exclaim.gif new file mode 100644 index 000000000..588e28c26 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/exclaim.gif differ diff --git a/theme/identica/images/icons/twotone/green/fastforward.gif b/theme/identica/images/icons/twotone/green/fastforward.gif new file mode 100644 index 000000000..28e495103 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/fastforward.gif differ diff --git a/theme/identica/images/icons/twotone/green/favourite.gif b/theme/identica/images/icons/twotone/green/favourite.gif new file mode 100644 index 000000000..d93515e37 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/favourite.gif differ diff --git a/theme/identica/images/icons/twotone/green/flag.gif b/theme/identica/images/icons/twotone/green/flag.gif new file mode 100644 index 000000000..68c8aee25 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/flag.gif differ diff --git a/theme/identica/images/icons/twotone/green/graph.gif b/theme/identica/images/icons/twotone/green/graph.gif new file mode 100644 index 000000000..0c1794b4e Binary files /dev/null and b/theme/identica/images/icons/twotone/green/graph.gif differ diff --git a/theme/identica/images/icons/twotone/green/grow.gif b/theme/identica/images/icons/twotone/green/grow.gif new file mode 100644 index 000000000..c4118d53b Binary files /dev/null and b/theme/identica/images/icons/twotone/green/grow.gif differ diff --git a/theme/identica/images/icons/twotone/green/headphones.gif b/theme/identica/images/icons/twotone/green/headphones.gif new file mode 100644 index 000000000..5be6c67dd Binary files /dev/null and b/theme/identica/images/icons/twotone/green/headphones.gif differ diff --git a/theme/identica/images/icons/twotone/green/home.gif b/theme/identica/images/icons/twotone/green/home.gif new file mode 100644 index 000000000..d2a3421ef Binary files /dev/null and b/theme/identica/images/icons/twotone/green/home.gif differ diff --git a/theme/identica/images/icons/twotone/green/hourglass.gif b/theme/identica/images/icons/twotone/green/hourglass.gif new file mode 100644 index 000000000..b62b9480c Binary files /dev/null and b/theme/identica/images/icons/twotone/green/hourglass.gif differ diff --git a/theme/identica/images/icons/twotone/green/info.gif b/theme/identica/images/icons/twotone/green/info.gif new file mode 100644 index 000000000..86ef1f8b4 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/info.gif differ diff --git a/theme/identica/images/icons/twotone/green/key.gif b/theme/identica/images/icons/twotone/green/key.gif new file mode 100644 index 000000000..ccf357ab2 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/key.gif differ diff --git a/theme/identica/images/icons/twotone/green/lock.gif b/theme/identica/images/icons/twotone/green/lock.gif new file mode 100644 index 000000000..db00706b5 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/lock.gif differ diff --git a/theme/identica/images/icons/twotone/green/mail.gif b/theme/identica/images/icons/twotone/green/mail.gif new file mode 100644 index 000000000..1084c862f Binary files /dev/null and b/theme/identica/images/icons/twotone/green/mail.gif differ diff --git a/theme/identica/images/icons/twotone/green/move.gif b/theme/identica/images/icons/twotone/green/move.gif new file mode 100644 index 000000000..d2c30b1d2 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/move.gif differ diff --git a/theme/identica/images/icons/twotone/green/music.gif b/theme/identica/images/icons/twotone/green/music.gif new file mode 100644 index 000000000..64b51d4e1 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/music.gif differ diff --git a/theme/identica/images/icons/twotone/green/news.gif b/theme/identica/images/icons/twotone/green/news.gif new file mode 100644 index 000000000..712c685dc Binary files /dev/null and b/theme/identica/images/icons/twotone/green/news.gif differ diff --git a/theme/identica/images/icons/twotone/green/note.gif b/theme/identica/images/icons/twotone/green/note.gif new file mode 100644 index 000000000..bcc0b149b Binary files /dev/null and b/theme/identica/images/icons/twotone/green/note.gif differ diff --git a/theme/identica/images/icons/twotone/green/open-folder.gif b/theme/identica/images/icons/twotone/green/open-folder.gif new file mode 100644 index 000000000..d41300a08 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/open-folder.gif differ diff --git a/theme/identica/images/icons/twotone/green/paper-clip.gif b/theme/identica/images/icons/twotone/green/paper-clip.gif new file mode 100644 index 000000000..1d45f1d1e Binary files /dev/null and b/theme/identica/images/icons/twotone/green/paper-clip.gif differ diff --git a/theme/identica/images/icons/twotone/green/paper-clip2.gif b/theme/identica/images/icons/twotone/green/paper-clip2.gif new file mode 100644 index 000000000..a8c7805be Binary files /dev/null and b/theme/identica/images/icons/twotone/green/paper-clip2.gif differ diff --git a/theme/identica/images/icons/twotone/green/pause.gif b/theme/identica/images/icons/twotone/green/pause.gif new file mode 100644 index 000000000..ced0b6440 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/pause.gif differ diff --git a/theme/identica/images/icons/twotone/green/phone.gif b/theme/identica/images/icons/twotone/green/phone.gif new file mode 100644 index 000000000..69359f764 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/phone.gif differ diff --git a/theme/identica/images/icons/twotone/green/play.gif b/theme/identica/images/icons/twotone/green/play.gif new file mode 100644 index 000000000..794ec85b6 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/play.gif differ diff --git a/theme/identica/images/icons/twotone/green/plus.gif b/theme/identica/images/icons/twotone/green/plus.gif new file mode 100644 index 000000000..4407d0b2d Binary files /dev/null and b/theme/identica/images/icons/twotone/green/plus.gif differ diff --git a/theme/identica/images/icons/twotone/green/print.gif b/theme/identica/images/icons/twotone/green/print.gif new file mode 100644 index 000000000..17727d5d7 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/print.gif differ diff --git a/theme/identica/images/icons/twotone/green/question-mark.gif b/theme/identica/images/icons/twotone/green/question-mark.gif new file mode 100644 index 000000000..1689efcd0 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/question-mark.gif differ diff --git a/theme/identica/images/icons/twotone/green/quote.gif b/theme/identica/images/icons/twotone/green/quote.gif new file mode 100644 index 000000000..4ba1f0c03 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/quote.gif differ diff --git a/theme/identica/images/icons/twotone/green/refresh.gif b/theme/identica/images/icons/twotone/green/refresh.gif new file mode 100644 index 000000000..8a8b8144f Binary files /dev/null and b/theme/identica/images/icons/twotone/green/refresh.gif differ diff --git a/theme/identica/images/icons/twotone/green/rewind.gif b/theme/identica/images/icons/twotone/green/rewind.gif new file mode 100644 index 000000000..aca3ee35b Binary files /dev/null and b/theme/identica/images/icons/twotone/green/rewind.gif differ diff --git a/theme/identica/images/icons/twotone/green/search.gif b/theme/identica/images/icons/twotone/green/search.gif new file mode 100644 index 000000000..c36463d0d Binary files /dev/null and b/theme/identica/images/icons/twotone/green/search.gif differ diff --git a/theme/identica/images/icons/twotone/green/shield.gif b/theme/identica/images/icons/twotone/green/shield.gif new file mode 100644 index 000000000..419d5ee4b Binary files /dev/null and b/theme/identica/images/icons/twotone/green/shield.gif differ diff --git a/theme/identica/images/icons/twotone/green/skip-back.gif b/theme/identica/images/icons/twotone/green/skip-back.gif new file mode 100644 index 000000000..adca7aa3e Binary files /dev/null and b/theme/identica/images/icons/twotone/green/skip-back.gif differ diff --git a/theme/identica/images/icons/twotone/green/skip.gif b/theme/identica/images/icons/twotone/green/skip.gif new file mode 100644 index 000000000..ae5417f2f Binary files /dev/null and b/theme/identica/images/icons/twotone/green/skip.gif differ diff --git a/theme/identica/images/icons/twotone/green/skull.gif b/theme/identica/images/icons/twotone/green/skull.gif new file mode 100644 index 000000000..033506732 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/skull.gif differ diff --git a/theme/identica/images/icons/twotone/green/statusbar.gif b/theme/identica/images/icons/twotone/green/statusbar.gif new file mode 100644 index 000000000..47d61b106 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/statusbar.gif differ diff --git a/theme/identica/images/icons/twotone/green/stop.gif b/theme/identica/images/icons/twotone/green/stop.gif new file mode 100644 index 000000000..e0b108d35 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/stop.gif differ diff --git a/theme/identica/images/icons/twotone/green/template.gif b/theme/identica/images/icons/twotone/green/template.gif new file mode 100644 index 000000000..65c0c4a0a Binary files /dev/null and b/theme/identica/images/icons/twotone/green/template.gif differ diff --git a/theme/identica/images/icons/twotone/green/text-bigger.gif b/theme/identica/images/icons/twotone/green/text-bigger.gif new file mode 100644 index 000000000..45e143b7a Binary files /dev/null and b/theme/identica/images/icons/twotone/green/text-bigger.gif differ diff --git a/theme/identica/images/icons/twotone/green/text-smaller.gif b/theme/identica/images/icons/twotone/green/text-smaller.gif new file mode 100644 index 000000000..a54d0c1d3 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/text-smaller.gif differ diff --git a/theme/identica/images/icons/twotone/green/trash.gif b/theme/identica/images/icons/twotone/green/trash.gif new file mode 100644 index 000000000..78dd64a3d Binary files /dev/null and b/theme/identica/images/icons/twotone/green/trash.gif differ diff --git a/theme/identica/images/icons/twotone/green/two-docs.gif b/theme/identica/images/icons/twotone/green/two-docs.gif new file mode 100644 index 000000000..97e54b964 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/two-docs.gif differ diff --git a/theme/identica/images/icons/twotone/green/twotone.gif b/theme/identica/images/icons/twotone/green/twotone.gif new file mode 100644 index 000000000..45aad25c4 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/twotone.gif differ diff --git a/theme/identica/images/icons/twotone/green/undo.gif b/theme/identica/images/icons/twotone/green/undo.gif new file mode 100644 index 000000000..6869b3050 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/undo.gif differ diff --git a/theme/identica/images/icons/twotone/green/user.gif b/theme/identica/images/icons/twotone/green/user.gif new file mode 100644 index 000000000..c85460fcd Binary files /dev/null and b/theme/identica/images/icons/twotone/green/user.gif differ diff --git a/theme/identica/images/icons/twotone/green/vegetable.gif b/theme/identica/images/icons/twotone/green/vegetable.gif new file mode 100644 index 000000000..4d421c1bb Binary files /dev/null and b/theme/identica/images/icons/twotone/green/vegetable.gif differ diff --git a/theme/identica/images/icons/twotone/green/x.gif b/theme/identica/images/icons/twotone/green/x.gif new file mode 100644 index 000000000..ffb2efea0 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/x.gif differ diff --git a/theme/identica/images/icons/twotone/green/zoom-in.gif b/theme/identica/images/icons/twotone/green/zoom-in.gif new file mode 100644 index 000000000..a59a5bb50 Binary files /dev/null and b/theme/identica/images/icons/twotone/green/zoom-in.gif differ diff --git a/theme/identica/images/icons/twotone/green/zoom-out.gif b/theme/identica/images/icons/twotone/green/zoom-out.gif new file mode 100644 index 000000000..c61f999fd Binary files /dev/null and b/theme/identica/images/icons/twotone/green/zoom-out.gif differ diff --git a/theme/identica/logo.png b/theme/identica/logo.png index 3b271814d..4a5b5470e 100644 Binary files a/theme/identica/logo.png and b/theme/identica/logo.png differ -- cgit v1.2.3-54-g00ecf From ff901332d2a64766472921d3d3742dc913540508 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 14:21:47 -0500 Subject: Fix the constructor for Action Also, fix the startXML() method --- lib/action.php | 17 +++++++++++++++-- lib/htmloutputter.php | 2 -- lib/xmloutputter.php | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 8694bf47c..4aff4264d 100644 --- a/lib/action.php +++ b/lib/action.php @@ -58,8 +58,21 @@ class Action extends HTMLOutputter // lawsuit { var $args; - function Action() - { + /** + * Constructor + * + * Just wraps the HTMLOutputter constructor. + * + * @param string $output URI to output to, default = stdout + * @param boolean $indent Whether to indent output, default true + * + * @see XMLOutputter::__construct + * @see HTMLOutputter::__construct + */ + + function __construct($output='php://output', $indent=true) + { + parent::__construct($output, $indent); } // For initializing members of the class diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 43e4a59a9..75a995bef 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -122,7 +122,6 @@ class HTMLOutputter extends XMLOutputter 'lang' => $language)); } - /** * Ends an HTML document * @@ -134,7 +133,6 @@ class HTMLOutputter extends XMLOutputter $this->endXML(); } - /** * Output an HTML text input element * diff --git a/lib/xmloutputter.php b/lib/xmloutputter.php index 9ca0c91bd..64935da40 100644 --- a/lib/xmloutputter.php +++ b/lib/xmloutputter.php @@ -72,7 +72,6 @@ class XMLOutputter $this->xw = new XMLWriter(); $this->xw->openURI($output); $this->xw->setIndent($indent); - $this->xw->startDocument('1.0', 'UTF-8'); } /** @@ -87,6 +86,7 @@ class XMLOutputter function startXML($doc=null, $public=null, $system=null) { + $this->xw->startDocument('1.0', 'UTF-8'); if ($doc) { $this->xw->writeDTD($doc, $public, $system); } -- cgit v1.2.3-54-g00ecf From 8ff6dc8e32678adc1b1df5fd59fa831aec08f12a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 14:23:28 -0500 Subject: startElement() -> elementStart() in Action --- lib/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 4aff4264d..cab51e9ea 100644 --- a/lib/action.php +++ b/lib/action.php @@ -94,7 +94,7 @@ class Action extends HTMLOutputter // lawsuit function showHead() { // XXX: attributes (profile?) - $this->startElement('head'); + $this->elementStart('head'); $this->showTitle(); $this->showStylesheets(); $this->showScripts(); -- cgit v1.2.3-54-g00ecf From 6a8be40a8cdce09cd994adc4ba3877cf15436128 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 14:24:54 -0500 Subject: elementElement() -> elementEnd() in Action --- lib/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index cab51e9ea..30a3c8a03 100644 --- a/lib/action.php +++ b/lib/action.php @@ -102,7 +102,7 @@ class Action extends HTMLOutputter // lawsuit $this->showFeeds(); $this->showDescription(); $this->extraHead(); - $this->elementElement('head'); + $this->elementEnd('head'); } function showTitle() -- cgit v1.2.3-54-g00ecf From 34d859c4a6708db0887983a7a9a2cf4c3e96f9cc Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 14:31:03 -0500 Subject: Add a menuItem method to Action --- lib/action.php | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 30a3c8a03..7c919497f 100644 --- a/lib/action.php +++ b/lib/action.php @@ -238,25 +238,25 @@ class Action extends HTMLOutputter // lawsuit $user = common_current_user(); $this->elementStart('ul', array('id' => 'nav')); if ($user) { - common_menu_item(common_local_url('all', array('nickname' => $user->nickname)), + $this->menuItem(common_local_url('all', array('nickname' => $user->nickname)), _('Home')); } - common_menu_item(common_local_url('peoplesearch'), _('Search')); + $this->menuItem(common_local_url('peoplesearch'), _('Search')); if ($user) { - common_menu_item(common_local_url('profilesettings'), + $this->menuItem(common_local_url('profilesettings'), _('Settings')); - common_menu_item(common_local_url('invite'), + $this->menuItem(common_local_url('invite'), _('Invite')); - common_menu_item(common_local_url('logout'), + $this->menuItem(common_local_url('logout'), _('Logout')); } else { - common_menu_item(common_local_url('login'), _('Login')); + $this->menuItem(common_local_url('login'), _('Login')); if (!common_config('site', 'closed')) { - common_menu_item(common_local_url('register'), _('Register')); + $this->menuItem(common_local_url('register'), _('Register')); } - common_menu_item(common_local_url('openidlogin'), _('OpenID')); + $this->menuItem(common_local_url('openidlogin'), _('OpenID')); } - common_menu_item(common_local_url('doc', array('title' => 'help')), + $this->menuItem(common_local_url('doc', array('title' => 'help')), _('Help')); $this->elementEnd('ul'); $this->elementEnd('dl'); @@ -300,7 +300,7 @@ class Action extends HTMLOutputter // lawsuit $this->element('dt', null, _('Local views')); $this->elementStart('ul', array('id' => 'nav')); foreach ($menu as $menuaction => $menudesc) { - common_menu_item(common_local_url($menuaction, + $this->menuItem(common_local_url($menuaction, isset($menudesc[2]) ? $menudesc[2] : null), $menudesc[0], $menudesc[1], @@ -377,17 +377,17 @@ class Action extends HTMLOutputter // lawsuit function showSecondaryNav() { $this->elementStart('ul', array('id' => 'nav_sub')); - common_menu_item(common_local_url('doc', array('title' => 'help')), + $this->menuItem(common_local_url('doc', array('title' => 'help')), _('Help')); - common_menu_item(common_local_url('doc', array('title' => 'about')), + $this->menuItem(common_local_url('doc', array('title' => 'about')), _('About')); - common_menu_item(common_local_url('doc', array('title' => 'faq')), + $this->menuItem(common_local_url('doc', array('title' => 'faq')), _('FAQ')); - common_menu_item(common_local_url('doc', array('title' => 'privacy')), + $this->menuItem(common_local_url('doc', array('title' => 'privacy')), _('Privacy')); - common_menu_item(common_local_url('doc', array('title' => 'source')), + $this->menuItem(common_local_url('doc', array('title' => 'source')), _('Source')); - common_menu_item(common_local_url('doc', array('title' => 'contact')), + $this->menuItem(common_local_url('doc', array('title' => 'contact')), _('Contact')); $this->elementEnd('ul'); } @@ -546,7 +546,7 @@ class Action extends HTMLOutputter // lawsuit $action = $this->trimmed('action'); $this->elementStart('ul', array('id' => 'nav_views')); foreach ($menu as $menuaction => $menudesc) { - common_menu_item(common_local_url($menuaction, + $this->menuItem(common_local_url($menuaction, isset($menudesc[2]) ? $menudesc[2] : null), $menudesc[0], $menudesc[1], @@ -578,7 +578,8 @@ class Action extends HTMLOutputter // lawsuit } // Added @id to li for some control. We might want to move this to htmloutputter.php - function common_menu_item($id=null, $url, $text, $title=null, $is_selected=false) + + function menuItem($id=null, $url, $text, $title=null, $is_selected=false) { $lattrs = array(); if ($is_selected) { -- cgit v1.2.3-54-g00ecf From d8f9628a17d5739182fdab92bf9e5202310d89f5 Mon Sep 17 00:00:00 2001 From: sarven Date: Thu, 15 Jan 2009 19:33:45 +0000 Subject: Using a specific path for CSS files. --- lib/action.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 30a3c8a03..cc00699c4 100644 --- a/lib/action.php +++ b/lib/action.php @@ -124,15 +124,15 @@ class Action extends HTMLOutputter // lawsuit { $this->element('link', array('rel' => 'stylesheet', 'type' => 'text/css', - 'href' => theme_path('display.css', 'base') . '?version=' . LACONICA_VERSION, + 'href' => theme_path('css/display.css', 'base') . '?version=' . LACONICA_VERSION, 'media' => 'screen, projection, tv')); $this->element('link', array('rel' => 'stylesheet', 'type' => 'text/css', - 'href' => theme_path('thickbox.css', 'base') . '?version=' . LACONICA_VERSION, + 'href' => theme_path('css/thickbox.css', 'base') . '?version=' . LACONICA_VERSION, 'media' => 'screen, projection, tv')); $this->element('link', array('rel' => 'stylesheet', 'type' => 'text/css', - 'href' => theme_path('display.css', null) . '?version=' . LACONICA_VERSION, + 'href' => theme_path('css/display.css', null) . '?version=' . LACONICA_VERSION, 'media' => 'screen, projection, tv')); foreach (array(6,7) as $ver) { if (file_exists(theme_file('ie'.$ver.'.css'))) { -- cgit v1.2.3-54-g00ecf From 7e316abe92d6cabfe626e0fbe747e783e9752085 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 14:45:08 -0500 Subject: Move optional id param to end of function, where optional params actually go. --- lib/action.php | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 7c919497f..634b3bfa3 100644 --- a/lib/action.php +++ b/lib/action.php @@ -290,25 +290,11 @@ class Action extends HTMLOutputter // lawsuit $this->elementEnd('div'); } - // SHOULD overload (perhaps this should be a MUST because sometimes it is not used) + // SHOULD overload - function showLocalNav($menu) + function showLocalNav() { - $action = $this->trimmed('action'); - - $this->elementStart('dl', array('id' => 'site_nav_local_views')); - $this->element('dt', null, _('Local views')); - $this->elementStart('ul', array('id' => 'nav')); - foreach ($menu as $menuaction => $menudesc) { - $this->menuItem(common_local_url($menuaction, - isset($menudesc[2]) ? $menudesc[2] : null), - $menudesc[0], - $menudesc[1], - $action == $menuaction); - } - $this->elementEnd('ul'); - $this->elementEnd('dd'); - $this->elementEnd('dl'); + // does nothing by default } function showContentBlock() @@ -577,9 +563,10 @@ class Action extends HTMLOutputter // lawsuit $this->elementStart('div', array('id' => 'content')); } - // Added @id to li for some control. We might want to move this to htmloutputter.php + // Added @id to li for some control. + // XXX: We might want to move this to htmloutputter.php - function menuItem($id=null, $url, $text, $title=null, $is_selected=false) + function menuItem($url, $text, $id=null, $title=null, $is_selected=false) { $lattrs = array(); if ($is_selected) { -- cgit v1.2.3-54-g00ecf From 73c1390eb1b14e829b33e60bd370622fce32bec0 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 14:56:40 -0500 Subject: Fix notice form in action --- lib/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 634b3bfa3..dd48cbc87 100644 --- a/lib/action.php +++ b/lib/action.php @@ -32,7 +32,7 @@ if (!defined('LACONICA')) { exit(1); } -require_once INSTALLDIR.'/lib/form.php'; +require_once INSTALLDIR.'/lib/noticeform.php'; require_once INSTALLDIR.'/lib/htmloutputter.php'; /** -- cgit v1.2.3-54-g00ecf From edf84cca041be956d8a8ac02d4542e9d835e42c9 Mon Sep 17 00:00:00 2001 From: sarven Date: Thu, 15 Jan 2009 20:10:20 +0000 Subject: showSiteNotice() was missing closing dl tag --- lib/action.php | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 9ba9f36fc..5f6c600b1 100644 --- a/lib/action.php +++ b/lib/action.php @@ -271,6 +271,7 @@ class Action extends HTMLOutputter // lawsuit $this->elementStart('dd', null); // Output a bunch of paragraphs here $this->elementEnd('dd'); + $this->elementEnd('dl'); } // MAY overload if no notice form needed... or direct message box???? -- cgit v1.2.3-54-g00ecf From 21c396202eaff538abb2f032c2a8686d880b89f9 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 15:11:55 -0500 Subject: Add arg to NoticeForm constructor --- lib/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index dd48cbc87..4f0b0def1 100644 --- a/lib/action.php +++ b/lib/action.php @@ -277,7 +277,7 @@ class Action extends HTMLOutputter // lawsuit function showNoticeForm() { - $notice_form = new NoticeForm(); + $notice_form = new NoticeForm($this); $notice_form->show(); } -- cgit v1.2.3-54-g00ecf From 186783f45bccf604c295bf0bfafd02637d10b473 Mon Sep 17 00:00:00 2001 From: sarven Date: Thu, 15 Jan 2009 20:20:03 +0000 Subject: Missing end dl tag for showPageNotice() --- lib/action.php | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 4b9db4652..4d2aa02e2 100644 --- a/lib/action.php +++ b/lib/action.php @@ -321,6 +321,7 @@ class Action extends HTMLOutputter // lawsuit $this->elementStart('dd', null); // Output a bunch of paragraphs here $this->elementEnd('dd'); + $this->elementEnd('dl'); } // MUST overload -- cgit v1.2.3-54-g00ecf From c08eadc774c2231e6b434ba067e2d7115404606f Mon Sep 17 00:00:00 2001 From: sarven Date: Thu, 15 Jan 2009 20:24:41 +0000 Subject: HTML update to showSecondaryNav() --- lib/action.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 4d2aa02e2..52eee6d6a 100644 --- a/lib/action.php +++ b/lib/action.php @@ -364,7 +364,10 @@ class Action extends HTMLOutputter // lawsuit function showSecondaryNav() { - $this->elementStart('ul', array('id' => 'nav_sub')); + $this->elementStart('dl', array('id' => 'site_nav_global_secondary')); + $this->element('dt', null, _('Secondary site navigation')); + $this->elementStart('dd', null); + $this->elementStart('ul', array('id' => 'nav')); $this->menuItem(common_local_url('doc', array('title' => 'help')), _('Help')); $this->menuItem(common_local_url('doc', array('title' => 'about')), @@ -378,6 +381,8 @@ class Action extends HTMLOutputter // lawsuit $this->menuItem(common_local_url('doc', array('title' => 'contact')), _('Contact')); $this->elementEnd('ul'); + $this->elementEnd('dd'); + $this->elementEnd('dl'); } function showLicenses() -- cgit v1.2.3-54-g00ecf From 62ed9d3e7314d23866d009ff17b4bee6f5929e8e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 20:24:54 +0000 Subject: Fix called to text and raw in action.php --- lib/action.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 4f0b0def1..fd9d276ac 100644 --- a/lib/action.php +++ b/lib/action.php @@ -397,7 +397,7 @@ class Action extends HTMLOutputter // lawsuit } $instr .= sprintf(_('It runs the [Laconica](http://laconi.ca/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), LACONICA_VERSION); $output = common_markup_to_html($instr); - common_raw($output); + $this->raw($output); $this->elementEnd('dd'); // do it } @@ -407,12 +407,12 @@ class Action extends HTMLOutputter // lawsuit $this->element('dt', array('id' => 'site_content_license'), _('Laconica software license')); $this->elementStart('dd', array('id' => 'site_content_license_cc')); $this->elementStart('p'); - common_text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the ')); + $this->text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the ')); $this->element('a', array('class' => 'license', 'rel' => 'external license', 'href' => $config['license']['url']), $config['license']['title']); - common_text(_('. Contributors should be attributed by full name or nickname.')); + $this->text(_('. Contributors should be attributed by full name or nickname.')); $this->elementEnd('p'); $this->element('img', array('id' => 'license_cc', 'src' => $config['license']['image'], -- cgit v1.2.3-54-g00ecf From 443e4a48c7b778dea499e88df14ba1b18ea533db Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 20:27:33 +0000 Subject: Fix site notice --- lib/action.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index fd9d276ac..097b0d92e 100644 --- a/lib/action.php +++ b/lib/action.php @@ -265,14 +265,16 @@ class Action extends HTMLOutputter // lawsuit // Revist. Should probably do an hAtom pattern here function showSiteNotice() { - $this->elementStart('dl', array('id' => 'site_notice', - 'class' => 'system_notice')); - $this->element('dt', null, _('Site notice')); - $this->elementStart('dd', null); - // Output a bunch of paragraphs here - $this->elementEnd('dd'); - } - + $text = common_config('site', 'notice'); + if ($text) { + $this->elementStart('dl', array('id' => 'site_notice', + 'class' => 'system_notice')); + $this->element('dt', null, _('Site notice')); + $this->element('dd', null, $text); + $this->elementEnd('dl'); + } + } + // MAY overload if no notice form needed... or direct message box???? function showNoticeForm() -- cgit v1.2.3-54-g00ecf From c42b88308683fccfc7710a39a363d98270ade39b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 20:31:17 +0000 Subject: Fix dd in action I think these definition lists are ridiculous, and I particularly resent having to debug them. --- lib/action.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 097b0d92e..057b4a19a 100644 --- a/lib/action.php +++ b/lib/action.php @@ -235,6 +235,7 @@ class Action extends HTMLOutputter // lawsuit { $this->elementStart('dl', array('id' => 'site_nav_global_primary')); $this->element('dt', null, _('Primary site navigation')); + $this->elementStart('dd'); $user = common_current_user(); $this->elementStart('ul', array('id' => 'nav')); if ($user) { @@ -259,6 +260,7 @@ class Action extends HTMLOutputter // lawsuit $this->menuItem(common_local_url('doc', array('title' => 'help')), _('Help')); $this->elementEnd('ul'); + $this->elementEnd('dd'); $this->elementEnd('dl'); } -- cgit v1.2.3-54-g00ecf From 9bed97a36c62fed7b3f44f0cf8870dd31a55e378 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 21:19:23 +0000 Subject: Move ID param to end of menuItem and fix bad 'wrap' element --- lib/action.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 4a164d8b0..a8b5e70b1 100644 --- a/lib/action.php +++ b/lib/action.php @@ -194,11 +194,11 @@ class Action extends HTMLOutputter // lawsuit function showBody() { $this->elementStart('body'); - $this->elementStart('wrap'); + $this->elementStart('div', 'wrap'); $this->showHeader(); $this->showCore(); $this->showFooter(); - $this->elementEnd('wrap'); + $this->elementEnd('div', 'wrap'); $this->elementEnd('body'); } @@ -576,7 +576,7 @@ class Action extends HTMLOutputter // lawsuit // Added @id to li for some control. // XXX: We might want to move this to htmloutputter.php - function menuItem($url, $text, $id=null, $title=null, $is_selected=false) + function menuItem($url, $text, $title=null, $is_selected=false, $id=null) { $lattrs = array(); if ($is_selected) { -- cgit v1.2.3-54-g00ecf From 60fa833908da5476e7c2e971fb60c85d7fa134e8 Mon Sep 17 00:00:00 2001 From: sarven Date: Thu, 15 Jan 2009 21:30:23 +0000 Subject: changed to class nav from id --- lib/action.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index a8b5e70b1..dd84977f0 100644 --- a/lib/action.php +++ b/lib/action.php @@ -237,7 +237,7 @@ class Action extends HTMLOutputter // lawsuit $this->element('dt', null, _('Primary site navigation')); $this->elementStart('dd'); $user = common_current_user(); - $this->elementStart('ul', array('id' => 'nav')); + $this->elementStart('ul', array('class' => 'nav')); if ($user) { $this->menuItem(common_local_url('all', array('nickname' => $user->nickname)), _('Home')); @@ -370,7 +370,7 @@ class Action extends HTMLOutputter // lawsuit $this->elementStart('dl', array('id' => 'site_nav_global_secondary')); $this->element('dt', null, _('Secondary site navigation')); $this->elementStart('dd', null); - $this->elementStart('ul', array('id' => 'nav')); + $this->elementStart('ul', array('class' => 'nav')); $this->menuItem(common_local_url('doc', array('title' => 'help')), _('Help')); $this->menuItem(common_local_url('doc', array('title' => 'about')), -- cgit v1.2.3-54-g00ecf From 2a5da870cb00d5b207cdcacea977fe3178903be3 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 21:33:45 +0000 Subject: Change multiple id=nav to class=nav --- lib/action.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index a8b5e70b1..dd84977f0 100644 --- a/lib/action.php +++ b/lib/action.php @@ -237,7 +237,7 @@ class Action extends HTMLOutputter // lawsuit $this->element('dt', null, _('Primary site navigation')); $this->elementStart('dd'); $user = common_current_user(); - $this->elementStart('ul', array('id' => 'nav')); + $this->elementStart('ul', array('class' => 'nav')); if ($user) { $this->menuItem(common_local_url('all', array('nickname' => $user->nickname)), _('Home')); @@ -370,7 +370,7 @@ class Action extends HTMLOutputter // lawsuit $this->elementStart('dl', array('id' => 'site_nav_global_secondary')); $this->element('dt', null, _('Secondary site navigation')); $this->elementStart('dd', null); - $this->elementStart('ul', array('id' => 'nav')); + $this->elementStart('ul', array('class' => 'nav')); $this->menuItem(common_local_url('doc', array('title' => 'help')), _('Help')); $this->menuItem(common_local_url('doc', array('title' => 'about')), -- cgit v1.2.3-54-g00ecf From 4f3f23c61ae58de766c1fbc6dde5d979fda72764 Mon Sep 17 00:00:00 2001 From: sarven Date: Thu, 15 Jan 2009 21:34:33 +0000 Subject: core uses id --- lib/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index dd84977f0..3efb65a65 100644 --- a/lib/action.php +++ b/lib/action.php @@ -287,7 +287,7 @@ class Action extends HTMLOutputter // lawsuit function showCore() { - $this->elementStart('div', array('class' => 'core')); + $this->elementStart('div', array('id' => 'core')); $this->showLocalNav(); $this->showContentBlock(); $this->showAside(); -- cgit v1.2.3-54-g00ecf From 2c84f077a2a41cb9c71ef79a33083b6084a0556b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 21:39:48 +0000 Subject: Add aside div --- lib/action.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index dd84977f0..d5eb6de2d 100644 --- a/lib/action.php +++ b/lib/action.php @@ -338,8 +338,10 @@ class Action extends HTMLOutputter // lawsuit function showAside() { + $this->elementStart('div', 'aside'); $this->showExportData(); $this->showSections(); + $this->elementEnd('div'); } // MAY overload if there are feeds -- cgit v1.2.3-54-g00ecf From 18dc498a6a7308bb9b5f41bdb33fca4addf8d80b Mon Sep 17 00:00:00 2001 From: sarven Date: Thu, 15 Jan 2009 22:00:48 +0000 Subject: Added aside_primary id --- lib/action.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 76962482f..773b0dce9 100644 --- a/lib/action.php +++ b/lib/action.php @@ -338,10 +338,11 @@ class Action extends HTMLOutputter // lawsuit function showAside() { - $this->elementStart('div', 'aside'); + $this->elementStart('div', array('id' => 'aside_primary', + 'class' => 'aside')); $this->showExportData(); $this->showSections(); - $this->elementEnd('div'); + $this->elementEnd('div'); } // MAY overload if there are feeds -- cgit v1.2.3-54-g00ecf From a72ae0f4df7e9bbbd4864e21f784ea0da53dfcac Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 22:17:48 +0000 Subject: Move wrapper for content --- lib/action.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 76962482f..76cf419cb 100644 --- a/lib/action.php +++ b/lib/action.php @@ -306,8 +306,11 @@ class Action extends HTMLOutputter // lawsuit $this->elementStart('div', array('id' => 'content')); $this->showPageTitle(); $this->showPageNotice(); + $this->elementStart('div', array('id' => 'content_inner')); + // show the actual content (forms, lists, whatever) $this->showContent(); $this->elementEnd('div'); + $this->elementEnd('div'); } function showPageTitle() { @@ -331,9 +334,6 @@ class Action extends HTMLOutputter // lawsuit function showContent() { - // show the actual content (forms, lists, whatever) - $this->elementStart('div', array('id' => 'content_inner')); - $this->elementEnd('div'); } function showAside() -- cgit v1.2.3-54-g00ecf From d012bdabde712fbb600408d4a834cba399d4015d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 22:25:26 +0000 Subject: Show NoticeForm only if logged in --- lib/action.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index d106ba366..9df39e9a8 100644 --- a/lib/action.php +++ b/lib/action.php @@ -208,7 +208,11 @@ class Action extends HTMLOutputter // lawsuit $this->showLogo(); $this->showPrimaryNav(); $this->showSiteNotice(); - $this->showNoticeForm(); + if (common_logged_in()) { + $this->showNoticeForm(); + } else { + $this->showAnonymousMessage(); + } $this->elementEnd('div'); } @@ -285,6 +289,11 @@ class Action extends HTMLOutputter // lawsuit $notice_form->show(); } + function showAnonymousMessage() + { + // needs to be defined by the class + } + function showCore() { $this->elementStart('div', array('id' => 'core')); -- cgit v1.2.3-54-g00ecf From 2b2fb276219f87cdc0430d91ac3695e098ae48f4 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 22:40:56 +0000 Subject: Fix use of $config in licenses --- lib/action.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 9df39e9a8..d5060758e 100644 --- a/lib/action.php +++ b/lib/action.php @@ -432,13 +432,13 @@ class Action extends HTMLOutputter // lawsuit $this->text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the ')); $this->element('a', array('class' => 'license', 'rel' => 'external license', - 'href' => $config['license']['url']), - $config['license']['title']); + 'href' => common_config('license', 'url')), + common_config('license', 'title')); $this->text(_('. Contributors should be attributed by full name or nickname.')); $this->elementEnd('p'); $this->element('img', array('id' => 'license_cc', - 'src' => $config['license']['image'], - 'alt' => $config['license']['title'])); + 'src' => common_config('license', 'image'), + 'alt' => common_config('license', 'title'))); $this->elementEnd('dd'); } -- cgit v1.2.3-54-g00ecf From eaa81d25fa7bd954132ce7f901fae69b0d46ec1a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 22:57:15 +0000 Subject: Convert all actions to use new UI functions I did a massive search-and-replace to get all the action subclasses to use the new output function (common_element() -> $this->element(), etc.) There's still a lot to do, but it's a first step --- actions/all.php | 2 +- actions/api.php | 8 +- actions/block.php | 16 ++-- actions/confirmaddress.php | 2 +- actions/deletenotice.php | 18 ++--- actions/deleteprofile.php | 40 +++++----- actions/disfavor.php | 12 +-- actions/doc.php | 2 +- actions/emailsettings.php | 72 ++++++++--------- actions/facebookhome.php | 2 +- actions/facebookinvite.php | 38 ++++----- actions/facebooksettings.php | 40 +++++----- actions/favor.php | 12 +-- actions/favorited.php | 10 +-- actions/featured.php | 6 +- actions/finishaddopenid.php | 2 +- actions/finishopenidlogin.php | 42 +++++----- actions/foaf.php | 72 ++++++++--------- actions/imsettings.php | 48 ++++++------ actions/invite.php | 46 +++++------ actions/login.php | 54 ++++++++----- actions/newmessage.php | 2 +- actions/newnotice.php | 28 +++---- actions/noticesearch.php | 48 ++++++------ actions/nudge.php | 12 +-- actions/openidlogin.php | 20 ++--- actions/openidsettings.php | 48 ++++++------ actions/opensearch.php | 24 +++--- actions/othersettings.php | 40 +++++----- actions/peoplesearch.php | 2 +- actions/peopletag.php | 10 +-- actions/profilesettings.php | 90 ++++++++++----------- actions/publicxrds.php | 24 +++--- actions/recoverpassword.php | 36 ++++----- actions/register.php | 58 +++++++------- actions/remotesubscribe.php | 20 ++--- actions/replies.php | 2 +- actions/showfavorites.php | 2 +- actions/shownotice.php | 8 +- actions/showstream.php | 156 ++++++++++++++++++------------------- actions/smssettings.php | 86 ++++++++++---------- actions/subscribe.php | 12 +-- actions/subscriptions.php | 14 ++-- actions/tag.php | 16 ++-- actions/tagother.php | 54 ++++++------- actions/twitapidirect_messages.php | 28 +++---- actions/twitapifriendships.php | 2 +- actions/twitapihelp.php | 2 +- actions/twitapilaconica.php | 12 +-- actions/twitapistatuses.php | 4 +- actions/twittersettings.php | 64 +++++++-------- actions/unsubscribe.php | 12 +-- actions/userauthorization.php | 44 +++++------ actions/xrds.php | 36 ++++----- lib/action.php | 23 +++--- 55 files changed, 801 insertions(+), 782 deletions(-) (limited to 'lib/action.php') diff --git a/actions/all.php b/actions/all.php index 526ac5f40..a8a74fb33 100644 --- a/actions/all.php +++ b/actions/all.php @@ -57,7 +57,7 @@ class AllAction extends StreamAction function show_header($user) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('allrss', array('nickname' => $user->nickname)), 'type' => 'application/rss+xml', diff --git a/actions/api.php b/actions/api.php index 7a0759831..9cbf9a468 100644 --- a/actions/api.php +++ b/actions/api.php @@ -159,10 +159,10 @@ class ApiAction extends Action if ($this->content_type == 'xml') { header('Content-Type: application/xml; charset=utf-8'); common_start_xml(); - common_element_start('hash'); - common_element('error', null, $msg); - common_element('request', null, $_SERVER['REQUEST_URI']); - common_element_end('hash'); + $this->elementStart('hash'); + $this->element('error', null, $msg); + $this->element('request', null, $_SERVER['REQUEST_URI']); + $this->elementEnd('hash'); common_end_xml(); } else if ($this->content_type == 'json') { header('Content-Type: application/json; charset=utf-8'); diff --git a/actions/block.php b/actions/block.php index c1ff7c044..f8f6f24fd 100644 --- a/actions/block.php +++ b/actions/block.php @@ -81,34 +81,34 @@ class BlockAction extends Action common_show_header(_('Block user')); - common_element('p', null, + $this->element('p', null, _('Are you sure you want to block this user? '. 'Afterwards, they will be unsubscribed from you, '. 'unable to subscribe to you in the future, and '. 'you will not be notified of any @-replies from them.')); - common_element_start('form', array('id' => 'block-' . $id, + $this->elementStart('form', array('id' => 'block-' . $id, 'method' => 'post', 'class' => 'block', 'action' => common_local_url('block'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_element('input', array('id' => 'blockto-' . $id, + $this->element('input', array('id' => 'blockto-' . $id, 'name' => 'blockto', 'type' => 'hidden', 'value' => $id)); foreach ($this->args as $k => $v) { if (substr($k, 0, 9) == 'returnto-') { - common_hidden($k, $v); + $this->hidden($k, $v); } } - common_submit('no', _('No')); - common_submit('yes', _('Yes')); + $this->submit('no', _('No')); + $this->submit('yes', _('Yes')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php index 1d5c53ff2..31a157768 100644 --- a/actions/confirmaddress.php +++ b/actions/confirmaddress.php @@ -90,7 +90,7 @@ class ConfirmaddressAction extends Action $cur->query('COMMIT'); common_show_header(_('Confirm Address')); - common_element('p', null, + $this->element('p', null, sprintf(_('The address "%s" has been confirmed for your account.'), $cur->$type)); common_show_footer(); } diff --git a/actions/deletenotice.php b/actions/deletenotice.php index e9b4b3254..bae0eac1b 100644 --- a/actions/deletenotice.php +++ b/actions/deletenotice.php @@ -51,24 +51,24 @@ class DeletenoticeAction extends DeleteAction common_show_header($this->get_title(), array($this, 'show_header'), $error, array($this, 'show_top')); - common_element_start('form', array('id' => 'notice_delete_form', + $this->elementStart('form', array('id' => 'notice_delete_form', 'method' => 'post', 'action' => common_local_url('deletenotice'))); - common_hidden('token', common_session_token()); - common_hidden('notice', $this->trimmed('notice')); - common_element_start('p'); - common_element('span', array('id' => 'confirmation_text'), _('Are you sure you want to delete this notice?')); + $this->hidden('token', common_session_token()); + $this->hidden('notice', $this->trimmed('notice')); + $this->elementStart('p'); + $this->element('span', array('id' => 'confirmation_text'), _('Are you sure you want to delete this notice?')); - common_element('input', array('id' => 'submit_no', + $this->element('input', array('id' => 'submit_no', 'name' => 'submit', 'type' => 'submit', 'value' => _('No'))); - common_element('input', array('id' => 'submit_yes', + $this->element('input', array('id' => 'submit_yes', 'name' => 'submit', 'type' => 'submit', 'value' => _('Yes'))); - common_element_end('p'); - common_element_end('form'); + $this->elementEnd('p'); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/deleteprofile.php b/actions/deleteprofile.php index e12fe131a..ef4687d5f 100644 --- a/actions/deleteprofile.php +++ b/actions/deleteprofile.php @@ -49,15 +49,15 @@ class DeleteprofileAction extends Action function show_feeds_list($feeds) { - common_element_start('div', array('class' => 'feedsdel')); - common_element('p', null, 'Feeds:'); - common_element_start('ul', array('class' => 'xoxo')); + $this->elementStart('div', array('class' => 'feedsdel')); + $this->element('p', null, 'Feeds:'); + $this->elementStart('ul', array('class' => 'xoxo')); foreach ($feeds as $key => $value) { $this->common_feed_item($feeds[$key]); } - common_element_end('ul'); - common_element_end('div'); + $this->elementEnd('ul'); + $this->elementEnd('div'); } //TODO move to common.php (and retrace its origin) @@ -81,19 +81,19 @@ class DeleteprofileAction extends Action $feed['textContent'] = "FOAF"; break; } - common_element_start('li'); - common_element('a', array('href' => $feed['href'], + $this->elementStart('li'); + $this->element('a', array('href' => $feed['href'], 'class' => $feed_classname, 'type' => $feed_mimetype, 'title' => $feed_title), $feed['textContent']); - common_element_end('li'); + $this->elementEnd('li'); } function show_form($msg=null, $success=false) { $this->form_header(_('Delete my account'), $msg, $success); - common_element('h2', null, _('Delete my account confirmation')); + $this->element('h2', null, _('Delete my account confirmation')); $this->show_confirm_delete_form(); common_show_footer(); } @@ -105,13 +105,13 @@ class DeleteprofileAction extends Action $notices->profile_id = $user->id; $notice_count = (int) $notices->count(); - common_element_start('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'POST', 'id' => 'delete', 'action' => common_local_url('deleteprofile'))); - common_hidden('token', common_session_token()); - common_element('p', null, "Last chance to copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); + $this->hidden('token', common_session_token()); + $this->element('p', null, "Last chance to copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); $this->show_feeds_list(array(0=>array('href'=>common_local_url('userrss', array('limit' => $notice_count, 'nickname' => $user->nickname)), 'type' => 'rss', @@ -122,10 +122,10 @@ class DeleteprofileAction extends Action 'version' => 'FOAF', 'item' => 'foaf'))); - common_checkbox('confirmation', _('Check if you are sure you want to delete your account.')); + $this->checkbox('confirmation', _('Check if you are sure you want to delete your account.')); - common_submit('deleteaccount', _('Delete my account')); - common_element_end('form'); + $this->submit('deleteaccount', _('Delete my account')); + $this->elementEnd('form'); } function handle_post() @@ -238,9 +238,9 @@ class DeleteprofileAction extends Action } else { $inst = $this->get_instructions(); $output = common_markup_to_html($inst); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); } $this->settings_menu(); } @@ -272,7 +272,7 @@ class DeleteprofileAction extends Action _('Other options'))); $action = $this->trimmed('action'); - common_element_start('ul', array('id' => 'nav_views')); + $this->elementStart('ul', array('id' => 'nav_views')); foreach ($menu as $menuaction => $menudesc) { if ($menuaction == 'imsettings' && !common_config('xmpp', 'enabled')) { @@ -283,7 +283,7 @@ class DeleteprofileAction extends Action $menudesc[1], $action == $menuaction); } - common_element_end('ul'); + $this->elementEnd('ul'); } } diff --git a/actions/disfavor.php b/actions/disfavor.php index 74aae86cc..9a27f34b1 100644 --- a/actions/disfavor.php +++ b/actions/disfavor.php @@ -70,13 +70,13 @@ class DisfavorAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Add to favorites')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Add to favorites')); + $this->elementEnd('head'); + $this->elementStart('body'); common_favor_form($notice); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url('showfavorites', array('nickname' => $user->nickname))); diff --git a/actions/doc.php b/actions/doc.php index 856025e66..98da31267 100644 --- a/actions/doc.php +++ b/actions/doc.php @@ -34,7 +34,7 @@ class DocAction extends Action $c = file_get_contents($filename); $output = common_markup_to_html($c); common_show_header(_(ucfirst($title))); - common_raw($output); + $this->raw($output); common_show_footer(); } } diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 3fa8ce296..39f186bff 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -33,83 +33,83 @@ class EmailsettingsAction extends SettingsAction { $user = common_current_user(); $this->form_header(_('Email Settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'emailsettings', 'action' => common_local_url('emailsettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_element('h2', null, _('Address')); + $this->element('h2', null, _('Address')); if ($user->email) { - common_element_start('p'); - common_element('span', 'address confirmed', $user->email); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address confirmed', $user->email); + $this->element('span', 'input_instructions', _('Current confirmed email address.')); - common_hidden('email', $user->email); - common_element_end('p'); - common_submit('remove', _('Remove')); + $this->hidden('email', $user->email); + $this->elementEnd('p'); + $this->submit('remove', _('Remove')); } else { $confirm = $this->get_confirmation(); if ($confirm) { - common_element_start('p'); - common_element('span', 'address unconfirmed', $confirm->address); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address unconfirmed', $confirm->address); + $this->element('span', 'input_instructions', _('Awaiting confirmation on this address. Check your inbox (and spam box!) for a message with further instructions.')); - common_hidden('email', $confirm->address); - common_element_end('p'); - common_submit('cancel', _('Cancel')); + $this->hidden('email', $confirm->address); + $this->elementEnd('p'); + $this->submit('cancel', _('Cancel')); } else { - common_input('email', _('Email Address'), + $this->input('email', _('Email Address'), ($this->arg('email')) ? $this->arg('email') : null, _('Email address, like "UserName@example.org"')); - common_submit('add', _('Add')); + $this->submit('add', _('Add')); } } if ($user->email) { - common_element('h2', null, _('Incoming email')); + $this->element('h2', null, _('Incoming email')); if ($user->incomingemail) { - common_element_start('p'); - common_element('span', 'address', $user->incomingemail); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address', $user->incomingemail); + $this->element('span', 'input_instructions', _('Send email to this address to post new notices.')); - common_element_end('p'); - common_submit('removeincoming', _('Remove')); + $this->elementEnd('p'); + $this->submit('removeincoming', _('Remove')); } - common_element_start('p'); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'input_instructions', _('Make a new email address for posting to; cancels the old one.')); - common_element_end('p'); - common_submit('newincoming', _('New')); + $this->elementEnd('p'); + $this->submit('newincoming', _('New')); } - common_element('h2', null, _('Preferences')); + $this->element('h2', null, _('Preferences')); - common_checkbox('emailnotifysub', + $this->checkbox('emailnotifysub', _('Send me notices of new subscriptions through email.'), $user->emailnotifysub); - common_checkbox('emailnotifyfav', + $this->checkbox('emailnotifyfav', _('Send me email when someone adds my notice as a favorite.'), $user->emailnotifyfav); - common_checkbox('emailnotifymsg', + $this->checkbox('emailnotifymsg', _('Send me email when someone sends me a private message.'), $user->emailnotifymsg); - common_checkbox('emailnotifynudge', + $this->checkbox('emailnotifynudge', _('Allow friends to nudge me and send me an email.'), $user->emailnotifynudge); - common_checkbox('emailpost', + $this->checkbox('emailpost', _('I want to post notices by email.'), $user->emailpost); - common_checkbox('emailmicroid', + $this->checkbox('emailmicroid', _('Publish a MicroID for my email address.'), $user->emailmicroid); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/facebookhome.php b/actions/facebookhome.php index f72f08a34..d2ac7617d 100644 --- a/actions/facebookhome.php +++ b/actions/facebookhome.php @@ -105,7 +105,7 @@ class FacebookhomeAction extends FacebookAction $this->show_header('Home'); if ($msg) { - common_element('fb:success', array('message' => $msg)); + $this->element('fb:success', array('message' => $msg)); } echo $this->show_notices($user); diff --git a/actions/facebookinvite.php b/actions/facebookinvite.php index fe0c5e493..103d5a568 100644 --- a/actions/facebookinvite.php +++ b/actions/facebookinvite.php @@ -43,22 +43,22 @@ class FacebookinviteAction extends FacebookAction $this->show_header('Invite'); - common_element('h2', null, _('Thanks for inviting your friends to use Identi.ca!')); - common_element('p', null, _('Invitations have been sent to the following users:')); + $this->element('h2', null, _('Thanks for inviting your friends to use Identi.ca!')); + $this->element('p', null, _('Invitations have been sent to the following users:')); $friend_ids = $_POST['ids']; // Hmm... $this->arg('ids') doesn't seem to work - common_element_start("ul"); + $this->elementStart("ul"); foreach ($friend_ids as $friend) { - common_element_start('li'); - common_element('fb:profile-pic', array('uid' => $friend)); - common_element('fb:name', array('uid' => $friend, + $this->elementStart('li'); + $this->element('fb:profile-pic', array('uid' => $friend)); + $this->element('fb:name', array('uid' => $friend, 'capitalize' => 'true')); - common_element_end('li'); + $this->elementEnd('li'); } - common_element_end("ul"); + $this->elementEnd("ul"); $this->show_footer(); } @@ -77,32 +77,32 @@ class FacebookinviteAction extends FacebookAction $content = _('You have been invited to Identi.ca!') . htmlentities(''); - common_element_start('fb:request-form', array('action' => 'invite.php', + $this->elementStart('fb:request-form', array('action' => 'invite.php', 'method' => 'post', 'invite' => 'true', 'type' => 'Identi.ca', 'content' => $content)); - common_hidden('invite', 'true'); + $this->hidden('invite', 'true'); $actiontext = 'Invite your friends to use Identi.ca.'; - common_element('fb:multi-friend-selector', array('showborder' => 'false', + $this->element('fb:multi-friend-selector', array('showborder' => 'false', 'actiontext' => $actiontext, 'exclude_ids' => implode(',', $exclude_ids), 'bypass' => 'cancel')); - common_element_end('fb:request-form'); + $this->elementEnd('fb:request-form'); - common_element('h2', null, _('Friends already using Identi.ca:')); - common_element_start("ul"); + $this->element('h2', null, _('Friends already using Identi.ca:')); + $this->elementStart("ul"); foreach ($exclude_ids as $friend) { - common_element_start('li'); - common_element('fb:profile-pic', array('uid' => $friend)); - common_element('fb:name', array('uid' => $friend, + $this->elementStart('li'); + $this->element('fb:profile-pic', array('uid' => $friend)); + $this->element('fb:name', array('uid' => $friend, 'capitalize' => 'true')); - common_element_end('li'); + $this->elementEnd('li'); } - common_element_end("ul"); + $this->elementEnd("ul"); $this->show_footer(); diff --git a/actions/facebooksettings.php b/actions/facebooksettings.php index ab04ad82b..8b071353a 100644 --- a/actions/facebooksettings.php +++ b/actions/facebooksettings.php @@ -68,43 +68,43 @@ class FacebooksettingsAction extends FacebookAction $this->show_header('Settings', $msg, $success); - common_element_start('fb:if-section-not-added', array('section' => 'profile')); - common_element('h2', null, _('Add an Identi.ca box to my profile')); - common_element_start('p'); - common_element('fb:add-section-button', array('section' => 'profile')); - common_element_end('p'); - - common_element_end('fb:if-section-not-added'); - common_element_start('p'); - common_element_start('fb:prompt-permission', array('perms' => 'status_update')); - common_element('h2', null, _('Allow Identi.ca to update my Facebook status')); - common_element_end('fb:prompt-permission'); - common_element_end('p'); + $this->elementStart('fb:if-section-not-added', array('section' => 'profile')); + $this->element('h2', null, _('Add an Identi.ca box to my profile')); + $this->elementStart('p'); + $this->element('fb:add-section-button', array('section' => 'profile')); + $this->elementEnd('p'); + + $this->elementEnd('fb:if-section-not-added'); + $this->elementStart('p'); + $this->elementStart('fb:prompt-permission', array('perms' => 'status_update')); + $this->element('h2', null, _('Allow Identi.ca to update my Facebook status')); + $this->elementEnd('fb:prompt-permission'); + $this->elementEnd('p'); if ($facebook->api_client->users_hasAppPermission('status_update')) { - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'facebook_settings')); - common_element('h2', null, _('Sync preferences')); + $this->element('h2', null, _('Sync preferences')); - common_checkbox('noticesync', _('Automatically update my Facebook status with my notices.'), + $this->checkbox('noticesync', _('Automatically update my Facebook status with my notices.'), ($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND) : true); - common_checkbox('replysync', _('Send local "@" replies to Facebook.'), + $this->checkbox('replysync', _('Send local "@" replies to Facebook.'), ($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true); - // function common_input($id, $label, $value=null,$instructions=null) + // function $this->input($id, $label, $value=null,$instructions=null) $prefix = $facebook->api_client->data_getUserPreference(1); - common_input('prefix', _('Prefix'), + $this->input('prefix', _('Prefix'), ($prefix) ? $prefix : null, _('A string to prefix notices with.')); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); } diff --git a/actions/favor.php b/actions/favor.php index 8103f8181..1dfef9bbb 100644 --- a/actions/favor.php +++ b/actions/favor.php @@ -69,13 +69,13 @@ class FavorAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Disfavor favorite')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Disfavor favorite')); + $this->elementEnd('head'); + $this->elementStart('body'); common_disfavor_form($notice); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url('showfavorites', array('nickname' => $user->nickname))); diff --git a/actions/favorited.php b/actions/favorited.php index 71a9e026e..936905732 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -43,9 +43,9 @@ class FavoritedAction extends StreamAction { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); $this->public_views_menu(); } @@ -81,7 +81,7 @@ class FavoritedAction extends StreamAction $notice = new Notice; $notice->query(sprintf($qry, common_config('popular', 'dropoff'))); - common_element_start('ul', array('id' => 'notices')); + $this->elementStart('ul', array('id' => 'notices')); $cnt = 0; @@ -96,7 +96,7 @@ class FavoritedAction extends StreamAction $item->show(); } - common_element_end('ul'); + $this->elementEnd('ul'); common_pagination($page > 1, $cnt > NOTICES_PER_PAGE, $page, 'favorited'); diff --git a/actions/featured.php b/actions/featured.php index 2bf8b0b81..035622691 100644 --- a/actions/featured.php +++ b/actions/featured.php @@ -44,9 +44,9 @@ class FeaturedAction extends StreamAction { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); $this->public_views_menu(); } diff --git a/actions/finishaddopenid.php b/actions/finishaddopenid.php index 0ce1680aa..7de631712 100644 --- a/actions/finishaddopenid.php +++ b/actions/finishaddopenid.php @@ -101,7 +101,7 @@ class FinishaddopenidAction extends Action function message($msg) { common_show_header(_('OpenID Login')); - common_element('p', null, $msg); + $this->element('p', null, $msg); common_show_footer(); } } diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index bdb8516a3..112429002 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -57,10 +57,10 @@ class FinishopenidloginAction extends Action function show_top($error=null) { if ($error) { - common_element('div', array('class' => 'error'), $error); + $this->element('div', array('class' => 'error'), $error); } else { global $config; - common_element('div', 'instructions', + $this->element('div', 'instructions', sprintf(_('This is the first time you\'ve logged into %s so we must connect your OpenID to a local account. You can either create a new account, or connect with your existing account, if you have one.'), $config['site']['name'])); } } @@ -70,36 +70,36 @@ class FinishopenidloginAction extends Action common_show_header(_('OpenID Account Setup'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'account_connect', 'action' => common_local_url('finishopenidlogin'))); - common_hidden('token', common_session_token()); - common_element('h2', null, + $this->hidden('token', common_session_token()); + $this->element('h2', null, _('Create new account')); - common_element('p', null, + $this->element('p', null, _('Create a new user with this nickname.')); - common_input('newname', _('New nickname'), + $this->input('newname', _('New nickname'), ($username) ? $username : '', _('1-64 lowercase letters or numbers, no punctuation or spaces')); - common_element_start('p'); - common_element('input', array('type' => 'checkbox', + $this->elementStart('p'); + $this->element('input', array('type' => 'checkbox', 'id' => 'license', 'name' => 'license', 'value' => 'true')); - common_text(_('My text and files are available under ')); - common_element('a', array(href => common_config('license', 'url')), + $this->text(_('My text and files are available under ')); + $this->element('a', array(href => common_config('license', 'url')), common_config('license', 'title')); - common_text(_(' except this private data: password, email address, IM address, phone number.')); - common_element_end('p'); - common_submit('create', _('Create')); - common_element('h2', null, + $this->text(_(' except this private data: password, email address, IM address, phone number.')); + $this->elementEnd('p'); + $this->submit('create', _('Create')); + $this->element('h2', null, _('Connect existing account')); - common_element('p', null, + $this->element('p', null, _('If you already have an account, login with your username and password to connect it to your OpenID.')); - common_input('nickname', _('Existing nickname')); - common_password('password', _('Password')); - common_submit('connect', _('Connect')); - common_element_end('form'); + $this->input('nickname', _('Existing nickname')); + $this->password('password', _('Password')); + $this->submit('connect', _('Connect')); + $this->elementEnd('form'); common_show_footer(); } @@ -154,7 +154,7 @@ class FinishopenidloginAction extends Action function message($msg) { common_show_header(_('OpenID Login')); - common_element('p', null, $msg); + $this->element('p', null, $msg); common_show_footer(); } diff --git a/actions/foaf.php b/actions/foaf.php index 30e98960c..6f73ce505 100644 --- a/actions/foaf.php +++ b/actions/foaf.php @@ -54,7 +54,7 @@ class FoafAction extends Action header('Content-Type: application/rdf+xml'); common_start_xml(); - common_element_start('rdf:RDF', array('xmlns:rdf' => + $this->elementStart('rdf:RDF', array('xmlns:rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'xmlns:rdfs' => 'http://www.w3.org/2000/01/rdf-schema#', @@ -67,25 +67,25 @@ class FoafAction extends Action $this->show_ppd('', $user->uri); # XXX: might not be a person - common_element_start('Person', array('rdf:about' => + $this->elementStart('Person', array('rdf:about' => $user->uri)); - common_element('mbox_sha1sum', null, sha1('mailto:' . $user->email)); + $this->element('mbox_sha1sum', null, sha1('mailto:' . $user->email)); if ($profile->fullname) { - common_element('name', null, $profile->fullname); + $this->element('name', null, $profile->fullname); } if ($profile->homepage) { - common_element('homepage', array('rdf:resource' => $profile->homepage)); + $this->element('homepage', array('rdf:resource' => $profile->homepage)); } if ($profile->bio) { - common_element('rdfs:comment', null, $profile->bio); + $this->element('rdfs:comment', null, $profile->bio); } # XXX: more structured location data if ($profile->location) { - common_element_start('based_near'); - common_element_start('geo:SpatialThing'); - common_element('name', null, $profile->location); - common_element_end('geo:SpatialThing'); - common_element_end('based_near'); + $this->elementStart('based_near'); + $this->elementStart('geo:SpatialThing'); + $this->element('name', null, $profile->location); + $this->elementEnd('geo:SpatialThing'); + $this->elementEnd('based_near'); } $this->show_microblogging_account($profile, common_root_url()); @@ -93,18 +93,18 @@ class FoafAction extends Action $avatar = $profile->getOriginalAvatar(); if ($avatar) { - common_element_start('img'); - common_element_start('Image', array('rdf:about' => $avatar->url)); + $this->elementStart('img'); + $this->elementStart('Image', array('rdf:about' => $avatar->url)); foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) { $scaled = $profile->getAvatar($size); if (!$scaled->original) { # sometimes the original has one of our scaled sizes - common_element_start('thumbnail'); - common_element('Image', array('rdf:about' => $scaled->url)); - common_element_end('thumbnail'); + $this->elementStart('thumbnail'); + $this->element('Image', array('rdf:about' => $scaled->url)); + $this->elementEnd('thumbnail'); } } - common_element_end('Image'); - common_element_end('img'); + $this->elementEnd('Image'); + $this->elementEnd('img'); } # Get people user is subscribed to @@ -126,7 +126,7 @@ class FoafAction extends Action common_debug('Got a bad subscription: '.print_r($sub,true)); continue; } - common_element('knows', array('rdf:resource' => $other->uri)); + $this->element('knows', array('rdf:resource' => $other->uri)); $person[$other->uri] = array(LISTENEE, $other); } } @@ -156,7 +156,7 @@ class FoafAction extends Action } } - common_element_end('Person'); + $this->elementEnd('Person'); foreach ($person as $uri => $p) { $foaf_url = null; @@ -164,44 +164,44 @@ class FoafAction extends Action $foaf_url = common_local_url('foaf', array('nickname' => $p[1]->nickname)); } $profile = Profile::staticGet($p[1]->id); - common_element_start('Person', array('rdf:about' => $uri)); + $this->elementStart('Person', array('rdf:about' => $uri)); if ($p[0] == LISTENER || $p[0] == BOTH) { - common_element('knows', array('rdf:resource' => $user->uri)); + $this->element('knows', array('rdf:resource' => $user->uri)); } $this->show_microblogging_account($profile, ($p[1] instanceof User) ? common_root_url() : null); if ($foaf_url) { - common_element('rdfs:seeAlso', array('rdf:resource' => $foaf_url)); + $this->element('rdfs:seeAlso', array('rdf:resource' => $foaf_url)); } - common_element_end('Person'); + $this->elementEnd('Person'); if ($foaf_url) { $this->show_ppd($foaf_url, $uri); } } - common_element_end('rdf:RDF'); + $this->elementEnd('rdf:RDF'); } function show_ppd($foaf_url, $person_uri) { - common_element_start('PersonalProfileDocument', array('rdf:about' => $foaf_url)); - common_element('maker', array('rdf:resource' => $person_uri)); - common_element('primaryTopic', array('rdf:resource' => $person_uri)); - common_element_end('PersonalProfileDocument'); + $this->elementStart('PersonalProfileDocument', array('rdf:about' => $foaf_url)); + $this->element('maker', array('rdf:resource' => $person_uri)); + $this->element('primaryTopic', array('rdf:resource' => $person_uri)); + $this->elementEnd('PersonalProfileDocument'); } function show_microblogging_account($profile, $service=null) { # Their account - common_element_start('holdsAccount'); - common_element_start('OnlineAccount'); + $this->elementStart('holdsAccount'); + $this->elementStart('OnlineAccount'); if ($service) { - common_element('accountServiceHomepage', array('rdf:resource' => + $this->element('accountServiceHomepage', array('rdf:resource' => $service)); } - common_element('accountName', null, $profile->nickname); - common_element('homepage', array('rdf:resource' => $profile->profileurl)); - common_element_end('OnlineAccount'); - common_element_end('holdsAccount'); + $this->element('accountName', null, $profile->nickname); + $this->element('homepage', array('rdf:resource' => $profile->profileurl)); + $this->elementEnd('OnlineAccount'); + $this->elementEnd('holdsAccount'); } } diff --git a/actions/imsettings.php b/actions/imsettings.php index 8ecf200ec..693f49efa 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -34,57 +34,57 @@ class ImsettingsAction extends SettingsAction { $user = common_current_user(); $this->form_header(_('IM Settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'imsettings', 'action' => common_local_url('imsettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_element('h2', null, _('Address')); + $this->element('h2', null, _('Address')); if ($user->jabber) { - common_element_start('p'); - common_element('span', 'address confirmed', $user->jabber); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address confirmed', $user->jabber); + $this->element('span', 'input_instructions', _('Current confirmed Jabber/GTalk address.')); - common_hidden('jabber', $user->jabber); - common_element_end('p'); - common_submit('remove', _('Remove')); + $this->hidden('jabber', $user->jabber); + $this->elementEnd('p'); + $this->submit('remove', _('Remove')); } else { $confirm = $this->get_confirmation(); if ($confirm) { - common_element_start('p'); - common_element('span', 'address unconfirmed', $confirm->address); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address unconfirmed', $confirm->address); + $this->element('span', 'input_instructions', sprintf(_('Awaiting confirmation on this address. Check your Jabber/GTalk account for a message with further instructions. (Did you add %s to your buddy list?)'), jabber_daemon_address())); - common_hidden('jabber', $confirm->address); - common_element_end('p'); - common_submit('cancel', _('Cancel')); + $this->hidden('jabber', $confirm->address); + $this->elementEnd('p'); + $this->submit('cancel', _('Cancel')); } else { - common_input('jabber', _('IM Address'), + $this->input('jabber', _('IM Address'), ($this->arg('jabber')) ? $this->arg('jabber') : null, sprintf(_('Jabber or GTalk address, like "UserName@example.org". First, make sure to add %s to your buddy list in your IM client or on GTalk.'), jabber_daemon_address())); - common_submit('add', _('Add')); + $this->submit('add', _('Add')); } } - common_element('h2', null, _('Preferences')); + $this->element('h2', null, _('Preferences')); - common_checkbox('jabbernotify', + $this->checkbox('jabbernotify', _('Send me notices through Jabber/GTalk.'), $user->jabbernotify); - common_checkbox('updatefrompresence', + $this->checkbox('updatefrompresence', _('Post a notice when my Jabber/GTalk status changes.'), $user->updatefrompresence); - common_checkbox('jabberreplies', + $this->checkbox('jabberreplies', _('Send me replies through Jabber/GTalk from people I\'m not subscribed to.'), $user->jabberreplies); - common_checkbox('jabbermicroid', + $this->checkbox('jabbermicroid', _('Publish a MicroID for my Jabber/GTalk address.'), $user->jabbermicroid); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/invite.php b/actions/invite.php index 80e022a3d..15233602e 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -89,29 +89,29 @@ class InviteAction extends Action common_show_header(_('Invitation(s) sent')); if ($already) { - common_element('p', null, _('You are already subscribed to these users:')); - common_element_start('ul'); + $this->element('p', null, _('You are already subscribed to these users:')); + $this->elementStart('ul'); foreach ($already as $other) { - common_element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); + $this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); } - common_element_end('ul'); + $this->elementEnd('ul'); } if ($subbed) { - common_element('p', null, _('These people are already users and you were automatically subscribed to them:')); - common_element_start('ul'); + $this->element('p', null, _('These people are already users and you were automatically subscribed to them:')); + $this->elementStart('ul'); foreach ($subbed as $other) { - common_element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); + $this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); } - common_element_end('ul'); + $this->elementEnd('ul'); } if ($sent) { - common_element('p', null, _('Invitation(s) sent to the following people:')); - common_element_start('ul'); + $this->element('p', null, _('Invitation(s) sent to the following people:')); + $this->elementStart('ul'); foreach ($sent as $other) { - common_element('li', null, $other); + $this->element('li', null, $other); } - common_element_end('ul'); - common_element('p', null, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!')); + $this->elementEnd('ul'); + $this->element('p', null, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!')); } common_show_footer(); } @@ -119,12 +119,12 @@ class InviteAction extends Action function show_top($error=null) { if ($error) { - common_element('p', 'error', $error); + $this->element('p', 'error', $error); } else { - common_element_start('div', 'instructions'); - common_element('p', null, + $this->elementStart('div', 'instructions'); + $this->element('p', null, _('Use this form to invite your friends and colleagues to use this service.')); - common_element_end('div'); + $this->elementEnd('div'); } } @@ -135,22 +135,22 @@ class InviteAction extends Action common_show_header(_('Invite new users'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'invite', 'action' => common_local_url('invite'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_textarea('addresses', _('Email addresses'), + $this->textarea('addresses', _('Email addresses'), $this->trimmed('addresses'), _('Addresses of friends to invite (one per line)')); - common_textarea('personal', _('Personal message'), + $this->textarea('personal', _('Personal message'), $this->trimmed('personal'), _('Optionally add a personal message to the invitation.')); - common_submit('send', _('Send')); + $this->submit('send', _('Send')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/login.php b/actions/login.php index 8600d44fd..fd98e656d 100644 --- a/actions/login.php +++ b/actions/login.php @@ -106,22 +106,45 @@ class LoginAction extends Action function show_form($error=null) { - common_show_header(_('Login'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->error = $error; + $this->showPage(); + } + + function title() + { + return _('Login'); + } + + function showPageNotice() + { + if ($this->error) { + $this->element('p', 'error', $this->error); + } else { + $instr = $this->get_instructions(); + $output = common_markup_to_html($instr); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); + } + } + + function showContent() + { + $this->elementStart('form', array('method' => 'post', 'id' => 'login', 'action' => common_local_url('login'))); - common_input('nickname', _('Nickname')); - common_password('password', _('Password')); - common_checkbox('rememberme', _('Remember me'), false, + $this->input('nickname', _('Nickname')); + $this->password('password', _('Password')); + $this->checkbox('rememberme', _('Remember me'), false, _('Automatically login in the future; ' . 'not for shared computers!')); - common_submit('submit', _('Login')); - common_hidden('token', common_session_token()); - common_element_end('form'); - common_element_start('p'); - common_element('a', array('href' => common_local_url('recoverpassword')), + $this->submit('submit', _('Login')); + $this->hidden('token', common_session_token()); + $this->elementEnd('form'); + $this->elementStart('p'); + $this->element('a', array('href' => common_local_url('recoverpassword')), _('Lost or forgotten password?')); - common_element_end('p'); + $this->elementEnd('p'); common_show_footer(); } @@ -146,14 +169,5 @@ class LoginAction extends Action function show_top($error=null) { - if ($error) { - common_element('p', 'error', $error); - } else { - $instr = $this->get_instructions(); - $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); - } } } diff --git a/actions/newmessage.php b/actions/newmessage.php index 27fa9d518..6221b67e9 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -127,7 +127,7 @@ class NewmessageAction extends Action array($this, 'show_top')); if ($msg) { - common_element('p', array('id'=>'error'), $msg); + $this->element('p', array('id'=>'error'), $msg); } common_show_footer(); diff --git a/actions/newnotice.php b/actions/newnotice.php index c412e893d..89792d95a 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -92,13 +92,13 @@ class NewnoticeAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Notice posted')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Notice posted')); + $this->elementEnd('head'); + $this->elementStart('body'); $this->show_notice($notice); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { $returnto = $this->trimmed('returnto'); @@ -116,13 +116,13 @@ class NewnoticeAction extends Action function ajax_error_msg($msg) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Ajax Error')); - common_element_end('head'); - common_element_start('body'); - common_element('p', array('id' => 'error'), $msg); - common_element_end('body'); - common_element_end('html'); + $this->elementStart('head'); + $this->element('title', null, _('Ajax Error')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->element('p', array('id' => 'error'), $msg); + $this->elementEnd('body'); + $this->elementEnd('html'); } function show_top($content=null) @@ -147,7 +147,7 @@ class NewnoticeAction extends Action common_show_header(_('New notice'), null, $content, array($this, 'show_top')); if ($msg) { - common_element('p', array('id' => 'error'), $msg); + $this->element('p', array('id' => 'error'), $msg); } common_show_footer(); } diff --git a/actions/noticesearch.php b/actions/noticesearch.php index b36fc8ad2..d998b9da8 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -58,7 +58,7 @@ class NoticesearchAction extends SearchAction } if ($cnt > 0) { $terms = preg_split('/[\s,]+/', $q); - common_element_start('ul', array('id' => 'notices')); + $this->elementStart('ul', array('id' => 'notices')); for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) { if ($notice->fetch()) { $this->show_notice($notice, $terms); @@ -67,9 +67,9 @@ class NoticesearchAction extends SearchAction break; } } - common_element_end('ul'); + $this->elementEnd('ul'); } else { - common_element('p', 'error', _('No results')); + $this->element('p', 'error', _('No results')); } common_pagination($page > 1, $cnt > NOTICES_PER_PAGE, @@ -82,7 +82,7 @@ class NoticesearchAction extends SearchAction $q = $arr[0]; } if ($q) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('noticesearchrss', array('q' => $q)), 'type' => 'application/rss+xml', @@ -101,58 +101,58 @@ class NoticesearchAction extends SearchAction return; } # XXX: RDFa - common_element_start('li', array('class' => 'notice_single', + $this->elementStart('li', array('class' => 'notice_single', 'id' => 'notice-' . $notice->id)); $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); - common_element_start('a', array('href' => $profile->profileurl)); - common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE), + $this->elementStart('a', array('href' => $profile->profileurl)); + $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE), 'class' => 'avatar stream', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => ($profile->fullname) ? $profile->fullname : $profile->nickname)); - common_element_end('a'); - common_element('a', array('href' => $profile->profileurl, + $this->elementEnd('a'); + $this->element('a', array('href' => $profile->profileurl, 'class' => 'nickname'), $profile->nickname); # FIXME: URL, image, video, audio - common_element_start('p', array('class' => 'content')); + $this->elementStart('p', array('class' => 'content')); if ($notice->rendered) { - common_raw($this->highlight($notice->rendered, $terms)); + $this->raw($this->highlight($notice->rendered, $terms)); } else { # XXX: may be some uncooked notices in the DB, # we cook them right now. This should probably disappear in future # versions (>> 0.4.x) - common_raw($this->highlight(common_render_content($notice->content, $notice), $terms)); + $this->raw($this->highlight(common_render_content($notice->content, $notice), $terms)); } - common_element_end('p'); + $this->elementEnd('p'); $noticeurl = common_local_url('shownotice', array('notice' => $notice->id)); - common_element_start('p', 'time'); - common_element('a', array('class' => 'permalink', + $this->elementStart('p', 'time'); + $this->element('a', array('class' => 'permalink', 'href' => $noticeurl, 'title' => common_exact_date($notice->created)), common_date_string($notice->created)); if ($notice->reply_to) { $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to)); - common_text(' ('); - common_element('a', array('class' => 'inreplyto', + $this->text(' ('); + $this->element('a', array('class' => 'inreplyto', 'href' => $replyurl), _('in reply to...')); - common_text(')'); + $this->text(')'); } - common_element_start('a', + $this->elementStart('a', array('href' => common_local_url('newnotice', array('replyto' => $profile->nickname)), 'onclick' => 'doreply("'.$profile->nickname.'"); return false', 'title' => _('reply'), 'class' => 'replybutton')); - common_hidden('posttoken', common_session_token()); + $this->hidden('posttoken', common_session_token()); - common_raw('→'); - common_element_end('a'); - common_element_end('p'); - common_element_end('li'); + $this->raw('→'); + $this->elementEnd('a'); + $this->elementEnd('p'); + $this->elementEnd('li'); } function highlight($text, $terms) diff --git a/actions/nudge.php b/actions/nudge.php index a6480a582..de930e462 100644 --- a/actions/nudge.php +++ b/actions/nudge.php @@ -59,13 +59,13 @@ class NudgeAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Nudge sent')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Nudge sent')); + $this->elementEnd('head'); + $this->elementStart('body'); common_nudge_response(); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { // display a confirmation to the user common_redirect(common_local_url('showstream', diff --git a/actions/openidlogin.php b/actions/openidlogin.php index 09679e372..82791af34 100644 --- a/actions/openidlogin.php +++ b/actions/openidlogin.php @@ -66,13 +66,13 @@ class OpenidloginAction extends Action function show_top($error=null) { if ($error) { - common_element('div', array('class' => 'error'), $error); + $this->element('div', array('class' => 'error'), $error); } else { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); } } @@ -80,18 +80,18 @@ class OpenidloginAction extends Action { common_show_header(_('OpenID Login'), null, $error, array($this, 'show_top')); $formaction = common_local_url('openidlogin'); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'openidlogin', 'action' => $formaction)); - common_hidden('token', common_session_token()); - common_input('openid_url', _('OpenID URL'), + $this->hidden('token', common_session_token()); + $this->input('openid_url', _('OpenID URL'), $openid_url, _('Your OpenID URL')); - common_checkbox('rememberme', _('Remember me'), false, + $this->checkbox('rememberme', _('Remember me'), false, _('Automatically login in the future; ' . 'not for shared computers!')); - common_submit('submit', _('Login')); - common_element_end('form'); + $this->submit('submit', _('Login')); + $this->elementEnd('form'); common_show_footer(); } } diff --git a/actions/openidsettings.php b/actions/openidsettings.php index 039236048..9265b5ea6 100644 --- a/actions/openidsettings.php +++ b/actions/openidsettings.php @@ -39,28 +39,28 @@ class OpenidsettingsAction extends SettingsAction $this->form_header(_('OpenID settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'openidadd', 'action' => common_local_url('openidsettings'))); - common_hidden('token', common_session_token()); - common_element('h2', null, _('Add OpenID')); - common_element('p', null, + $this->hidden('token', common_session_token()); + $this->element('h2', null, _('Add OpenID')); + $this->element('p', null, _('If you want to add an OpenID to your account, ' . 'enter it in the box below and click "Add".')); - common_element_start('p'); - common_element('label', array('for' => 'openid_url'), + $this->elementStart('p'); + $this->element('label', array('for' => 'openid_url'), _('OpenID URL')); - common_element('input', array('name' => 'openid_url', + $this->element('input', array('name' => 'openid_url', 'type' => 'text', 'id' => 'openid_url')); - common_element('input', array('type' => 'submit', + $this->element('input', array('type' => 'submit', 'id' => 'add', 'name' => 'add', 'class' => 'submit', 'value' => _('Add'))); - common_element_end('p'); - common_element_end('form'); + $this->elementEnd('p'); + $this->elementEnd('form'); $oid = new User_openid(); $oid->user_id = $user->id; @@ -69,48 +69,48 @@ class OpenidsettingsAction extends SettingsAction if ($cnt > 0) { - common_element('h2', null, _('Remove OpenID')); + $this->element('h2', null, _('Remove OpenID')); if ($cnt == 1 && !$user->password) { - common_element('p', null, + $this->element('p', null, _('Removing your only OpenID would make it impossible to log in! ' . 'If you need to remove it, add another OpenID first.')); if ($oid->fetch()) { - common_element_start('p'); - common_element('a', array('href' => $oid->canonical), + $this->elementStart('p'); + $this->element('a', array('href' => $oid->canonical), $oid->display); - common_element_end('p'); + $this->elementEnd('p'); } } else { - common_element('p', null, + $this->element('p', null, _('You can remove an OpenID from your account '. 'by clicking the button marked "Remove".')); $idx = 0; while ($oid->fetch()) { - common_element_start('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'POST', 'id' => 'openiddelete' . $idx, 'action' => common_local_url('openidsettings'))); - common_element_start('p'); - common_hidden('token', common_session_token()); - common_element('a', array('href' => $oid->canonical), + $this->elementStart('p'); + $this->hidden('token', common_session_token()); + $this->element('a', array('href' => $oid->canonical), $oid->display); - common_element('input', array('type' => 'hidden', + $this->element('input', array('type' => 'hidden', 'id' => 'openid_url'.$idx, 'name' => 'openid_url', 'value' => $oid->canonical)); - common_element('input', array('type' => 'submit', + $this->element('input', array('type' => 'submit', 'id' => 'remove'.$idx, 'name' => 'remove', 'class' => 'submit', 'value' => _('Remove'))); - common_element_end('p'); - common_element_end('form'); + $this->elementEnd('p'); + $this->elementEnd('form'); $idx++; } } diff --git a/actions/opensearch.php b/actions/opensearch.php index 96691fa6f..6e6e794e9 100644 --- a/actions/opensearch.php +++ b/actions/opensearch.php @@ -41,21 +41,21 @@ class OpensearchAction extends Action header('Content-Type: text/html'); common_start_xml(); - common_element_start('OpenSearchDescription', array('xmlns' => 'http://a9.com/-/spec/opensearch/1.1/')); + $this->elementStart('OpenSearchDescription', array('xmlns' => 'http://a9.com/-/spec/opensearch/1.1/')); $short_name = common_config('site', 'name').' '.$short_name; - common_element('ShortName', null, $short_name); - common_element('Contact', null, common_config('site', 'email')); - common_element('Url', array('type' => 'text/html', 'method' => 'get', + $this->element('ShortName', null, $short_name); + $this->element('Contact', null, common_config('site', 'email')); + $this->element('Url', array('type' => 'text/html', 'method' => 'get', 'template' => str_replace('---', '{searchTerms}', common_local_url($type, array('q' => '---'))))); - common_element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico')); - common_element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), theme_path('logo.png')); - common_element('AdultContent', null, 'false'); - common_element('Language', null, common_language()); - common_element('OutputEncoding', null, 'UTF-8'); - common_element('InputEncoding', null, 'UTF-8'); - - common_element_end('OpenSearchDescription'); + $this->element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico')); + $this->element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), theme_path('logo.png')); + $this->element('AdultContent', null, 'false'); + $this->element('Language', null, common_language()); + $this->element('OutputEncoding', null, 'UTF-8'); + $this->element('InputEncoding', null, 'UTF-8'); + + $this->elementEnd('OpenSearchDescription'); common_end_xml(); } } diff --git a/actions/othersettings.php b/actions/othersettings.php index c2f08934c..97cbd0094 100644 --- a/actions/othersettings.php +++ b/actions/othersettings.php @@ -35,12 +35,12 @@ class OthersettingsAction extends SettingsAction $this->form_header(_('Other Settings'), $msg, $success); - common_element('h2', null, _('URL Auto-shortening')); - common_element_start('form', array('method' => 'post', + $this->element('h2', null, _('URL Auto-shortening')); + $this->elementStart('form', array('method' => 'post', 'id' => 'othersettings', 'action' => common_local_url('othersettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); $services = array( '' => 'None', @@ -54,13 +54,13 @@ class OthersettingsAction extends SettingsAction 'metamark.net' => 'metamark.net' ); - common_dropdown('urlshorteningservice', _('Service'), $services, _('Automatic shortening service to use.'), false, $user->urlshorteningservice); + $this->dropdown('urlshorteningservice', _('Service'), $services, _('Automatic shortening service to use.'), false, $user->urlshorteningservice); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); -// common_element('h2', null, _('Delete my account')); +// $this->element('h2', null, _('Delete my account')); // $this->show_delete_form(); common_show_footer(); @@ -68,15 +68,15 @@ class OthersettingsAction extends SettingsAction function show_feeds_list($feeds) { - common_element_start('div', array('class' => 'feedsdel')); - common_element('p', null, 'Feeds:'); - common_element_start('ul', array('class' => 'xoxo')); + $this->elementStart('div', array('class' => 'feedsdel')); + $this->element('p', null, 'Feeds:'); + $this->elementStart('ul', array('class' => 'xoxo')); foreach ($feeds as $key => $value) { $this->common_feed_item($feeds[$key]); } - common_element_end('ul'); - common_element_end('div'); + $this->elementEnd('ul'); + $this->elementEnd('div'); } //TODO move to common.php (and retrace its origin) @@ -100,13 +100,13 @@ class OthersettingsAction extends SettingsAction $feed['textContent'] = "FOAF"; break; } - common_element_start('li'); - common_element('a', array('href' => $feed['href'], + $this->elementStart('li'); + $this->element('a', array('href' => $feed['href'], 'class' => $feed_classname, 'type' => $feed_mimetype, 'title' => $feed_title), $feed['textContent']); - common_element_end('li'); + $this->elementEnd('li'); } // function show_delete_form() { @@ -115,13 +115,13 @@ class OthersettingsAction extends SettingsAction // $notices->profile_id = $user->id; // $notice_count = (int) $notices->count(); // -// common_element_start('form', array('method' => 'POST', +// $this->elementStart('form', array('method' => 'POST', // 'id' => 'delete', // 'action' => // common_local_url('deleteprofile'))); // -// common_hidden('token', common_session_token()); -// common_element('p', null, "You can copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); +// $this->hidden('token', common_session_token()); +// $this->element('p', null, "You can copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); // // $this->show_feeds_list(array(0=>array('href'=>common_local_url('userrss', array('limit' => $notice_count, 'nickname' => $user->nickname)), // 'type' => 'rss', @@ -132,8 +132,8 @@ class OthersettingsAction extends SettingsAction // 'version' => 'FOAF', // 'item' => 'foaf'))); // -// common_submit('deleteaccount', _('Delete my account')); -// common_element_end('form'); +// $this->submit('deleteaccount', _('Delete my account')); +// $this->elementEnd('form'); // } function handle_post() diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index 0d0fae4e5..2b13b0812 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -60,7 +60,7 @@ class PeoplesearchAction extends SearchAction $results = new PeopleSearchResults($profile, $terms); $results->show_list(); } else { - common_element('p', 'error', _('No results')); + $this->element('p', 'error', _('No results')); } $profile->free(); diff --git a/actions/peopletag.php b/actions/peopletag.php index 13a0b7a41..2680638d7 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -90,11 +90,11 @@ class PeopletagAction extends Action { $instr = sprintf(_('These are users who have tagged themselves "%s" ' . 'to show a common interest, characteristic, hobby or job.'), $tag); - common_element_start('div', 'instructions'); - common_element_start('p'); - common_text($instr); - common_element_end('p'); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->elementStart('p'); + $this->text($instr); + $this->elementEnd('p'); + $this->elementEnd('div'); } function get_title() diff --git a/actions/profilesettings.php b/actions/profilesettings.php index d861919b9..ef45fc1d9 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -34,11 +34,11 @@ class ProfilesettingsAction extends SettingsAction { $this->form_header(_('Profile settings'), $msg, $success); $this->show_settings_form(); - common_element('h2', null, _('Avatar')); + $this->element('h2', null, _('Avatar')); $this->show_avatar_form(); - common_element('h2', null, _('Change password')); + $this->element('h2', null, _('Change password')); $this->show_password_form(); -// common_element('h2', null, _('Delete my account')); +// $this->element('h2', null, _('Delete my account')); // $this->show_delete_form(); common_show_footer(); } @@ -74,46 +74,46 @@ class ProfilesettingsAction extends SettingsAction $user = common_current_user(); $profile = $user->getProfile(); - common_element_start('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'POST', 'id' => 'profilesettings', 'action' => common_local_url('profilesettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); # too much common patterns here... abstractable? - common_input('nickname', _('Nickname'), + $this->input('nickname', _('Nickname'), ($this->arg('nickname')) ? $this->arg('nickname') : $profile->nickname, _('1-64 lowercase letters or numbers, no punctuation or spaces')); - common_input('fullname', _('Full name'), + $this->input('fullname', _('Full name'), ($this->arg('fullname')) ? $this->arg('fullname') : $profile->fullname); - common_input('homepage', _('Homepage'), + $this->input('homepage', _('Homepage'), ($this->arg('homepage')) ? $this->arg('homepage') : $profile->homepage, _('URL of your homepage, blog, or profile on another site')); - common_textarea('bio', _('Bio'), + $this->textarea('bio', _('Bio'), ($this->arg('bio')) ? $this->arg('bio') : $profile->bio, _('Describe yourself and your interests in 140 chars')); - common_input('location', _('Location'), + $this->input('location', _('Location'), ($this->arg('location')) ? $this->arg('location') : $profile->location, _('Where you are, like "City, State (or Region), Country"')); - common_input('tags', _('Tags'), + $this->input('tags', _('Tags'), ($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()), _('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated')); $language = common_language(); - common_dropdown('language', _('Language'), get_nice_language_list(), _('Preferred language'), true, $language); + $this->dropdown('language', _('Language'), get_nice_language_list(), _('Preferred language'), true, $language); $timezone = common_timezone(); $timezones = array(); foreach(DateTimeZone::listIdentifiers() as $k => $v) { $timezones[$v] = $v; } - common_dropdown('timezone', _('Timezone'), $timezones, _('What timezone are you normally in?'), true, $timezone); + $this->dropdown('timezone', _('Timezone'), $timezones, _('What timezone are you normally in?'), true, $timezone); - common_checkbox('autosubscribe', _('Automatically subscribe to whoever subscribes to me (best for non-humans)'), + $this->checkbox('autosubscribe', _('Automatically subscribe to whoever subscribes to me (best for non-humans)'), ($this->arg('autosubscribe')) ? $this->boolean('autosubscribe') : $user->autosubscribe); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); } @@ -132,62 +132,62 @@ class ProfilesettingsAction extends SettingsAction $original = $profile->getOriginalAvatar(); - common_element_start('form', array('enctype' => 'multipart/form-data', + $this->elementStart('form', array('enctype' => 'multipart/form-data', 'method' => 'POST', 'id' => 'avatar', 'action' => common_local_url('profilesettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); if ($original) { - common_element_start('div', array('id'=>'avatar_original', 'class'=>'avatar_view')); - common_element('h3', null, _("Original:")); - common_element_start('div', array('id'=>'avatar_original_view')); - common_element('img', array('src' => $original->url, + $this->elementStart('div', array('id'=>'avatar_original', 'class'=>'avatar_view')); + $this->element('h3', null, _("Original:")); + $this->elementStart('div', array('id'=>'avatar_original_view')); + $this->element('img', array('src' => $original->url, 'class' => 'avatar original', 'width' => $original->width, 'height' => $original->height, 'alt' => $user->nickname)); - common_element_end('div'); - common_element_end('div'); + $this->elementEnd('div'); + $this->elementEnd('div'); } $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); if ($avatar) { - common_element_start('div', array('id'=>'avatar_preview', 'class'=>'avatar_view')); - common_element('h3', null, _("Preview:")); - common_element_start('div', array('id'=>'avatar_preview_view')); - common_element('img', array('src' => $original->url,//$avatar->url, + $this->elementStart('div', array('id'=>'avatar_preview', 'class'=>'avatar_view')); + $this->element('h3', null, _("Preview:")); + $this->elementStart('div', array('id'=>'avatar_preview_view')); + $this->element('img', array('src' => $original->url,//$avatar->url, 'class' => 'avatar profile', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $user->nickname)); - common_element_end('div'); - common_element_end('div'); + $this->elementEnd('div'); + $this->elementEnd('div'); foreach(array('avatar_crop_x', 'avatar_crop_y', 'avatar_crop_w', 'avatar_crop_h') as $crop_info) { - common_element('input', array('name' => $crop_info, + $this->element('input', array('name' => $crop_info, 'type' => 'hidden', 'id' => $crop_info)); } - common_submit('crop', _('Crop')); + $this->submit('crop', _('Crop')); } - common_element('input', array('name' => 'MAX_FILE_SIZE', + $this->element('input', array('name' => 'MAX_FILE_SIZE', 'type' => 'hidden', 'id' => 'MAX_FILE_SIZE', 'value' => MAX_AVATAR_SIZE)); - common_element_start('p'); + $this->elementStart('p'); - common_element('input', array('name' => 'avatarfile', + $this->element('input', array('name' => 'avatarfile', 'type' => 'file', 'id' => 'avatarfile')); - common_element_end('p'); + $this->elementEnd('p'); - common_submit('upload', _('Upload')); - common_element_end('form'); + $this->submit('upload', _('Upload')); + $this->elementEnd('form'); } @@ -195,23 +195,23 @@ class ProfilesettingsAction extends SettingsAction { $user = common_current_user(); - common_element_start('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'POST', 'id' => 'password', 'action' => common_local_url('profilesettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); # Users who logged in with OpenID won't have a pwd if ($user->password) { - common_password('oldpassword', _('Old password')); + $this->password('oldpassword', _('Old password')); } - common_password('newpassword', _('New password'), + $this->password('newpassword', _('New password'), _('6 or more characters')); - common_password('confirm', _('Confirm'), + $this->password('confirm', _('Confirm'), _('same as password above')); - common_submit('changepass', _('Change')); - common_element_end('form'); + $this->submit('changepass', _('Change')); + $this->elementEnd('form'); } function save_profile() diff --git a/actions/publicxrds.php b/actions/publicxrds.php index 3d731d79f..f66e34533 100644 --- a/actions/publicxrds.php +++ b/actions/publicxrds.php @@ -39,45 +39,45 @@ class PublicxrdsAction extends Action header('Content-Type: application/xrds+xml'); common_start_xml(); - common_element_start('XRDS', array('xmlns' => 'xri://$xrds')); + $this->elementStart('XRDS', array('xmlns' => 'xri://$xrds')); - common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', + $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); - common_element('Type', null, 'xri://$xrds*simple'); + $this->element('Type', null, 'xri://$xrds*simple'); foreach (array('finishopenidlogin', 'finishaddopenid', 'finishimmediate') as $finish) { $this->show_service(Auth_OpenID_RP_RETURN_TO_URL_TYPE, common_local_url($finish)); } - common_element_end('XRD'); + $this->elementEnd('XRD'); - common_element_end('XRDS'); + $this->elementEnd('XRDS'); common_end_xml(); } function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { - common_element_start('Service'); + $this->elementStart('Service'); if ($uri) { - common_element('URI', null, $uri); + $this->element('URI', null, $uri); } - common_element('Type', null, $type); + $this->element('Type', null, $type); if ($params) { foreach ($params as $param) { - common_element('Type', null, $param); + $this->element('Type', null, $param); } } if ($sigs) { foreach ($sigs as $sig) { - common_element('Type', null, $sig); + $this->element('Type', null, $sig); } } if ($localId) { - common_element('LocalID', null, $localId); + $this->element('LocalID', null, $localId); } - common_element_end('Service'); + $this->elementEnd('Service'); } } \ No newline at end of file diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php index bb6ef81d6..3e6ecfb1f 100644 --- a/actions/recoverpassword.php +++ b/actions/recoverpassword.php @@ -141,24 +141,24 @@ class RecoverpasswordAction extends Action function show_top($msg=null) { if ($msg) { - common_element('div', 'error', $msg); + $this->element('div', 'error', $msg); } else { - common_element_start('div', 'instructions'); - common_element('p', null, + $this->elementStart('div', 'instructions'); + $this->element('p', null, _('If you\'ve forgotten or lost your' . ' password, you can get a new one sent to' . ' the email address you have stored ' . ' in your account.')); - common_element_end('div'); + $this->elementEnd('div'); } } function show_password_top($msg=null) { if ($msg) { - common_element('div', 'error', $msg); + $this->element('div', 'error', $msg); } else { - common_element('div', 'instructions', + $this->element('div', 'instructions', _('You\'ve been identified. Enter a ' . ' new password below. ')); } @@ -170,15 +170,15 @@ class RecoverpasswordAction extends Action common_show_header(_('Recover password'), null, $msg, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'recoverpassword', 'action' => common_local_url('recoverpassword'))); - common_input('nicknameoremail', _('Nickname or email'), + $this->input('nicknameoremail', _('Nickname or email'), $this->trimmed('nicknameoremail'), _('Your nickname on this server, ' . 'or your registered email address.')); - common_submit('recover', _('Recover')); - common_element_end('form'); + $this->submit('recover', _('Recover')); + $this->elementEnd('form'); common_show_footer(); } @@ -188,16 +188,16 @@ class RecoverpasswordAction extends Action common_show_header(_('Reset password'), null, $msg, array($this, 'show_password_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'recoverpassword', 'action' => common_local_url('recoverpassword'))); - common_hidden('token', common_session_token()); - common_password('newpassword', _('New password'), + $this->hidden('token', common_session_token()); + $this->password('newpassword', _('New password'), _('6 or more characters, and don\'t forget it!')); - common_password('confirm', _('Confirm'), + $this->password('confirm', _('Confirm'), _('Same as password above')); - common_submit('reset', _('Reset')); - common_element_end('form'); + $this->submit('reset', _('Reset')); + $this->elementEnd('form'); common_show_footer(); } @@ -278,7 +278,7 @@ class RecoverpasswordAction extends Action mail_to_user($user, _('Password recovery requested'), $body, $confirm->address); common_show_header(_('Password recovery requested')); - common_element('p', null, + $this->element('p', null, _('Instructions for recovering your password ' . 'have been sent to the email address registered to your ' . 'account.')); @@ -336,7 +336,7 @@ class RecoverpasswordAction extends Action common_real_login(true); common_show_header(_('Password saved.')); - common_element('p', null, _('New password successfully saved. ' . + $this->element('p', null, _('New password successfully saved. ' . 'You are now logged in.')); common_show_footer(); } diff --git a/actions/register.php b/actions/register.php index c479816ef..bac179687 100644 --- a/actions/register.php +++ b/actions/register.php @@ -155,16 +155,16 @@ class RegisterAction extends Action function show_top($error=null) { if ($error) { - common_element('p', 'error', $error); + $this->element('p', 'error', $error); } else { $instr = common_markup_to_html(_('With this form you can create a new account. ' . 'You can then post notices and link up to friends and colleagues. '. '(Have an [OpenID](http://openid.net/)? ' . 'Try our [OpenID registration](%%action.openidlogin%%)!)')); - common_element_start('div', 'instructions'); - common_raw($instr); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($instr); + $this->elementEnd('div'); } } @@ -184,45 +184,45 @@ class RegisterAction extends Action } common_show_header(_('Register'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'login', 'action' => common_local_url('register'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); if ($code) { - common_hidden('code', $code); + $this->hidden('code', $code); } - common_input('nickname', _('Nickname'), $this->trimmed('nickname'), + $this->input('nickname', _('Nickname'), $this->trimmed('nickname'), _('1-64 lowercase letters or numbers, no punctuation or spaces. Required.')); - common_password('password', _('Password'), + $this->password('password', _('Password'), _('6 or more characters. Required.')); - common_password('confirm', _('Confirm'), + $this->password('confirm', _('Confirm'), _('Same as password above. Required.')); if ($invite && $invite->address_type == 'email') { - common_input('email', _('Email'), $invite->address, + $this->input('email', _('Email'), $invite->address, _('Used only for updates, announcements, and password recovery')); } else { - common_input('email', _('Email'), $this->trimmed('email'), + $this->input('email', _('Email'), $this->trimmed('email'), _('Used only for updates, announcements, and password recovery')); } - common_input('fullname', _('Full name'), + $this->input('fullname', _('Full name'), $this->trimmed('fullname'), _('Longer name, preferably your "real" name')); - common_input('homepage', _('Homepage'), + $this->input('homepage', _('Homepage'), $this->trimmed('homepage'), _('URL of your homepage, blog, or profile on another site')); - common_textarea('bio', _('Bio'), + $this->textarea('bio', _('Bio'), $this->trimmed('bio'), _('Describe yourself and your interests in 140 chars')); - common_input('location', _('Location'), + $this->input('location', _('Location'), $this->trimmed('location'), _('Where you are, like "City, State (or Region), Country"')); - common_checkbox('rememberme', _('Remember me'), + $this->checkbox('rememberme', _('Remember me'), $this->boolean('rememberme'), _('Automatically login in the future; not for shared computers!')); - common_element_start('p'); + $this->elementStart('p'); $attrs = array('type' => 'checkbox', 'id' => 'license', 'name' => 'license', @@ -230,14 +230,14 @@ class RegisterAction extends Action if ($this->boolean('license')) { $attrs['checked'] = 'checked'; } - common_element('input', $attrs); - common_text(_('My text and files are available under ')); - common_element('a', array('href' => $config['license']['url']), + $this->element('input', $attrs); + $this->text(_('My text and files are available under ')); + $this->element('a', array('href' => $config['license']['url']), $config['license']['title']); - common_text(_(' except this private data: password, email address, IM address, phone number.')); - common_element_end('p'); - common_submit('submit', _('Register')); - common_element_end('form'); + $this->text(_(' except this private data: password, email address, IM address, phone number.')); + $this->elementEnd('p'); + $this->submit('submit', _('Register')); + $this->elementEnd('form'); common_show_footer(); } @@ -245,7 +245,7 @@ class RegisterAction extends Action { $nickname = $this->arg('nickname'); common_show_header(_('Registration successful')); - common_element_start('div', 'success'); + $this->elementStart('div', 'success'); $instr = sprintf(_('Congratulations, %s! And welcome to %%%%site.name%%%%. From here, you may want to...'. "\n\n" . '* Go to [your profile](%s) and post your first message.' . "\n" . '* Add a [Jabber/GTalk address](%%%%action.imsettings%%%%) so you can send notices through instant messages.' . "\n" . @@ -254,14 +254,14 @@ class RegisterAction extends Action '* Read over the [online docs](%%%%doc.help%%%%) for features you may have missed. ' . "\n\n" . 'Thanks for signing up and we hope you enjoy using this service.'), $nickname, common_local_url('showstream', array('nickname' => $nickname))); - common_raw(common_markup_to_html($instr)); + $this->raw(common_markup_to_html($instr)); $have_email = $this->trimmed('email'); if ($have_email) { $emailinstr = _('(You should receive a message by email momentarily, with ' . 'instructions on how to confirm your email address.)'); - common_raw(common_markup_to_html($emailinstr)); + $this->raw(common_markup_to_html($emailinstr)); } - common_element_end('div'); + $this->elementEnd('div'); common_show_footer(); } diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php index a9494772e..b9e29d645 100644 --- a/actions/remotesubscribe.php +++ b/actions/remotesubscribe.php @@ -61,13 +61,13 @@ class RemotesubscribeAction extends Action function show_top($err=null) { if ($err) { - common_element('div', 'error', $err); + $this->element('div', 'error', $err); } else { $instructions = $this->get_instructions(); $output = common_markup_to_html($instructions); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('p'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('p'); } } @@ -79,15 +79,15 @@ class RemotesubscribeAction extends Action array($this, 'show_top')); # id = remotesubscribe conflicts with the # button on profile page - common_element_start('form', array('id' => 'remsub', 'method' => 'post', + $this->elementStart('form', array('id' => 'remsub', 'method' => 'post', 'action' => common_local_url('remotesubscribe'))); - common_hidden('token', common_session_token()); - common_input('nickname', _('User nickname'), $nickname, + $this->hidden('token', common_session_token()); + $this->input('nickname', _('User nickname'), $nickname, _('Nickname of the user you want to follow')); - common_input('profile_url', _('Profile URL'), $profile, + $this->input('profile_url', _('Profile URL'), $profile, _('URL of your profile on another compatible microblogging service')); - common_submit('submit', _('Subscribe')); - common_element_end('form'); + $this->submit('submit', _('Subscribe')); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/replies.php b/actions/replies.php index eceeb4d65..878550888 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -62,7 +62,7 @@ class RepliesAction extends StreamAction function show_header($user) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('repliesrss', array('nickname' => $user->nickname)), 'type' => 'application/rss+xml', diff --git a/actions/showfavorites.php b/actions/showfavorites.php index f4344833d..1dec3ba5b 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -57,7 +57,7 @@ class ShowfavoritesAction extends StreamAction function show_header($user) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('favoritesrss', array('nickname' => $user->nickname)), 'type' => 'application/rss+xml', diff --git a/actions/shownotice.php b/actions/shownotice.php index 2df09cb3f..c519af0ba 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -81,10 +81,10 @@ class ShownoticeAction extends StreamAction array($this, 'show_header'), null, array($this, 'show_top')); - common_element_start('ul', array('id' => 'notices')); + $this->elementStart('ul', array('id' => 'notices')); $nli = new NoticeListItem($this->notice); $nli->show(); - common_element_end('ul'); + $this->elementEnd('ul'); common_show_footer(); } @@ -99,12 +99,12 @@ class ShownoticeAction extends StreamAction } if ($user->emailmicroid && $user->email && $this->notice->uri) { - common_element('meta', array('name' => 'microid', + $this->element('meta', array('name' => 'microid', 'content' => "mailto+http:sha1:" . sha1(sha1('mailto:' . $user->email) . sha1($this->notice->uri)))); } if ($user->jabbermicroid && $user->jabber && $this->notice->uri) { - common_element('meta', array('name' => 'microid', + $this->element('meta', array('name' => 'microid', 'content' => "xmpp+http:sha1:" . sha1(sha1('xmpp:' . $user->jabber) . sha1($this->notice->uri)))); } } diff --git a/actions/showstream.php b/actions/showstream.php index e4e5d96d1..9a59f7ae4 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -106,53 +106,53 @@ class ShowstreamAction extends StreamAction function show_header($user) { # Feeds - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('api', array('apiaction' => 'statuses', 'method' => 'user_timeline.rss', 'argument' => $user->nickname)), 'type' => 'application/rss+xml', 'title' => sprintf(_('Notice feed for %s'), $user->nickname))); - common_element('link', array('rel' => 'alternate feed', + $this->element('link', array('rel' => 'alternate feed', 'href' => common_local_url('api', array('apiaction' => 'statuses', 'method' => 'user_timeline.atom', 'argument' => $user->nickname)), 'type' => 'application/atom+xml', 'title' => sprintf(_('Notice feed for %s'), $user->nickname))); - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('userrss', array('nickname' => $user->nickname)), 'type' => 'application/rdf+xml', 'title' => sprintf(_('Notice feed for %s'), $user->nickname))); # FOAF - common_element('link', array('rel' => 'meta', + $this->element('link', array('rel' => 'meta', 'href' => common_local_url('foaf', array('nickname' => $user->nickname)), 'type' => 'application/rdf+xml', 'title' => 'FOAF')); # for remote subscriptions etc. - common_element('meta', array('http-equiv' => 'X-XRDS-Location', + $this->element('meta', array('http-equiv' => 'X-XRDS-Location', 'content' => common_local_url('xrds', array('nickname' => $user->nickname)))); $profile = $user->getProfile(); if ($profile->bio) { - common_element('meta', array('name' => 'description', + $this->element('meta', array('name' => 'description', 'content' => $profile->bio)); } if ($user->emailmicroid && $user->email && $profile->profileurl) { - common_element('meta', array('name' => 'microid', + $this->element('meta', array('name' => 'microid', 'content' => "mailto+http:sha1:" . sha1(sha1('mailto:' . $user->email) . sha1($profile->profileurl)))); } if ($user->jabbermicroid && $user->jabber && $profile->profileurl) { - common_element('meta', array('name' => 'microid', + $this->element('meta', array('name' => 'microid', 'content' => "xmpp+http:sha1:" . sha1(sha1('xmpp:' . $user->jabber) . sha1($profile->profileurl)))); } # See https://wiki.mozilla.org/Microsummaries - common_element('link', array('rel' => 'microsummary', + $this->element('link', array('rel' => 'microsummary', 'href' => common_local_url('microsummary', array('nickname' => $profile->nickname)))); } @@ -165,7 +165,7 @@ class ShowstreamAction extends StreamAction function show_profile($profile) { - common_element_start('div', array('id' => 'profile', 'class' => 'vcard')); + $this->elementStart('div', array('id' => 'profile', 'class' => 'vcard')); $this->show_personal($profile); @@ -175,23 +175,23 @@ class ShowstreamAction extends StreamAction $this->show_subscriptions($profile); - common_element_end('div'); + $this->elementEnd('div'); } function show_personal($profile) { $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); - common_element_start('div', array('id' => 'profile_avatar')); - common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), + $this->elementStart('div', array('id' => 'profile_avatar')); + $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), 'class' => 'avatar profile photo', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $profile->nickname)); - common_element_start('ul', array('id' => 'profile_actions')); + $this->elementStart('ul', array('id' => 'profile_actions')); - common_element_start('li', array('id' => 'profile_subscribe')); + $this->elementStart('li', array('id' => 'profile_subscribe')); $cur = common_current_user(); if ($cur) { if ($cur->id != $profile->id) { @@ -204,14 +204,14 @@ class ShowstreamAction extends StreamAction } else { $this->show_remote_subscribe_link($profile); } - common_element_end('li'); + $this->elementEnd('li'); $user = User::staticGet('id', $profile->id); common_profile_new_message_nudge($cur, $user, $profile); if ($cur && $cur->id != $profile->id) { $blocked = $cur->hasBlocked($profile); - common_element_start('li', array('id' => 'profile_block')); + $this->elementStart('li', array('id' => 'profile_block')); if ($blocked) { common_unblock_form($profile, array('action' => 'showstream', 'nickname' => $profile->nickname)); @@ -219,62 +219,62 @@ class ShowstreamAction extends StreamAction common_block_form($profile, array('action' => 'showstream', 'nickname' => $profile->nickname)); } - common_element_end('li'); + $this->elementEnd('li'); } - common_element_end('ul'); + $this->elementEnd('ul'); - common_element_end('div'); + $this->elementEnd('div'); - common_element_start('div', array('id' => 'profile_information')); + $this->elementStart('div', array('id' => 'profile_information')); if ($profile->fullname) { - common_element('h1', array('class' => 'fn'), $profile->fullname . ' (' . $profile->nickname . ')'); + $this->element('h1', array('class' => 'fn'), $profile->fullname . ' (' . $profile->nickname . ')'); } else { - common_element('h1', array('class' => 'fn nickname'), $profile->nickname); + $this->element('h1', array('class' => 'fn nickname'), $profile->nickname); } if ($profile->location) { - common_element('p', 'location', $profile->location); + $this->element('p', 'location', $profile->location); } if ($profile->bio) { - common_element('p', 'description note', $profile->bio); + $this->element('p', 'description note', $profile->bio); } if ($profile->homepage) { - common_element_start('p', 'website'); - common_element('a', array('href' => $profile->homepage, + $this->elementStart('p', 'website'); + $this->element('a', array('href' => $profile->homepage, 'rel' => 'me', 'class' => 'url'), $profile->homepage); - common_element_end('p'); + $this->elementEnd('p'); } $this->show_statistics($profile); - common_element_end('div'); + $this->elementEnd('div'); } function show_remote_subscribe_link($profile) { $url = common_local_url('remotesubscribe', array('nickname' => $profile->nickname)); - common_element('a', array('href' => $url, + $this->element('a', array('href' => $url, 'id' => 'remotesubscribe'), _('Subscribe')); } function show_unsubscribe_form($profile) { - common_element_start('form', array('id' => 'unsubscribe', 'method' => 'post', + $this->elementStart('form', array('id' => 'unsubscribe', 'method' => 'post', 'action' => common_local_url('unsubscribe'))); - common_hidden('token', common_session_token()); - common_element('input', array('id' => 'unsubscribeto', + $this->hidden('token', common_session_token()); + $this->element('input', array('id' => 'unsubscribeto', 'name' => 'unsubscribeto', 'type' => 'hidden', 'value' => $profile->nickname)); - common_element('input', array('type' => 'submit', + $this->element('input', array('type' => 'submit', 'class' => 'submit', 'value' => _('Unsubscribe'))); - common_element_end('form'); + $this->elementEnd('form'); } function show_subscriptions($profile) @@ -293,13 +293,13 @@ class ShowstreamAction extends StreamAction $subs_count = $subs->find(); - common_element_start('div', array('id' => 'subscriptions')); + $this->elementStart('div', array('id' => 'subscriptions')); - common_element('h2', null, _('Subscriptions')); + $this->element('h2', null, _('Subscriptions')); if ($subs_count > 0) { - common_element_start('ul', array('id' => 'subscriptions_avatars')); + $this->elementStart('ul', array('id' => 'subscriptions_avatars')); for ($i = 0; $i < min($subs_count, SUBSCRIPTIONS); $i++) { @@ -315,39 +315,39 @@ class ShowstreamAction extends StreamAction continue; } - common_element_start('li', 'vcard'); - common_element_start('a', array('title' => ($other->fullname) ? + $this->elementStart('li', 'vcard'); + $this->elementStart('a', array('title' => ($other->fullname) ? $other->fullname : $other->nickname, 'href' => $other->profileurl, 'rel' => 'contact', 'class' => 'subscription fn url')); $avatar = $other->getAvatar(AVATAR_MINI_SIZE); - common_element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), + $this->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar mini photo', 'alt' => ($other->fullname) ? $other->fullname : $other->nickname)); - common_element_end('a'); - common_element_end('li'); + $this->elementEnd('a'); + $this->elementEnd('li'); } - common_element_end('ul'); + $this->elementEnd('ul'); } if ($subs_count > SUBSCRIPTIONS) { - common_element_start('p', array('id' => 'subscriptions_viewall')); + $this->elementStart('p', array('id' => 'subscriptions_viewall')); - common_element('a', array('href' => common_local_url('subscriptions', + $this->element('a', array('href' => common_local_url('subscriptions', array('nickname' => $profile->nickname)), 'class' => 'moresubscriptions'), _('All subscriptions')); - common_element_end('p'); + $this->elementEnd('p'); } - common_element_end('div'); + $this->elementEnd('div'); } function show_statistics($profile) @@ -366,49 +366,49 @@ class ShowstreamAction extends StreamAction $notices->profile_id = $profile->id; $notice_count = (int) $notices->count(); - common_element_start('div', 'statistics'); - common_element('h2', 'statistics', _('Statistics')); + $this->elementStart('div', 'statistics'); + $this->element('h2', 'statistics', _('Statistics')); # Other stats...? - common_element_start('dl', 'statistics'); - common_element('dt', 'membersince', _('Member since')); - common_element('dd', 'membersince', date('j M Y', + $this->elementStart('dl', 'statistics'); + $this->element('dt', 'membersince', _('Member since')); + $this->element('dd', 'membersince', date('j M Y', strtotime($profile->created))); - common_element_start('dt', 'subscriptions'); - common_element('a', array('href' => common_local_url('subscriptions', + $this->elementStart('dt', 'subscriptions'); + $this->element('a', array('href' => common_local_url('subscriptions', array('nickname' => $profile->nickname))), _('Subscriptions')); - common_element_end('dt'); - common_element('dd', 'subscriptions', (is_int($subs_count)) ? $subs_count : '0'); - common_element_start('dt', 'subscribers'); - common_element('a', array('href' => common_local_url('subscribers', + $this->elementEnd('dt'); + $this->element('dd', 'subscriptions', (is_int($subs_count)) ? $subs_count : '0'); + $this->elementStart('dt', 'subscribers'); + $this->element('a', array('href' => common_local_url('subscribers', array('nickname' => $profile->nickname))), _('Subscribers')); - common_element_end('dt'); - common_element('dd', 'subscribers', (is_int($subbed_count)) ? $subbed_count : '0'); - common_element('dt', 'notices', _('Notices')); - common_element('dd', 'notices', (is_int($notice_count)) ? $notice_count : '0'); + $this->elementEnd('dt'); + $this->element('dd', 'subscribers', (is_int($subbed_count)) ? $subbed_count : '0'); + $this->element('dt', 'notices', _('Notices')); + $this->element('dd', 'notices', (is_int($notice_count)) ? $notice_count : '0'); # XXX: link these to something - common_element('dt', 'tags', _('Tags')); - common_element_start('dd', 'tags'); + $this->element('dt', 'tags', _('Tags')); + $this->elementStart('dd', 'tags'); $tags = Profile_tag::getTags($profile->id, $profile->id); - common_element_start('ul', 'tags xoxo'); + $this->elementStart('ul', 'tags xoxo'); foreach ($tags as $tag) { - common_element_start('li'); - common_element('a', array('rel' => 'bookmark tag', + $this->elementStart('li'); + $this->element('a', array('rel' => 'bookmark tag', 'href' => common_local_url('peopletag', array('tag' => $tag))), $tag); - common_element_end('li'); + $this->elementEnd('li'); } - common_element_end('ul'); - common_element_end('dd'); + $this->elementEnd('ul'); + $this->elementEnd('dd'); - common_element_end('dl'); + $this->elementEnd('dl'); - common_element_end('div'); + $this->elementEnd('div'); } function show_notices($user) @@ -428,22 +428,22 @@ class ShowstreamAction extends StreamAction function show_last_notice($profile) { - common_element('h2', null, _('Currently')); + $this->element('h2', null, _('Currently')); $notice = $profile->getCurrentNotice(); if ($notice) { # FIXME: URL, image, video, audio - common_element_start('p', array('class' => 'notice_current')); + $this->elementStart('p', array('class' => 'notice_current')); if ($notice->rendered) { - common_raw($notice->rendered); + $this->raw($notice->rendered); } else { # XXX: may be some uncooked notices in the DB, # we cook them right now. This can probably disappear in future # versions (>> 0.4.x) - common_raw(common_render_content($notice->content, $notice)); + $this->raw(common_render_content($notice->content, $notice)); } - common_element_end('p'); + $this->elementEnd('p'); } } } diff --git a/actions/smssettings.php b/actions/smssettings.php index fad71135c..1be45d1ce 100644 --- a/actions/smssettings.php +++ b/actions/smssettings.php @@ -34,75 +34,75 @@ class SmssettingsAction extends EmailsettingsAction { $user = common_current_user(); $this->form_header(_('SMS Settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'smssettings', 'action' => common_local_url('smssettings'))); - common_hidden('token', common_session_token()); - common_element('h2', null, _('Address')); + $this->hidden('token', common_session_token()); + $this->element('h2', null, _('Address')); if ($user->sms) { - common_element_start('p'); + $this->elementStart('p'); $carrier = $user->getCarrier(); - common_element('span', 'address confirmed', $user->sms . ' (' . $carrier->name . ')'); - common_element('span', 'input_instructions', + $this->element('span', 'address confirmed', $user->sms . ' (' . $carrier->name . ')'); + $this->element('span', 'input_instructions', _('Current confirmed SMS-enabled phone number.')); - common_hidden('sms', $user->sms); - common_hidden('carrier', $user->carrier); - common_element_end('p'); - common_submit('remove', _('Remove')); + $this->hidden('sms', $user->sms); + $this->hidden('carrier', $user->carrier); + $this->elementEnd('p'); + $this->submit('remove', _('Remove')); } else { $confirm = $this->get_confirmation(); if ($confirm) { $carrier = Sms_carrier::staticGet($confirm->address_extra); - common_element_start('p'); - common_element('span', 'address unconfirmed', $confirm->address . ' (' . $carrier->name . ')'); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address unconfirmed', $confirm->address . ' (' . $carrier->name . ')'); + $this->element('span', 'input_instructions', _('Awaiting confirmation on this phone number.')); - common_hidden('sms', $confirm->address); - common_hidden('carrier', $confirm->address_extra); - common_element_end('p'); - common_submit('cancel', _('Cancel')); - common_input('code', _('Confirmation code'), null, + $this->hidden('sms', $confirm->address); + $this->hidden('carrier', $confirm->address_extra); + $this->elementEnd('p'); + $this->submit('cancel', _('Cancel')); + $this->input('code', _('Confirmation code'), null, _('Enter the code you received on your phone.')); - common_submit('confirm', _('Confirm')); + $this->submit('confirm', _('Confirm')); } else { - common_input('sms', _('SMS Phone number'), + $this->input('sms', _('SMS Phone number'), ($this->arg('sms')) ? $this->arg('sms') : null, _('Phone number, no punctuation or spaces, with area code')); $this->carrier_select(); - common_submit('add', _('Add')); + $this->submit('add', _('Add')); } } if ($user->sms) { - common_element('h2', null, _('Incoming email')); + $this->element('h2', null, _('Incoming email')); if ($user->incomingemail) { - common_element_start('p'); - common_element('span', 'address', $user->incomingemail); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address', $user->incomingemail); + $this->element('span', 'input_instructions', _('Send email to this address to post new notices.')); - common_element_end('p'); - common_submit('removeincoming', _('Remove')); + $this->elementEnd('p'); + $this->submit('removeincoming', _('Remove')); } - common_element_start('p'); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'input_instructions', _('Make a new email address for posting to; cancels the old one.')); - common_element_end('p'); - common_submit('newincoming', _('New')); + $this->elementEnd('p'); + $this->submit('newincoming', _('New')); } - common_element('h2', null, _('Preferences')); + $this->element('h2', null, _('Preferences')); - common_checkbox('smsnotify', + $this->checkbox('smsnotify', _('Send me notices through SMS; I understand I may incur exorbitant charges from my carrier.'), $user->smsnotify); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } @@ -307,19 +307,19 @@ class SmssettingsAction extends EmailsettingsAction $carrier = new Sms_carrier(); $cnt = $carrier->find(); - common_element_start('p'); - common_element('label', array('for' => 'carrier')); - common_element_start('select', array('name' => 'carrier', + $this->elementStart('p'); + $this->element('label', array('for' => 'carrier')); + $this->elementStart('select', array('name' => 'carrier', 'id' => 'carrier')); - common_element('option', array('value' => 0), + $this->element('option', array('value' => 0), _('Select a carrier')); while ($carrier->fetch()) { - common_element('option', array('value' => $carrier->id), + $this->element('option', array('value' => $carrier->id), $carrier->name); } - common_element_end('select'); - common_element_end('p'); - common_element('span', 'input_instructions', + $this->elementEnd('select'); + $this->elementEnd('p'); + $this->element('span', 'input_instructions', sprintf(_('Mobile carrier for your phone. '. 'If you know a carrier that accepts ' . 'SMS over email but isn\'t listed here, ' . diff --git a/actions/subscribe.php b/actions/subscribe.php index f33d1d207..99f9acc24 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -65,13 +65,13 @@ class SubscribeAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Subscribed')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Subscribed')); + $this->elementEnd('head'); + $this->elementStart('body'); common_unsubscribe_form($other->getProfile()); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url('subscriptions', array('nickname' => $user->nickname))); diff --git a/actions/subscriptions.php b/actions/subscriptions.php index afe8fb260..7a87a144f 100644 --- a/actions/subscriptions.php +++ b/actions/subscriptions.php @@ -72,16 +72,16 @@ class SubscriptionsList extends ProfileList return; } - common_element_start('form', array('id' => 'subedit-' . $profile->id, + $this->elementStart('form', array('id' => 'subedit-' . $profile->id, 'method' => 'post', 'class' => 'subedit', 'action' => common_local_url('subedit'))); - common_hidden('token', common_session_token()); - common_hidden('profile', $profile->id); - common_checkbox('jabber', _('Jabber'), $sub->jabber); - common_checkbox('sms', _('SMS'), $sub->sms); - common_submit('save', _('Save')); - common_element_end('form'); + $this->hidden('token', common_session_token()); + $this->hidden('profile', $profile->id); + $this->checkbox('jabber', _('Jabber'), $sub->jabber); + $this->checkbox('sms', _('SMS'), $sub->sms); + $this->submit('save', _('Save')); + $this->elementEnd('form'); return; } } diff --git a/actions/tag.php b/actions/tag.php index 8a3f90c16..3096b75b3 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -51,7 +51,7 @@ class TagAction extends StreamAction function show_header($tag = false) { if ($tag) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('tagrss', array('tag' => $tag)), 'type' => 'application/rss+xml', 'title' => sprintf(_('Feed for tag %s'), $tag))); @@ -68,9 +68,9 @@ class TagAction extends StreamAction if (!$tag) { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); $this->public_views_menu(); } else { @@ -110,7 +110,7 @@ class TagAction extends StreamAction $cnt = $tags->find(); if ($cnt > 0) { - common_element_start('p', 'tagcloud'); + $this->elementStart('p', 'tagcloud'); $tw = array(); $sum = 0; @@ -125,7 +125,7 @@ class TagAction extends StreamAction $this->show_tag($tag, $weight, $weight/$sum); } - common_element_end('p'); + $this->elementEnd('p'); } } @@ -149,10 +149,10 @@ class TagAction extends StreamAction $cls = 'smallest'; } - common_element('a', array('class' => "$cls weight-$weight relative-$relative", + $this->element('a', array('class' => "$cls weight-$weight relative-$relative", 'href' => common_local_url('tag', array('tag' => $tag))), $tag); - common_text(' '); + $this->text(' '); } function show_notices($tag) diff --git a/actions/tagother.php b/actions/tagother.php index ff6788cc6..f0105ec8b 100644 --- a/actions/tagother.php +++ b/actions/tagother.php @@ -61,7 +61,7 @@ class TagotherAction extends Action $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); - common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), + $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), 'class' => 'avatar stream', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, @@ -69,39 +69,39 @@ class TagotherAction extends Action ($profile->fullname) ? $profile->fullname : $profile->nickname)); - common_element('a', array('href' => $profile->profileurl, + $this->element('a', array('href' => $profile->profileurl, 'class' => 'external profile nickname'), $profile->nickname); if ($profile->fullname) { - common_element_start('div', 'fullname'); + $this->elementStart('div', 'fullname'); if ($profile->homepage) { - common_element('a', array('href' => $profile->homepage), + $this->element('a', array('href' => $profile->homepage), $profile->fullname); } else { - common_text($profile->fullname); + $this->text($profile->fullname); } - common_element_end('div'); + $this->elementEnd('div'); } if ($profile->location) { - common_element('div', 'location', $profile->location); + $this->element('div', 'location', $profile->location); } if ($profile->bio) { - common_element('div', 'bio', $profile->bio); + $this->element('div', 'bio', $profile->bio); } - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'tag_user', 'name' => 'tagother', 'action' => $this->self_url())); - common_hidden('token', common_session_token()); - common_hidden('id', $profile->id); - common_input('tags', _('Tags'), + $this->hidden('token', common_session_token()); + $this->hidden('id', $profile->id); + $this->input('tags', _('Tags'), ($this->arg('tags')) ? $this->arg('tags') : implode(' ', Profile_tag::getTags($user->id, $profile->id)), _('Tags for this user (letters, numbers, -, ., and _), comma- or space- separated')); - common_submit('save', _('Save')); - common_element_end('form'); + $this->submit('save', _('Save')); + $this->elementEnd('form'); common_show_footer(); } @@ -162,20 +162,20 @@ class TagotherAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml'); - common_element_start('head'); - common_element('title', null, _('Tags')); - common_element_end('head'); - common_element_start('body'); - common_element_start('p', 'subtags'); + $this->elementStart('head'); + $this->element('title', null, _('Tags')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->elementStart('p', 'subtags'); foreach ($tags as $tag) { - common_element('a', array('href' => common_local_url($action, + $this->element('a', array('href' => common_local_url($action, array('nickname' => $user->nickname, 'tag' => $tag))), $tag); } - common_element_end('p'); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('p'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url($action, array('nickname' => $user->nickname))); @@ -186,12 +186,12 @@ class TagotherAction extends Action { list($profile, $error) = $arr; if ($error) { - common_element('p', 'error', $error); + $this->element('p', 'error', $error); } else { - common_element_start('div', 'instructions'); - common_element('p', null, + $this->elementStart('div', 'instructions'); + $this->element('p', null, _('Use this form to add tags to your subscribers or subscriptions.')); - common_element_end('div'); + $this->elementEnd('div'); } } } diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php index e0731f66f..36d2a7e09 100644 --- a/actions/twitapidirect_messages.php +++ b/actions/twitapidirect_messages.php @@ -188,7 +188,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction { $this->init_document('xml'); - common_element_start('direct-messages', array('type' => 'array')); + $this->elementStart('direct-messages', array('type' => 'array')); if (is_array($messages)) { foreach ($message as $m) { @@ -202,7 +202,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction } } - common_element_end('direct-messages'); + $this->elementEnd('direct-messages'); $this->end_document('xml'); } @@ -236,13 +236,13 @@ class Twitapidirect_messagesAction extends TwitterapiAction $this->init_document('rss'); - common_element_start('channel'); - common_element('title', null, $title); + $this->elementStart('channel'); + $this->element('title', null, $title); - common_element('link', null, $link); - common_element('description', null, $subtitle); - common_element('language', null, 'en-us'); - common_element('ttl', null, '40'); + $this->element('link', null, $link); + $this->element('description', null, $subtitle); + $this->element('language', null, 'en-us'); + $this->element('ttl', null, '40'); if (is_array($message)) { foreach ($message as $m) { @@ -256,7 +256,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction } } - common_element_end('channel'); + $this->elementEnd('channel'); $this->end_twitter_rss(); } @@ -266,12 +266,12 @@ class Twitapidirect_messagesAction extends TwitterapiAction $this->init_document('atom'); - common_element('title', null, $title); + $this->element('title', null, $title); $siteserver = common_config('site', 'server'); - common_element('id', null, "tag:$siteserver,2008:DirectMessage"); - common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null); - common_element('updated', null, common_date_iso8601(strftime('%c'))); - common_element('subtitle', null, $subtitle); + $this->element('id', null, "tag:$siteserver,2008:DirectMessage"); + $this->element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null); + $this->element('updated', null, common_date_iso8601(strftime('%c'))); + $this->element('subtitle', null, $subtitle); if (is_array($message)) { foreach ($message as $m) { diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index ba4afe441..458ff48a5 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -142,7 +142,7 @@ class TwitapifriendshipsAction extends TwitterapiAction switch ($apidata['content-type']) { case 'xml': $this->init_document('xml'); - common_element('friends', null, $result); + $this->element('friends', null, $result); $this->end_document('xml'); break; case 'json': diff --git a/actions/twitapihelp.php b/actions/twitapihelp.php index 1b84cb11b..531c6e9d3 100644 --- a/actions/twitapihelp.php +++ b/actions/twitapihelp.php @@ -34,7 +34,7 @@ class TwitapihelpAction extends TwitterapiAction if ($apidata['content-type'] == 'xml') { $this->init_document('xml'); - common_element('ok', null, 'true'); + $this->element('ok', null, 'true'); $this->end_document('xml'); } elseif ($apidata['content-type'] == 'json') { $this->init_document('json'); diff --git a/actions/twitapilaconica.php b/actions/twitapilaconica.php index 722423fae..34c8f88fc 100644 --- a/actions/twitapilaconica.php +++ b/actions/twitapilaconica.php @@ -70,7 +70,7 @@ class TwitapilaconicaAction extends TwitterapiAction switch ($apidata['content-type']) { case 'xml': $this->init_document('xml'); - common_element('version', null, LACONICA_VERSION); + $this->element('version', null, LACONICA_VERSION); $this->end_document('xml'); break; case 'json': @@ -115,10 +115,10 @@ class TwitapilaconicaAction extends TwitterapiAction switch ($apidata['content-type']) { case 'xml': $this->init_document('xml'); - common_element_start('config'); + $this->elementStart('config'); // XXX: check that all sections and settings are legal XML elements foreach ($keys as $section => $settings) { - common_element_start($section); + $this->elementStart($section); foreach ($settings as $setting) { $value = common_config($section, $setting); if (is_array($value)) { @@ -128,11 +128,11 @@ class TwitapilaconicaAction extends TwitterapiAction } else if ($value === true) { $value = 'true'; } - common_element($setting, null, $value); + $this->element($setting, null, $value); } - common_element_end($section); + $this->elementEnd($section); } - common_element_end('config'); + $this->elementEnd('config'); $this->end_document('xml'); break; case 'json': diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index e629d5cc4..8d175ecab 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -538,11 +538,11 @@ class TwitapistatusesAction extends TwitterapiAction { switch ($type) { case 'xml': - common_element_start('users', array('type' => 'array')); + $this->elementStart('users', array('type' => 'array')); foreach ($profiles as $profile) { $this->show_profile($profile); } - common_element_end('users'); + $this->elementEnd('users'); break; case 'json': $arrays = array(); diff --git a/actions/twittersettings.php b/actions/twittersettings.php index 9e7e4cae8..663688037 100644 --- a/actions/twittersettings.php +++ b/actions/twittersettings.php @@ -44,52 +44,52 @@ class TwittersettingsAction extends SettingsAction } $this->form_header(_('Twitter settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'twittersettings', 'action' => common_local_url('twittersettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_element('h2', null, _('Twitter Account')); + $this->element('h2', null, _('Twitter Account')); if ($fuser) { - common_element_start('p'); + $this->elementStart('p'); - common_element('span', 'twitter_user', $fuser->nickname); - common_element('a', array('href' => $fuser->uri), $fuser->uri); - common_element('span', 'input_instructions', + $this->element('span', 'twitter_user', $fuser->nickname); + $this->element('a', array('href' => $fuser->uri), $fuser->uri); + $this->element('span', 'input_instructions', _('Current verified Twitter account.')); - common_hidden('flink_foreign_id', $flink->foreign_id); - common_element_end('p'); - common_submit('remove', _('Remove')); + $this->hidden('flink_foreign_id', $flink->foreign_id); + $this->elementEnd('p'); + $this->submit('remove', _('Remove')); } else { - common_input('twitter_username', _('Twitter user name'), + $this->input('twitter_username', _('Twitter user name'), ($this->arg('twitter_username')) ? $this->arg('twitter_username') : $profile->nickname, _('No spaces, please.')); // hey, it's what Twitter says - common_password('twitter_password', _('Twitter password')); + $this->password('twitter_password', _('Twitter password')); } - common_element('h2', null, _('Preferences')); + $this->element('h2', null, _('Preferences')); - common_checkbox('noticesync', _('Automatically send my notices to Twitter.'), + $this->checkbox('noticesync', _('Automatically send my notices to Twitter.'), ($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND) : true); - common_checkbox('replysync', _('Send local "@" replies to Twitter.'), + $this->checkbox('replysync', _('Send local "@" replies to Twitter.'), ($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true); - common_checkbox('friendsync', _('Subscribe to my Twitter friends here.'), + $this->checkbox('friendsync', _('Subscribe to my Twitter friends here.'), ($flink) ? ($flink->friendsync & FOREIGN_FRIEND_RECV) : false); if ($flink) { - common_submit('save', _('Save')); + $this->submit('save', _('Save')); } else { - common_submit('add', _('Add')); + $this->submit('add', _('Add')); } $this->show_twitter_subscriptions(); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } @@ -131,9 +131,9 @@ class TwittersettingsAction extends SettingsAction if ($friends_count > 0) { - common_element('h3', null, _('Twitter Friends')); - common_element_start('div', array('id' => 'subscriptions')); - common_element_start('ul', array('id' => 'subscriptions_avatars')); + $this->element('h3', null, _('Twitter Friends')); + $this->elementStart('div', array('id' => 'subscriptions')); + $this->elementStart('ul', array('id' => 'subscriptions_avatars')); for ($i = 0; $i < min($friends_count, SUBSCRIPTIONS); $i++) { @@ -144,28 +144,28 @@ class TwittersettingsAction extends SettingsAction continue; } - common_element_start('li'); - common_element_start('a', array('title' => ($other->fullname) ? + $this->elementStart('li'); + $this->elementStart('a', array('title' => ($other->fullname) ? $other->fullname : $other->nickname, 'href' => $other->profileurl, 'rel' => 'contact', 'class' => 'subscription')); $avatar = $other->getAvatar(AVATAR_MINI_SIZE); - common_element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), + $this->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar mini', 'alt' => ($other->fullname) ? $other->fullname : $other->nickname)); - common_element_end('a'); - common_element_end('li'); + $this->elementEnd('a'); + $this->elementEnd('li'); } - common_element_end('ul'); - common_element_end('div'); + $this->elementEnd('ul'); + $this->elementEnd('div'); } @@ -173,13 +173,13 @@ class TwittersettingsAction extends SettingsAction /* if ($subs_count > SUBSCRIPTIONS) { - common_element_start('p', array('id' => 'subscriptions_viewall')); + $this->elementStart('p', array('id' => 'subscriptions_viewall')); - common_element('a', array('href' => common_local_url('subscriptions', + $this->element('a', array('href' => common_local_url('subscriptions', array('nickname' => $profile->nickname)), 'class' => 'moresubscriptions'), _('All subscriptions')); - common_element_end('p'); + $this->elementEnd('p'); } */ diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index 1c2e13635..455c5e28e 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -67,13 +67,13 @@ class UnsubscribeAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Unsubscribed')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Unsubscribed')); + $this->elementEnd('head'); + $this->elementStart('body'); common_subscribe_form($other); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url('subscriptions', array('nickname' => $user->nickname))); diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 05efbc16c..196fae9ad 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -84,51 +84,51 @@ class UserauthorizationAction extends Action $avatar = $req->get_parameter('omb_listenee_avatar'); common_show_header(_('Authorize subscription')); - common_element('p', null, _('Please check these details to make sure '. + $this->element('p', null, _('Please check these details to make sure '. 'that you want to subscribe to this user\'s notices. '. 'If you didn\'t just ask to subscribe to someone\'s notices, '. 'click "Cancel".')); - common_element_start('div', 'profile'); + $this->elementStart('div', 'profile'); if ($avatar) { - common_element('img', array('src' => $avatar, + $this->element('img', array('src' => $avatar, 'class' => 'avatar profile', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $nickname)); } - common_element('a', array('href' => $profile, + $this->element('a', array('href' => $profile, 'class' => 'external profile nickname'), $nickname); if ($fullname) { - common_element_start('div', 'fullname'); + $this->elementStart('div', 'fullname'); if ($homepage) { - common_element('a', array('href' => $homepage), + $this->element('a', array('href' => $homepage), $fullname); } else { - common_text($fullname); + $this->text($fullname); } - common_element_end('div'); + $this->elementEnd('div'); } if ($location) { - common_element('div', 'location', $location); + $this->element('div', 'location', $location); } if ($bio) { - common_element('div', 'bio', $bio); + $this->element('div', 'bio', $bio); } - common_element_start('div', 'license'); - common_element('a', array('href' => $license, + $this->elementStart('div', 'license'); + $this->element('a', array('href' => $license, 'class' => 'license'), $license); - common_element_end('div'); - common_element_end('div'); - common_element_start('form', array('method' => 'post', + $this->elementEnd('div'); + $this->elementEnd('div'); + $this->elementStart('form', array('method' => 'post', 'id' => 'userauthorization', 'name' => 'userauthorization', 'action' => common_local_url('userauthorization'))); - common_hidden('token', common_session_token()); - common_submit('accept', _('Accept')); - common_submit('reject', _('Reject')); - common_element_end('form'); + $this->hidden('token', common_session_token()); + $this->submit('accept', _('Accept')); + $this->submit('reject', _('Reject')); + $this->elementEnd('form'); common_show_footer(); } @@ -328,18 +328,18 @@ class UserauthorizationAction extends Action function show_accept_message($tok) { common_show_header(_('Subscription authorized')); - common_element('p', null, + $this->element('p', null, _('The subscription has been authorized, but no '. 'callback URL was passed. Check with the site\'s instructions for '. 'details on how to authorize the subscription. Your subscription token is:')); - common_element('blockquote', 'token', $tok); + $this->element('blockquote', 'token', $tok); common_show_footer(); } function show_reject_message($tok) { common_show_header(_('Subscription rejected')); - common_element('p', null, + $this->element('p', null, _('The subscription has been rejected, but no '. 'callback URL was passed. Check with the site\'s instructions for '. 'details on how to fully reject the subscription.')); diff --git a/actions/xrds.php b/actions/xrds.php index 7edc6aa39..9c51f1dd2 100644 --- a/actions/xrds.php +++ b/actions/xrds.php @@ -47,14 +47,14 @@ class XrdsAction extends Action header('Content-Type: application/xrds+xml'); common_start_xml(); - common_element_start('XRDS', array('xmlns' => 'xri://$xrds')); + $this->elementStart('XRDS', array('xmlns' => 'xri://$xrds')); - common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', + $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'xml:id' => 'oauth', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); - common_element('Type', null, 'xri://$xrds*simple'); + $this->element('Type', null, 'xri://$xrds*simple'); $this->show_service(OAUTH_ENDPOINT_REQUEST, common_local_url('requesttoken'), @@ -77,16 +77,16 @@ class XrdsAction extends Action array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY), array(OAUTH_HMAC_SHA1)); - common_element_end('XRD'); + $this->elementEnd('XRD'); # XXX: decide whether to include user's ID/nickname in postNotice URL - common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', + $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'xml:id' => 'omb', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); - common_element('Type', null, 'xri://$xrds*simple'); + $this->element('Type', null, 'xri://$xrds*simple'); $this->show_service(OMB_ENDPOINT_POSTNOTICE, common_local_url('postnotice')); @@ -94,44 +94,44 @@ class XrdsAction extends Action $this->show_service(OMB_ENDPOINT_UPDATEPROFILE, common_local_url('updateprofile')); - common_element_end('XRD'); + $this->elementEnd('XRD'); - common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', + $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'version' => '2.0')); - common_element('Type', null, 'xri://$xrds*simple'); + $this->element('Type', null, 'xri://$xrds*simple'); $this->show_service(OAUTH_DISCOVERY, '#oauth'); $this->show_service(OMB_NAMESPACE, '#omb'); - common_element_end('XRD'); + $this->elementEnd('XRD'); - common_element_end('XRDS'); + $this->elementEnd('XRDS'); common_end_xml(); } function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { - common_element_start('Service'); + $this->elementStart('Service'); if ($uri) { - common_element('URI', null, $uri); + $this->element('URI', null, $uri); } - common_element('Type', null, $type); + $this->element('Type', null, $type); if ($params) { foreach ($params as $param) { - common_element('Type', null, $param); + $this->element('Type', null, $param); } } if ($sigs) { foreach ($sigs as $sig) { - common_element('Type', null, $sig); + $this->element('Type', null, $sig); } } if ($localId) { - common_element('LocalID', null, $localId); + $this->element('LocalID', null, $localId); } - common_element_end('Service'); + $this->elementEnd('Service'); } } \ No newline at end of file diff --git a/lib/action.php b/lib/action.php index d5060758e..d02a1b709 100644 --- a/lib/action.php +++ b/lib/action.php @@ -314,7 +314,7 @@ class Action extends HTMLOutputter // lawsuit { $this->elementStart('div', array('id' => 'content')); $this->showPageTitle(); - $this->showPageNotice(); + $this->showPageNoticeBlock(); $this->elementStart('div', array('id' => 'content_inner')); // show the actual content (forms, lists, whatever) $this->showContent(); @@ -326,19 +326,24 @@ class Action extends HTMLOutputter // lawsuit $this->element('h1', NULL, $this->title()); } + function showPageNoticeBlock() + { + $this->elementStart('dl', array('id' => 'page_notice', + 'class' => 'system_notice')); + $this->element('dt', null, _('Page notice')); + $this->elementStart('dd', null); + $this->showPageNotice(); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + } + // SHOULD overload (unless there's not a notice) function showPageNotice() { - $this->elementStart('dl', array('id' => 'page_notice', - 'class' => 'system_notice')); - $this->element('dt', null, _('Page notice')); - $this->elementStart('dd', null); - // Output a bunch of paragraphs here - $this->elementEnd('dd'); - $this->elementEnd('dl'); } - + // MUST overload function showContent() -- cgit v1.2.3-54-g00ecf From bb58bf8caf66b237d2bc383bebe0af15da5c5b41 Mon Sep 17 00:00:00 2001 From: sarven Date: Thu, 15 Jan 2009 23:02:48 +0000 Subject: Minor parse error --- lib/action.php | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index d02a1b709..bd37a8442 100644 --- a/lib/action.php +++ b/lib/action.php @@ -336,7 +336,6 @@ class Action extends HTMLOutputter // lawsuit $this->elementEnd('dd'); $this->elementEnd('dl'); } - } // SHOULD overload (unless there's not a notice) -- cgit v1.2.3-54-g00ecf From 4b0cf99e56f965e10eeb8b8b19e7b405bda49eaf Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 23:03:38 +0000 Subject: Convert use of common_server_error and common_user_error to methods on Action --- actions/accesstoken.php | 2 +- actions/all.php | 4 ++-- actions/allrss.php | 2 +- actions/api.php | 4 ++-- actions/avatarbynickname.php | 10 ++++----- actions/block.php | 12 +++++------ actions/confirmaddress.php | 14 ++++++------ actions/deleteprofile.php | 2 +- actions/disfavor.php | 8 +++---- actions/doc.php | 2 +- actions/emailsettings.php | 12 +++++------ actions/facebookremove.php | 2 +- actions/favor.php | 8 +++---- actions/favoritesrss.php | 2 +- actions/finishaddopenid.php | 2 +- actions/finishopenidlogin.php | 12 +++++------ actions/finishremotesubscribe.php | 34 ++++++++++++++--------------- actions/foaf.php | 4 ++-- actions/imsettings.php | 8 +++---- actions/invite.php | 2 +- actions/login.php | 8 +++---- actions/logout.php | 2 +- actions/microsummary.php | 4 ++-- actions/newmessage.php | 10 ++++----- actions/newnotice.php | 4 ++-- actions/noticesearch.php | 2 +- actions/nudge.php | 6 +++--- actions/openidlogin.php | 2 +- actions/othersettings.php | 2 +- actions/peopletag.php | 2 +- actions/postnotice.php | 14 ++++++------ actions/profilesettings.php | 12 +++++------ actions/public.php | 2 +- actions/recoverpassword.php | 26 +++++++++++----------- actions/register.php | 10 ++++----- actions/remotesubscribe.php | 4 ++-- actions/replies.php | 4 ++-- actions/repliesrss.php | 2 +- actions/requesttoken.php | 2 +- actions/showfavorites.php | 6 +++--- actions/showmessage.php | 4 ++-- actions/shownotice.php | 6 +++--- actions/showstream.php | 4 ++-- actions/smssettings.php | 8 +++---- actions/subedit.php | 12 +++++------ actions/subscribe.php | 8 +++---- actions/tagother.php | 12 +++++------ actions/tagrss.php | 2 +- actions/twitapiaccount.php | 16 +++++++------- actions/twitapiblocks.php | 8 +++---- actions/twitapidirect_messages.php | 18 ++++++++-------- actions/twitapifavorites.php | 20 ++++++++--------- actions/twitapifriendships.php | 16 +++++++------- actions/twitapihelp.php | 4 ++-- actions/twitapilaconica.php | 6 +++--- actions/twitapinotifications.php | 4 ++-- actions/twitapistatuses.php | 44 +++++++++++++++++++------------------- actions/twitapiusers.php | 4 ++-- actions/twittersettings.php | 2 +- actions/unblock.php | 10 ++++----- actions/unsubscribe.php | 10 ++++----- actions/updateprofile.php | 36 +++++++++++++++---------------- actions/userauthorization.php | 12 +++++------ actions/userbyid.php | 4 ++-- actions/userrss.php | 4 ++-- actions/xrds.php | 2 +- lib/action.php | 4 ++-- 67 files changed, 275 insertions(+), 275 deletions(-) (limited to 'lib/action.php') diff --git a/actions/accesstoken.php b/actions/accesstoken.php index 072ce27eb..ad03b7019 100644 --- a/actions/accesstoken.php +++ b/actions/accesstoken.php @@ -38,7 +38,7 @@ class AccesstokenAction extends Action common_debug('printing the access token', __FILE__); print $token; } catch (OAuthException $e) { - common_server_error($e->getMessage()); + $this->serverError($e->getMessage()); } } } diff --git a/actions/all.php b/actions/all.php index a8a74fb33..4ad7f12ae 100644 --- a/actions/all.php +++ b/actions/all.php @@ -33,14 +33,14 @@ class AllAction extends StreamAction $user = User::staticGet('nickname', $nickname); if (!$user) { - $this->client_error(_('No such user.')); + $this->clientError(_('No such user.')); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } diff --git a/actions/allrss.php b/actions/allrss.php index 660afb9e2..56818d605 100644 --- a/actions/allrss.php +++ b/actions/allrss.php @@ -34,7 +34,7 @@ class AllrssAction extends Rss10Action $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return false; } else { return true; diff --git a/actions/api.php b/actions/api.php index 9cbf9a468..64971774d 100644 --- a/actions/api.php +++ b/actions/api.php @@ -103,10 +103,10 @@ class ApiAction extends Action call_user_func(array($action_obj, $this->api_method), $_REQUEST, $apidata); } else { - common_user_error("API method not found!", $code=404); + $this->clientError("API method not found!", $code=404); } } else { - common_user_error("API method not found!", $code=404); + $this->clientError("API method not found!", $code=404); } } diff --git a/actions/avatarbynickname.php b/actions/avatarbynickname.php index 666f386f6..d2d078b61 100644 --- a/actions/avatarbynickname.php +++ b/actions/avatarbynickname.php @@ -26,28 +26,28 @@ class AvatarbynicknameAction extends Action parent::handle($args); $nickname = $this->trimmed('nickname'); if (!$nickname) { - $this->client_error(_('No nickname.')); + $this->clientError(_('No nickname.')); return; } $size = $this->trimmed('size'); if (!$size) { - $this->client_error(_('No size.')); + $this->clientError(_('No size.')); return; } $size = strtolower($size); if (!in_array($size, array('original', '96', '48', '24'))) { - $this->client_error(_('Invalid size.')); + $this->clientError(_('Invalid size.')); return; } $user = User::staticGet('nickname', $nickname); if (!$user) { - $this->client_error(_('No such user.')); + $this->clientError(_('No such user.')); return; } $profile = $user->getProfile(); if (!$profile) { - $this->client_error(_('User has no profile.')); + $this->clientError(_('User has no profile.')); return; } if ($size == 'original') { diff --git a/actions/block.php b/actions/block.php index f8f6f24fd..738cbfbf7 100644 --- a/actions/block.php +++ b/actions/block.php @@ -30,28 +30,28 @@ class BlockAction extends Action parent::prepare($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return false; } $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $id = $this->trimmed('blockto'); if (!$id) { - $this->client_error(_('No profile specified.')); + $this->clientError(_('No profile specified.')); return false; } $this->profile = Profile::staticGet('id', $id); if (!$this->profile) { - $this->client_error(_('No profile with that ID.')); + $this->clientError(_('No profile with that ID.')); return false; } @@ -119,14 +119,14 @@ class BlockAction extends Action $cur = common_current_user(); if ($cur->hasBlocked($this->profile)) { - $this->client_error(_('You have already blocked this user.')); + $this->clientError(_('You have already blocked this user.')); return; } $result = $cur->block($this->profile); if (!$result) { - $this->server_error(_('Failed to save block information.')); + $this->serverError(_('Failed to save block information.')); return; } diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php index 31a157768..53410fbe6 100644 --- a/actions/confirmaddress.php +++ b/actions/confirmaddress.php @@ -32,26 +32,26 @@ class ConfirmaddressAction extends Action } $code = $this->trimmed('code'); if (!$code) { - $this->client_error(_('No confirmation code.')); + $this->clientError(_('No confirmation code.')); return; } $confirm = Confirm_address::staticGet('code', $code); if (!$confirm) { - $this->client_error(_('Confirmation code not found.')); + $this->clientError(_('Confirmation code not found.')); return; } $cur = common_current_user(); if ($cur->id != $confirm->user_id) { - $this->client_error(_('That confirmation code is not for you!')); + $this->clientError(_('That confirmation code is not for you!')); return; } $type = $confirm->address_type; if (!in_array($type, array('email', 'jabber', 'sms'))) { - $this->server_error(sprintf(_('Unrecognized address type %s'), $type)); + $this->serverError(sprintf(_('Unrecognized address type %s'), $type)); return; } if ($cur->$type == $confirm->address) { - $this->client_error(_('That address has already been confirmed.')); + $this->clientError(_('That address has already been confirmed.')); return; } @@ -71,7 +71,7 @@ class ConfirmaddressAction extends Action if (!$result) { common_log_db_error($cur, 'UPDATE', __FILE__); - $this->server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } @@ -83,7 +83,7 @@ class ConfirmaddressAction extends Action if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - $this->server_error(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Couldn\'t delete email confirmation.')); return; } diff --git a/actions/deleteprofile.php b/actions/deleteprofile.php index ef4687d5f..cc236f847 100644 --- a/actions/deleteprofile.php +++ b/actions/deleteprofile.php @@ -24,7 +24,7 @@ class DeleteprofileAction extends Action function handle($args) { parent::handle($args); - $this->server_error(_('Code not yet ready.')); + $this->serverError(_('Code not yet ready.')); return; if ('POST' === $_SERVER['REQUEST_METHOD']) { $this->handle_post(); diff --git a/actions/disfavor.php b/actions/disfavor.php index 9a27f34b1..fc36f7c75 100644 --- a/actions/disfavor.php +++ b/actions/disfavor.php @@ -28,7 +28,7 @@ class DisfavorAction extends Action parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -46,7 +46,7 @@ class DisfavorAction extends Action $token = $this->trimmed('token-'.$notice->id); if (!$token || $token != common_session_token()) { - $this->client_error(_("There was a problem with your session token. Try again, please.")); + $this->clientError(_("There was a problem with your session token. Try again, please.")); return; } @@ -54,7 +54,7 @@ class DisfavorAction extends Action $fave->user_id = $this->id; $fave->notice_id = $notice->id; if (!$fave->find(true)) { - $this->client_error(_('This notice is not a favorite!')); + $this->clientError(_('This notice is not a favorite!')); return; } @@ -62,7 +62,7 @@ class DisfavorAction extends Action if (!$result) { common_log_db_error($fave, 'DELETE', __FILE__); - $this->server_error(_('Could not delete favorite.')); + $this->serverError(_('Could not delete favorite.')); return; } diff --git a/actions/doc.php b/actions/doc.php index 98da31267..3d14b25b8 100644 --- a/actions/doc.php +++ b/actions/doc.php @@ -28,7 +28,7 @@ class DocAction extends Action $title = $this->trimmed('title'); $filename = INSTALLDIR.'/doc/'.$title; if (!file_exists($filename)) { - common_user_error(_('No such document.')); + $this->clientError(_('No such document.')); return; } $c = file_get_contents($filename); diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 39f186bff..6210c07b4 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -182,7 +182,7 @@ class EmailsettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } @@ -232,7 +232,7 @@ class EmailsettingsAction extends SettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); - common_server_error(_('Couldn\'t insert confirmation code.')); + $this->serverError(_('Couldn\'t insert confirmation code.')); return; } @@ -260,7 +260,7 @@ class EmailsettingsAction extends SettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - $this->server_error(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Couldn\'t delete email confirmation.')); return; } @@ -286,7 +286,7 @@ class EmailsettingsAction extends SettingsAction $result = $user->updateKeys($original); if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } $user->query('COMMIT'); @@ -308,7 +308,7 @@ class EmailsettingsAction extends SettingsAction if (!$user->updateKeys($orig)) { common_log_db_error($user, 'UPDATE', __FILE__); - $this->server_error(_("Couldn't update user record.")); + $this->serverError(_("Couldn't update user record.")); } $this->show_form(_('Incoming email address removed.'), true); @@ -323,7 +323,7 @@ class EmailsettingsAction extends SettingsAction if (!$user->updateKeys($orig)) { common_log_db_error($user, 'UPDATE', __FILE__); - $this->server_error(_("Couldn't update user record.")); + $this->serverError(_("Couldn't update user record.")); } $this->show_form(_('New incoming email address added.'), true); diff --git a/actions/facebookremove.php b/actions/facebookremove.php index a200fefbf..d0a0dd951 100644 --- a/actions/facebookremove.php +++ b/actions/facebookremove.php @@ -53,7 +53,7 @@ class FacebookremoveAction extends FacebookAction if (!$result) { common_log_db_error($flink, 'DELETE', __FILE__); - common_server_error(_('Couldn\'t remove Facebook user.')); + $this->serverError(_('Couldn\'t remove Facebook user.')); return; } diff --git a/actions/favor.php b/actions/favor.php index 1dfef9bbb..8d751a7a9 100644 --- a/actions/favor.php +++ b/actions/favor.php @@ -29,7 +29,7 @@ class FavorAction extends Action parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -48,19 +48,19 @@ class FavorAction extends Action $token = $this->trimmed('token-'.$notice->id); if (!$token || $token != common_session_token()) { - $this->client_error(_("There was a problem with your session token. Try again, please.")); + $this->clientError(_("There was a problem with your session token. Try again, please.")); return; } if ($user->hasFave($notice)) { - $this->client_error(_('This notice is already a favorite!')); + $this->clientError(_('This notice is already a favorite!')); return; } $fave = Fave::addNew($user, $notice); if (!$fave) { - $this->server_error(_('Could not create favorite.')); + $this->serverError(_('Could not create favorite.')); return; } diff --git a/actions/favoritesrss.php b/actions/favoritesrss.php index 8c7ce52bf..3f4ffc63a 100644 --- a/actions/favoritesrss.php +++ b/actions/favoritesrss.php @@ -34,7 +34,7 @@ class FavoritesrssAction extends Rss10Action $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return false; } else { return true; diff --git a/actions/finishaddopenid.php b/actions/finishaddopenid.php index 7de631712..708e8d4bf 100644 --- a/actions/finishaddopenid.php +++ b/actions/finishaddopenid.php @@ -28,7 +28,7 @@ class FinishaddopenidAction extends Action { parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); } else { $this->try_login(); } diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index 112429002..bc33ac330 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -28,7 +28,7 @@ class FinishopenidloginAction extends Action { parent::handle($args); if (common_logged_in()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -179,7 +179,7 @@ class FinishopenidloginAction extends Action # FIXME: save invite code before redirect, and check here if (common_config('site', 'closed') || common_config('site', 'inviteonly')) { - common_user_error(_('Registration not allowed.')); + $this->clientError(_('Registration not allowed.')); return; } @@ -205,7 +205,7 @@ class FinishopenidloginAction extends Action list($display, $canonical, $sreg) = $this->get_saved_values(); if (!$display || !$canonical) { - common_server_error(_('Stored OpenID not found.')); + $this->serverError(_('Stored OpenID not found.')); return; } @@ -214,7 +214,7 @@ class FinishopenidloginAction extends Action $other = oid_get_user($canonical); if ($other) { - common_server_error(_('Creating new account for OpenID that already has a user.')); + $this->serverError(_('Creating new account for OpenID that already has a user.')); return; } @@ -274,14 +274,14 @@ class FinishopenidloginAction extends Action list($display, $canonical, $sreg) = $this->get_saved_values(); if (!$display || !$canonical) { - common_server_error(_('Stored OpenID not found.')); + $this->serverError(_('Stored OpenID not found.')); return; } $result = oid_link_user($user->id, $canonical, $display); if (!$result) { - common_server_error(_('Error connecting user to OpenID.')); + $this->serverError(_('Error connecting user to OpenID.')); return; } diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php index cee3a1818..f9094a50c 100644 --- a/actions/finishremotesubscribe.php +++ b/actions/finishremotesubscribe.php @@ -30,14 +30,14 @@ class FinishremotesubscribeAction extends Action parent::handle($args); if (common_logged_in()) { - common_user_error(_('You can use the local subscription!')); + $this->clientError(_('You can use the local subscription!')); return; } $omb = $_SESSION['oauth_authorization_request']; if (!$omb) { - common_user_error(_('Not expecting this response!')); + $this->clientError(_('Not expecting this response!')); return; } @@ -51,38 +51,38 @@ class FinishremotesubscribeAction extends Action # I think this is the success metric if ($token != $omb['token']) { - common_user_error(_('Not authorized.')); + $this->clientError(_('Not authorized.')); return; } $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { - common_user_error(_('Unknown version of OMB protocol.')); + $this->clientError(_('Unknown version of OMB protocol.')); return; } $nickname = $req->get_parameter('omb_listener_nickname'); if (!$nickname) { - common_user_error(_('No nickname provided by remote server.')); + $this->clientError(_('No nickname provided by remote server.')); return; } $profile_url = $req->get_parameter('omb_listener_profile'); if (!$profile_url) { - common_user_error(_('No profile URL returned by server.')); + $this->clientError(_('No profile URL returned by server.')); return; } if (!Validate::uri($profile_url, array('allowed_schemes' => array('http', 'https')))) { - common_user_error(_('Invalid profile URL returned by server.')); + $this->clientError(_('Invalid profile URL returned by server.')); return; } if ($profile_url == common_local_url('showstream', array('nickname' => $nickname))) { - common_user_error(_('You can use the local subscription!')); + $this->clientError(_('You can use the local subscription!')); return; } @@ -91,14 +91,14 @@ class FinishremotesubscribeAction extends Action $user = User::staticGet('nickname', $omb['listenee']); if (!$user) { - common_user_error(_('User being listened to doesn\'t exist.')); + $this->clientError(_('User being listened to doesn\'t exist.')); return; } $other = User::staticGet('uri', $omb['listener']); if ($other) { - common_user_error(_('You can use the local subscription!')); + $this->clientError(_('You can use the local subscription!')); return; } @@ -111,7 +111,7 @@ class FinishremotesubscribeAction extends Action list($newtok, $newsecret) = $this->access_token($omb); if (!$newtok || !$newsecret) { - common_user_error(_('Couldn\'t convert request tokens to access tokens.')); + $this->clientError(_('Couldn\'t convert request tokens to access tokens.')); return; } @@ -155,7 +155,7 @@ class FinishremotesubscribeAction extends Action $profile->created = DB_DataObject_Cast::dateTime(); # current time $id = $profile->insert(); if (!$id) { - common_server_error(_('Error inserting new profile')); + $this->serverError(_('Error inserting new profile')); return; } $remote->id = $id; @@ -163,7 +163,7 @@ class FinishremotesubscribeAction extends Action if ($avatar_url) { if (!$this->add_avatar($profile, $avatar_url)) { - common_server_error(_('Error inserting avatar')); + $this->serverError(_('Error inserting avatar')); return; } } @@ -173,19 +173,19 @@ class FinishremotesubscribeAction extends Action if ($exists) { if (!$remote->update($orig_remote)) { - common_server_error(_('Error updating remote profile')); + $this->serverError(_('Error updating remote profile')); return; } } else { $remote->created = DB_DataObject_Cast::dateTime(); # current time if (!$remote->insert()) { - common_server_error(_('Error inserting remote profile')); + $this->serverError(_('Error inserting remote profile')); return; } } if ($user->hasBlocked($profile)) { - $this->client_error(_('That user has blocked you from subscribing.')); + $this->clientError(_('That user has blocked you from subscribing.')); return; } @@ -215,7 +215,7 @@ class FinishremotesubscribeAction extends Action if (!$result) { common_log_db_error($sub, ($sub_exists) ? 'UPDATE' : 'INSERT', __FILE__); - common_user_error(_('Couldn\'t insert new subscription.')); + $this->clientError(_('Couldn\'t insert new subscription.')); return; } diff --git a/actions/foaf.php b/actions/foaf.php index 6f73ce505..a0f8a1ff3 100644 --- a/actions/foaf.php +++ b/actions/foaf.php @@ -40,14 +40,14 @@ class FoafAction extends Action $user = User::staticGet('nickname', $nickname); if (!$user) { - common_user_error(_('No such user.'), 404); + $this->clientError(_('No such user.'), 404); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.'), 500); + $this->serverError(_('User has no profile.'), 500); return; } diff --git a/actions/imsettings.php b/actions/imsettings.php index 693f49efa..14df3451a 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -149,7 +149,7 @@ class ImsettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } @@ -199,7 +199,7 @@ class ImsettingsAction extends SettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); - common_server_error(_('Couldn\'t insert confirmation code.')); + $this->serverError(_('Couldn\'t insert confirmation code.')); return; } @@ -231,7 +231,7 @@ class ImsettingsAction extends SettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - $this->server_error(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Couldn\'t delete email confirmation.')); return; } @@ -257,7 +257,7 @@ class ImsettingsAction extends SettingsAction $result = $user->updateKeys($original); if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } $user->query('COMMIT'); diff --git a/actions/invite.php b/actions/invite.php index 15233602e..879264deb 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -31,7 +31,7 @@ class InviteAction extends Action { parent::handle($args); if (!common_logged_in()) { - $this->client_error(sprintf(_('You must be logged in to invite other users to use %s'), + $this->clientError(sprintf(_('You must be logged in to invite other users to use %s'), common_config('site', 'name'))); return; } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { diff --git a/actions/login.php b/actions/login.php index fd98e656d..060d16ad6 100644 --- a/actions/login.php +++ b/actions/login.php @@ -31,7 +31,7 @@ class LoginAction extends Action { parent::handle($args); if (common_is_real_login()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->check_login(); } else { @@ -46,7 +46,7 @@ class LoginAction extends Action # CSRF protection - token set in common_notice_form() $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } @@ -55,7 +55,7 @@ class LoginAction extends Action if (common_check_user($nickname, $password)) { # success! if (!common_set_user($nickname)) { - common_server_error(_('Error setting user.')); + $this->serverError(_('Error setting user.')); return; } common_real_login(true); @@ -81,7 +81,7 @@ class LoginAction extends Action # success! if (!common_set_user($user)) { - common_server_error(_('Error setting user.')); + $this->serverError(_('Error setting user.')); return; } diff --git a/actions/logout.php b/actions/logout.php index 201378730..3001f3613 100644 --- a/actions/logout.php +++ b/actions/logout.php @@ -33,7 +33,7 @@ class LogoutAction extends Action { parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); } else { common_set_user(null); common_real_login(false); # not logged in diff --git a/actions/microsummary.php b/actions/microsummary.php index 13ddc4e3e..b46c5bee5 100644 --- a/actions/microsummary.php +++ b/actions/microsummary.php @@ -31,14 +31,14 @@ class MicrosummaryAction extends Action $user = User::staticGet('nickname', $nickname); if (!$user) { - $this->client_error(_('No such user'), 404); + $this->clientError(_('No such user'), 404); return; } $notice = $user->getCurrentNotice(); if (!$notice) { - $this->client_error(_('No current status'), 404); + $this->clientError(_('No current status'), 404); } header('Content-Type: text/plain'); diff --git a/actions/newmessage.php b/actions/newmessage.php index 6221b67e9..510a5f8f3 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -27,7 +27,7 @@ class NewmessageAction extends Action parent::handle($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.'), 403); + $this->clientError(_('Not logged in.'), 403); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->save_new_message(); } else { @@ -71,10 +71,10 @@ class NewmessageAction extends Action $this->show_form(_('No recipient specified.')); return; } else if (!$user->mutuallySubscribed($other)) { - $this->client_error(_('You can\'t send a message to this user.'), 404); + $this->clientError(_('You can\'t send a message to this user.'), 404); return; } else if ($user->id == $other->id) { - $this->client_error(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), 403); + $this->clientError(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), 403); return; } @@ -113,12 +113,12 @@ class NewmessageAction extends Action $other = User::staticGet('id', $to); if (!$other) { - $this->client_error(_('No such user'), 404); + $this->clientError(_('No such user'), 404); return; } if (!$user->mutuallySubscribed($other)) { - $this->client_error(_('You can\'t send a message to this user.'), 404); + $this->clientError(_('You can\'t send a message to this user.'), 404); return; } diff --git a/actions/newnotice.php b/actions/newnotice.php index 89792d95a..cb02854a1 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -29,13 +29,13 @@ class NewnoticeAction extends Action parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { # CSRF protection - token set in common_notice_form() $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } diff --git a/actions/noticesearch.php b/actions/noticesearch.php index d998b9da8..336e39bd3 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -97,7 +97,7 @@ class NoticesearchAction extends SearchAction $profile = $notice->getProfile(); if (!$profile) { common_log_db_error($notice, 'SELECT', __FILE__); - $this->server_error(_('Notice without matching profile')); + $this->serverError(_('Notice without matching profile')); return; } # XXX: RDFa diff --git a/actions/nudge.php b/actions/nudge.php index de930e462..49223d431 100644 --- a/actions/nudge.php +++ b/actions/nudge.php @@ -29,7 +29,7 @@ class NudgeAction extends Action parent::handle($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -46,12 +46,12 @@ class NudgeAction extends Action $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } if (!$other->email || !$other->emailnotifynudge) { - $this->client_error(_('This user doesn\'t allow nudges or hasn\'t confirmed or set his email yet.')); + $this->clientError(_('This user doesn\'t allow nudges or hasn\'t confirmed or set his email yet.')); return; } diff --git a/actions/openidlogin.php b/actions/openidlogin.php index 82791af34..d1989e0de 100644 --- a/actions/openidlogin.php +++ b/actions/openidlogin.php @@ -28,7 +28,7 @@ class OpenidloginAction extends Action { parent::handle($args); if (common_logged_in()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $openid_url = $this->trimmed('openid_url'); diff --git a/actions/othersettings.php b/actions/othersettings.php index 97cbd0094..51f6f8197 100644 --- a/actions/othersettings.php +++ b/actions/othersettings.php @@ -177,7 +177,7 @@ class OthersettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } diff --git a/actions/peopletag.php b/actions/peopletag.php index 2680638d7..7bcfcb93e 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -32,7 +32,7 @@ class PeopletagAction extends Action $tag = $this->trimmed('tag'); if (!common_valid_profile_tag($tag)) { - $this->client_error(sprintf(_('Not a valid people tag: %s'), $tag)); + $this->clientError(sprintf(_('Not a valid people tag: %s'), $tag)); return; } diff --git a/actions/postnotice.php b/actions/postnotice.php index dec62a678..0b4735296 100644 --- a/actions/postnotice.php +++ b/actions/postnotice.php @@ -36,7 +36,7 @@ class PostnoticeAction extends Action print "omb_version=".OMB_VERSION_01; } } catch (OAuthException $e) { - common_server_error($e->getMessage()); + $this->serverError($e->getMessage()); return; } } @@ -45,36 +45,36 @@ class PostnoticeAction extends Action { $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { - common_user_error(_('Unsupported OMB version'), 400); + $this->clientError(_('Unsupported OMB version'), 400); return false; } # First, check to see $listenee = $req->get_parameter('omb_listenee'); $remote_profile = Remote_profile::staticGet('uri', $listenee); if (!$remote_profile) { - common_user_error(_('Profile unknown'), 403); + $this->clientError(_('Profile unknown'), 403); return false; } $sub = Subscription::staticGet('token', $token->key); if (!$sub) { - common_user_error(_('No such subscription'), 403); + $this->clientError(_('No such subscription'), 403); return false; } $content = $req->get_parameter('omb_notice_content'); $content_shortened = common_shorten_links($content); if (mb_strlen($content_shortened) > 140) { - common_user_error(_('Invalid notice content'), 400); + $this->clientError(_('Invalid notice content'), 400); return false; } $notice_uri = $req->get_parameter('omb_notice'); if (!Validate::uri($notice_uri) && !common_valid_tag($notice_uri)) { - common_user_error(_('Invalid notice uri'), 400); + $this->clientError(_('Invalid notice uri'), 400); return false; } $notice_url = $req->get_parameter('omb_notice_url'); if ($notice_url && !common_valid_http_url($notice_url)) { - common_user_error(_('Invalid notice url'), 400); + $this->clientError(_('Invalid notice url'), 400); return false; } $notice = Notice::staticGet('uri', $notice_uri); diff --git a/actions/profilesettings.php b/actions/profilesettings.php index ef45fc1d9..6ad3f2ef5 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -125,7 +125,7 @@ class ProfilesettingsAction extends SettingsAction if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->server_error(_('User without matching profile')); + $this->serverError(_('User without matching profile')); return; } @@ -298,7 +298,7 @@ class ProfilesettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } else { # Re-initialize language environment if it changed @@ -318,7 +318,7 @@ class ProfilesettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user for autosubscribe.')); + $this->serverError(_('Couldn\'t update user for autosubscribe.')); return; } } @@ -341,7 +341,7 @@ class ProfilesettingsAction extends SettingsAction if (!$result) { common_log_db_error($profile, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t save profile.')); + $this->serverError(_('Couldn\'t save profile.')); return; } @@ -350,7 +350,7 @@ class ProfilesettingsAction extends SettingsAction $result = $user->setSelfTags($tags); if (!$result) { - common_server_error(_('Couldn\'t save tags.')); + $this->serverError(_('Couldn\'t save tags.')); return; } @@ -475,7 +475,7 @@ class ProfilesettingsAction extends SettingsAction } if (!$user->update($original)) { - common_server_error(_('Can\'t save new password.')); + $this->serverError(_('Can\'t save new password.')); return; } diff --git a/actions/public.php b/actions/public.php index 62071eccc..0ceeef98e 100644 --- a/actions/public.php +++ b/actions/public.php @@ -165,7 +165,7 @@ class PublicAction extends Action NOTICES_PER_PAGE + 1); if (!$notice) { - $this->server_error(_('Could not retrieve public stream.')); + $this->serverError(_('Could not retrieve public stream.')); return; } diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php index 3e6ecfb1f..3d839e751 100644 --- a/actions/recoverpassword.php +++ b/actions/recoverpassword.php @@ -30,7 +30,7 @@ class RecoverpasswordAction extends Action { parent::handle($args); if (common_logged_in()) { - $this->client_error(_('You are already logged in!')); + $this->clientError(_('You are already logged in!')); return; } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($this->arg('recover')) { @@ -38,7 +38,7 @@ class RecoverpasswordAction extends Action } else if ($this->arg('reset')) { $this->reset_password(); } else { - $this->client_error(_('Unexpected form submission.')); + $this->clientError(_('Unexpected form submission.')); } } else { if ($this->trimmed('code')) { @@ -56,18 +56,18 @@ class RecoverpasswordAction extends Action $confirm = Confirm_address::staticGet('code', $code); if (!$confirm) { - $this->client_error(_('No such recovery code.')); + $this->clientError(_('No such recovery code.')); return; } if ($confirm->address_type != 'recover') { - $this->client_error(_('Not a recovery code.')); + $this->clientError(_('Not a recovery code.')); return; } $user = User::staticGet($confirm->user_id); if (!$user) { - $this->server_error(_('Recovery code for unknown user.')); + $this->serverError(_('Recovery code for unknown user.')); return; } @@ -80,7 +80,7 @@ class RecoverpasswordAction extends Action if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - common_server_error(_('Error with confirmation code.')); + $this->serverError(_('Error with confirmation code.')); return; } @@ -91,7 +91,7 @@ class RecoverpasswordAction extends Action common_log(LOG_WARNING, 'Attempted redemption on recovery code ' . 'that is ' . $touched . ' seconds old. '); - $this->client_error(_('This confirmation code is too old. ' . + $this->clientError(_('This confirmation code is too old. ' . 'Please start again.')); return; } @@ -105,7 +105,7 @@ class RecoverpasswordAction extends Action $result = $user->updateKeys($orig); if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); - $this->server_error(_('Could not update user with confirmed email address.')); + $this->serverError(_('Could not update user with confirmed email address.')); return; } } @@ -240,7 +240,7 @@ class RecoverpasswordAction extends Action } if (!$user->email && !$confirm_email) { - $this->client_error(_('No registered email address for that user.')); + $this->clientError(_('No registered email address for that user.')); return; } @@ -254,7 +254,7 @@ class RecoverpasswordAction extends Action if (!$confirm->insert()) { common_log_db_error($confirm, 'INSERT', __FILE__); - $this->server_error(_('Error saving address confirmation.')); + $this->serverError(_('Error saving address confirmation.')); return; } @@ -298,7 +298,7 @@ class RecoverpasswordAction extends Action $user = $this->get_temp_user(); if (!$user) { - $this->client_error(_('Unexpected password reset.')); + $this->clientError(_('Unexpected password reset.')); return; } @@ -322,14 +322,14 @@ class RecoverpasswordAction extends Action if (!$user->update($original)) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Can\'t save new password.')); + $this->serverError(_('Can\'t save new password.')); return; } $this->clear_temp_user(); if (!common_set_user($user->nickname)) { - common_server_error(_('Error setting user.')); + $this->serverError(_('Error setting user.')); return; } diff --git a/actions/register.php b/actions/register.php index bac179687..b4d0d43fb 100644 --- a/actions/register.php +++ b/actions/register.php @@ -26,9 +26,9 @@ class RegisterAction extends Action parent::handle($args); if (common_config('site', 'closed')) { - common_user_error(_('Registration not allowed.')); + $this->clientError(_('Registration not allowed.')); } else if (common_logged_in()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->try_register(); } else { @@ -65,7 +65,7 @@ class RegisterAction extends Action } if (common_config('site', 'inviteonly') && !($code && $invite)) { - $this->client_error(_('Sorry, only invited people can register.')); + $this->clientError(_('Sorry, only invited people can register.')); return; } @@ -115,7 +115,7 @@ class RegisterAction extends Action } # success! if (!common_set_user($user)) { - common_server_error(_('Error setting user.')); + $this->serverError(_('Error setting user.')); return; } # this is a real login @@ -179,7 +179,7 @@ class RegisterAction extends Action } if (common_config('site', 'inviteonly') && !($code && $invite)) { - $this->client_error(_('Sorry, only invited people can register.')); + $this->clientError(_('Sorry, only invited people can register.')); return; } diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php index b9e29d645..32e9bf3d3 100644 --- a/actions/remotesubscribe.php +++ b/actions/remotesubscribe.php @@ -30,7 +30,7 @@ class RemotesubscribeAction extends Action parent::handle($args); if (common_logged_in()) { - common_user_error(_('You can use the local subscription!')); + $this->clientError(_('You can use the local subscription!')); return; } @@ -342,7 +342,7 @@ class RemotesubscribeAction extends Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->server_error(_('User without matching profile')); + $this->serverError(_('User without matching profile')); return; } diff --git a/actions/replies.php b/actions/replies.php index 878550888..84fd894ff 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -40,7 +40,7 @@ class RepliesAction extends StreamAction $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -57,7 +57,7 @@ class RepliesAction extends StreamAction function no_such_user() { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); } function show_header($user) diff --git a/actions/repliesrss.php b/actions/repliesrss.php index 5f85f8d2e..43be133a4 100644 --- a/actions/repliesrss.php +++ b/actions/repliesrss.php @@ -34,7 +34,7 @@ class RepliesrssAction extends Rss10Action $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return false; } else { return true; diff --git a/actions/requesttoken.php b/actions/requesttoken.php index a74548739..378db4403 100644 --- a/actions/requesttoken.php +++ b/actions/requesttoken.php @@ -39,7 +39,7 @@ class RequesttokenAction extends Action $token = $server->fetch_request_token($req); print $token; } catch (OAuthException $e) { - common_server_error($e->getMessage()); + $this->serverError($e->getMessage()); } } } diff --git a/actions/showfavorites.php b/actions/showfavorites.php index 1dec3ba5b..caa823893 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -33,14 +33,14 @@ class ShowfavoritesAction extends StreamAction $user = User::staticGet('nickname', $nickname); if (!$user) { - $this->client_error(_('No such user.')); + $this->clientError(_('No such user.')); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -90,7 +90,7 @@ class ShowfavoritesAction extends StreamAction $notice = $user->favoriteNotices(($page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); if (!$notice) { - $this->server_error(_('Could not retrieve favorite notices.')); + $this->serverError(_('Could not retrieve favorite notices.')); return; } diff --git a/actions/showmessage.php b/actions/showmessage.php index 25330a568..d13e9f671 100644 --- a/actions/showmessage.php +++ b/actions/showmessage.php @@ -32,7 +32,7 @@ class ShowmessageAction extends MailboxAction $message = $this->get_message(); if (!$message) { - $this->client_error(_('No such message.'), 404); + $this->clientError(_('No such message.'), 404); return; } @@ -41,7 +41,7 @@ class ShowmessageAction extends MailboxAction if ($cur && ($cur->id == $message->from_profile || $cur->id == $message->to_profile)) { $this->show_page($cur, 1); } else { - $this->client_error(_('Only the sender and recipient may read this message.'), 403); + $this->clientError(_('Only the sender and recipient may read this message.'), 403); return; } } diff --git a/actions/shownotice.php b/actions/shownotice.php index c519af0ba..82d4bd270 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -37,14 +37,14 @@ class ShownoticeAction extends StreamAction $this->notice = Notice::staticGet($id); if (!$this->notice) { - $this->client_error(_('No such notice.'), 404); + $this->clientError(_('No such notice.'), 404); return false; } $this->profile = $this->notice->getProfile(); if (!$this->profile) { - $this->server_error(_('Notice has no profile'), 500); + $this->serverError(_('Notice has no profile'), 500); return false; } @@ -119,6 +119,6 @@ class ShownoticeAction extends StreamAction function no_such_notice() { - common_user_error(_('No such notice.')); + $this->clientError(_('No such notice.')); } } diff --git a/actions/showstream.php b/actions/showstream.php index 9a59f7ae4..ed38c67f9 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -56,7 +56,7 @@ class ShowstreamAction extends StreamAction $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -159,7 +159,7 @@ class ShowstreamAction extends StreamAction function no_such_user() { - $this->client_error(_('No such user.'), 404); + $this->clientError(_('No such user.'), 404); } function show_profile($profile) diff --git a/actions/smssettings.php b/actions/smssettings.php index 1be45d1ce..c5879e4d9 100644 --- a/actions/smssettings.php +++ b/actions/smssettings.php @@ -168,7 +168,7 @@ class SmssettingsAction extends EmailsettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } @@ -218,7 +218,7 @@ class SmssettingsAction extends EmailsettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); - common_server_error(_('Couldn\'t insert confirmation code.')); + $this->serverError(_('Couldn\'t insert confirmation code.')); return; } @@ -254,7 +254,7 @@ class SmssettingsAction extends EmailsettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - $this->server_error(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Couldn\'t delete email confirmation.')); return; } @@ -283,7 +283,7 @@ class SmssettingsAction extends EmailsettingsAction $result = $user->updateKeys($original); if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } $user->query('COMMIT'); diff --git a/actions/subedit.php b/actions/subedit.php index 1142b7a03..e22384869 100644 --- a/actions/subedit.php +++ b/actions/subedit.php @@ -30,28 +30,28 @@ class SubeditAction extends Action parent::prepare($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return false; } $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $id = $this->trimmed('profile'); if (!$id) { - $this->client_error(_('No profile specified.')); + $this->clientError(_('No profile specified.')); return false; } $this->profile = Profile::staticGet('id', $id); if (!$this->profile) { - $this->client_error(_('No profile with that ID.')); + $this->clientError(_('No profile with that ID.')); return false; } @@ -68,7 +68,7 @@ class SubeditAction extends Action 'subscribed' => $this->profile->id)); if (!$sub) { - $this->client_error(_('You are not subscribed to that profile.')); + $this->clientError(_('You are not subscribed to that profile.')); return false; } @@ -81,7 +81,7 @@ class SubeditAction extends Action if (!$result) { common_log_db_error($sub, 'UPDATE', __FILE__); - $this->server_error(_('Could not save subscription.')); + $this->serverError(_('Could not save subscription.')); return false; } diff --git a/actions/subscribe.php b/actions/subscribe.php index 99f9acc24..b6f03f0f1 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -27,7 +27,7 @@ class SubscribeAction extends Action parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -43,7 +43,7 @@ class SubscribeAction extends Action $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } @@ -52,14 +52,14 @@ class SubscribeAction extends Action $other = User::staticGet('id', $other_id); if (!$other) { - $this->client_error(_('Not a local user.')); + $this->clientError(_('Not a local user.')); return; } $result = subs_subscribe_to($user, $other); if($result != true) { - common_user_error($result); + $this->clientError($result); return; } diff --git a/actions/tagother.php b/actions/tagother.php index f0105ec8b..e11e3a00d 100644 --- a/actions/tagother.php +++ b/actions/tagother.php @@ -30,7 +30,7 @@ class TagotherAction extends Action parent::handle($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in'), 403); + $this->clientError(_('Not logged in'), 403); return; } @@ -39,12 +39,12 @@ class TagotherAction extends Action } else { $id = $this->trimmed('id'); if (!$id) { - $this->client_error(_('No id argument.')); + $this->clientError(_('No id argument.')); return; } $profile = Profile::staticGet('id', $id); if (!$profile) { - $this->client_error(_('No profile with that ID.')); + $this->clientError(_('No profile with that ID.')); return; } $this->show_form($profile); @@ -121,7 +121,7 @@ class TagotherAction extends Action $profile = Profile::staticGet('id', $id); if (!$profile) { - $this->client_error(_('No such profile.')); + $this->clientError(_('No such profile.')); return; } @@ -147,14 +147,14 @@ class TagotherAction extends Action !Subscription::pkeyGet(array('subscriber' => $profile->id, 'subscribed' => $user->id))) { - $this->client_error(_('You can only tag people you are subscribed to or who are subscribed to you.')); + $this->clientError(_('You can only tag people you are subscribed to or who are subscribed to you.')); return; } $result = Profile_tag::setTags($user->id, $profile->id, $tags); if (!$result) { - $this->client_error(_('Could not save tags.')); + $this->clientError(_('Could not save tags.')); return; } diff --git a/actions/tagrss.php b/actions/tagrss.php index 912d71413..b0227ab39 100644 --- a/actions/tagrss.php +++ b/actions/tagrss.php @@ -32,7 +32,7 @@ class TagrssAction extends Rss10Action $this->tag = Notice_tag::staticGet('tag', $tag); if (!$this->tag) { - common_user_error(_('No such tag.')); + $this->clientError(_('No such tag.')); return false; } else { return true; diff --git a/actions/twitapiaccount.php b/actions/twitapiaccount.php index 79e1ed990..e51a29a2d 100644 --- a/actions/twitapiaccount.php +++ b/actions/twitapiaccount.php @@ -29,7 +29,7 @@ class TwitapiaccountAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -39,7 +39,7 @@ class TwitapiaccountAction extends TwitterapiAction function end_session($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function update_location($args, $apidata) @@ -47,7 +47,7 @@ class TwitapiaccountAction extends TwitterapiAction parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']); return; } @@ -56,7 +56,7 @@ class TwitapiaccountAction extends TwitterapiAction if (!is_null($location) && strlen($location) > 255) { // XXX: But Twitter just truncates and runs with it. -- Zach - $this->client_error(_('That\'s too long. Max notice size is 255 chars.'), 406, $apidate['content-type']); + $this->clientError(_('That\'s too long. Max notice size is 255 chars.'), 406, $apidate['content-type']); return; } @@ -64,7 +64,7 @@ class TwitapiaccountAction extends TwitterapiAction $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -75,7 +75,7 @@ class TwitapiaccountAction extends TwitterapiAction if (!$result) { common_log_db_error($profile, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t save profile.')); + $this->serverError(_('Couldn\'t save profile.')); return; } @@ -91,12 +91,12 @@ class TwitapiaccountAction extends TwitterapiAction function update_delivery_device($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function rate_limit_status($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } } \ No newline at end of file diff --git a/actions/twitapiblocks.php b/actions/twitapiblocks.php index 5d64f2f7d..8135adef3 100644 --- a/actions/twitapiblocks.php +++ b/actions/twitapiblocks.php @@ -32,7 +32,7 @@ class TwitapiblocksAction extends TwitterapiAction $blockee = $this->get_user($apidata['api_arg'], $apidata); if (!$blockee) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } @@ -44,7 +44,7 @@ class TwitapiblocksAction extends TwitterapiAction $this->show_profile($blockee, $type); $this->end_document($type); } else { - common_server_error(_('Block user failed.')); + $this->serverError(_('Block user failed.')); } } @@ -54,7 +54,7 @@ class TwitapiblocksAction extends TwitterapiAction $blockee = $this->get_user($apidata['api_arg'], $apidata); if (!$blockee) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } @@ -66,7 +66,7 @@ class TwitapiblocksAction extends TwitterapiAction $this->show_profile($blockee, $type); $this->end_document($type); } else { - common_server_error(_('Unblock user failed.')); + $this->serverError(_('Unblock user failed.')); } } } \ No newline at end of file diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php index 36d2a7e09..db55e8cd0 100644 --- a/actions/twitapidirect_messages.php +++ b/actions/twitapidirect_messages.php @@ -108,7 +108,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction $this->show_json_dmsgs($message); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -119,7 +119,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']); return; } @@ -134,11 +134,11 @@ class Twitapidirect_messagesAction extends TwitterapiAction $content = $this->trimmed('text'); if (!$content) { - $this->client_error(_('No message text!'), $code = 406, $apidata['content-type']); + $this->clientError(_('No message text!'), $code = 406, $apidata['content-type']); } else { $content_shortened = common_shorten_links($content); if (mb_strlen($content_shortened) > 140) { - $this->client_error(_('That\'s too long. Max message size is 140 chars.'), + $this->clientError(_('That\'s too long. Max message size is 140 chars.'), $code = 406, $apidata['content-type']); return; } @@ -147,15 +147,15 @@ class Twitapidirect_messagesAction extends TwitterapiAction $other = $this->get_user($this->trimmed('user')); if (!$other) { - $this->client_error(_('Recipient user not found.'), $code = 403, $apidata['content-type']); + $this->clientError(_('Recipient user not found.'), $code = 403, $apidata['content-type']); return; } else if (!$user->mutuallySubscribed($other)) { - $this->client_error(_('Can\'t send direct messages to users who aren\'t your friend.'), + $this->clientError(_('Can\'t send direct messages to users who aren\'t your friend.'), $code = 403, $apidata['content-type']); return; } else if ($user->id == $other->id) { // Sending msgs to yourself is allowed by Twitter - $this->client_error(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), + $this->clientError(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), $code = 403, $apidata['content-type']); return; } @@ -164,7 +164,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction html_entity_decode($content, ENT_NOQUOTES, 'UTF-8'), $source); if (is_string($message)) { - $this->server_error($message); + $this->serverError($message); return; } @@ -181,7 +181,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction function destroy($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function show_xml_dmsgs($message) diff --git a/actions/twitapifavorites.php b/actions/twitapifavorites.php index 55e04732f..737b7229f 100644 --- a/actions/twitapifavorites.php +++ b/actions/twitapifavorites.php @@ -32,14 +32,14 @@ class TwitapifavoritesAction extends TwitterapiAction $user = $this->get_user($apidata['api_arg'], $apidata); if (!$user) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -56,7 +56,7 @@ class TwitapifavoritesAction extends TwitterapiAction $notice = $user->favoriteNotices((($page-1)*20), $count); if (!$notice) { - common_server_error(_('Could not retrieve favorite notices.')); + $this->serverError(_('Could not retrieve favorite notices.')); return; } @@ -82,7 +82,7 @@ class TwitapifavoritesAction extends TwitterapiAction $this->show_json_timeline($notice); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -94,12 +94,12 @@ class TwitapifavoritesAction extends TwitterapiAction // Check for RESTfulness if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { // XXX: Twitter just prints the err msg, no XML / JSON. - $this->client_error(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); return; } if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -109,20 +109,20 @@ class TwitapifavoritesAction extends TwitterapiAction $notice = Notice::staticGet($notice_id); if (!$notice) { - $this->client_error(_('No status found with that ID.'), 404, $apidata['content-type']); + $this->clientError(_('No status found with that ID.'), 404, $apidata['content-type']); return; } // XXX: Twitter lets you fave things repeatedly via api. if ($user->hasFave($notice)) { - $this->client_error(_('This notice is already a favorite!'), 403, $apidata['content-type']); + $this->clientError(_('This notice is already a favorite!'), 403, $apidata['content-type']); return; } $fave = Fave::addNew($user, $notice); if (!$fave) { - common_server_error(_('Could not create favorite.')); + $this->serverError(_('Could not create favorite.')); return; } @@ -140,7 +140,7 @@ class TwitapifavoritesAction extends TwitterapiAction function destroy($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } // XXX: these two funcs swiped from faves. Maybe put in util.php, or some common base class? diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index 458ff48a5..c50c5e84a 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -29,7 +29,7 @@ class TwitapifriendshipsAction extends TwitterapiAction parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']); return; } @@ -38,7 +38,7 @@ class TwitapifriendshipsAction extends TwitterapiAction $other = $this->get_user($id); if (!$other) { - $this->client_error(_('Could not follow user: User not found.'), 403, $apidata['content-type']); + $this->clientError(_('Could not follow user: User not found.'), 403, $apidata['content-type']); return; } @@ -46,7 +46,7 @@ class TwitapifriendshipsAction extends TwitterapiAction if ($user->isSubscribed($other)) { $errmsg = sprintf(_('Could not follow user: %s is already on your list.'), $other->nickname); - $this->client_error($errmsg, 403, $apidata['content-type']); + $this->clientError($errmsg, 403, $apidata['content-type']); return; } @@ -62,7 +62,7 @@ class TwitapifriendshipsAction extends TwitterapiAction if (!$result) { $errmsg = sprintf(_('Could not follow user: %s is already on your list.'), $other->nickname); - $this->client_error($errmsg, 400, $apidata['content-type']); + $this->clientError($errmsg, 400, $apidata['content-type']); return; } @@ -82,7 +82,7 @@ class TwitapifriendshipsAction extends TwitterapiAction parent::handle($args); if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { - $this->client_error(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); return; } @@ -102,7 +102,7 @@ class TwitapifriendshipsAction extends TwitterapiAction $sub->delete(); $sub->query('COMMIT'); } else { - $this->client_error(_('You are not friends with the specified user.'), 403, $apidata['content-type']); + $this->clientError(_('You are not friends with the specified user.'), 403, $apidata['content-type']); return; } @@ -118,7 +118,7 @@ class TwitapifriendshipsAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -129,7 +129,7 @@ class TwitapifriendshipsAction extends TwitterapiAction $user_b = $this->get_user($user_b_id); if (!$user_a || !$user_b) { - $this->client_error(_('Two user ids or screen_names must be supplied.'), 400, $apidata['content-type']); + $this->clientError(_('Two user ids or screen_names must be supplied.'), 400, $apidata['content-type']); return; } diff --git a/actions/twitapihelp.php b/actions/twitapihelp.php index 531c6e9d3..db5892baf 100644 --- a/actions/twitapihelp.php +++ b/actions/twitapihelp.php @@ -41,7 +41,7 @@ class TwitapihelpAction extends TwitterapiAction print '"ok"'; $this->end_document('json'); } else { - common_user_error(_('API method not found!'), $code=404); + $this->clientError(_('API method not found!'), $code=404); } } @@ -49,7 +49,7 @@ class TwitapihelpAction extends TwitterapiAction function downtime_schedule($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } } \ No newline at end of file diff --git a/actions/twitapilaconica.php b/actions/twitapilaconica.php index 34c8f88fc..8cd7a64b9 100644 --- a/actions/twitapilaconica.php +++ b/actions/twitapilaconica.php @@ -79,7 +79,7 @@ class TwitapilaconicaAction extends TwitterapiAction $this->end_document('json'); break; default: - $this->client_error(_('API method not found!'), $code=404); + $this->clientError(_('API method not found!'), $code=404); } } @@ -148,7 +148,7 @@ class TwitapilaconicaAction extends TwitterapiAction $this->end_document('json'); break; default: - $this->client_error(_('API method not found!'), $code=404); + $this->clientError(_('API method not found!'), $code=404); } } @@ -169,6 +169,6 @@ class TwitapilaconicaAction extends TwitterapiAction function wadl($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), 501); + $this->serverError(_('API method under construction.'), 501); } } diff --git a/actions/twitapinotifications.php b/actions/twitapinotifications.php index a19d652c3..411971af1 100644 --- a/actions/twitapinotifications.php +++ b/actions/twitapinotifications.php @@ -28,13 +28,13 @@ class TwitapinotificationsAction extends TwitterapiAction function follow($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function leave($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } } \ No newline at end of file diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index 8d175ecab..a35f4b12e 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -76,12 +76,12 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_json_timeline($notice); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); break; } } else { - common_server_error(_('Couldn\'t find any statuses.'), $code = 503); + $this->serverError(_('Couldn\'t find any statuses.'), $code = 503); } } @@ -144,7 +144,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_json_timeline($notice); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -157,14 +157,14 @@ class TwitapistatusesAction extends TwitterapiAction $user = $this->get_user($apidata['api_arg'], $apidata); if (!$user) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -225,7 +225,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_json_timeline($notice); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -236,12 +236,12 @@ class TwitapistatusesAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']); return; } @@ -273,7 +273,7 @@ class TwitapistatusesAction extends TwitterapiAction // as "truncated." Sending this error may screw up some clients // that assume Twitter will truncate for them. Should we just // truncate too? -- Zach - $this->client_error(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']); + $this->clientError(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']); return; } @@ -306,7 +306,7 @@ class TwitapistatusesAction extends TwitterapiAction if ($reply) { $reply_to = $in_reply_to_status_id; } else { - $this->client_error(_('Not found'), $code = 404, $apidata['content-type']); + $this->clientError(_('Not found'), $code = 404, $apidata['content-type']); return; } } @@ -315,7 +315,7 @@ class TwitapistatusesAction extends TwitterapiAction $source, 1, $reply_to); if (is_string($notice)) { - $this->server_error($notice); + $this->serverError($notice); return; } @@ -389,7 +389,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_json_timeline($notices); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -399,7 +399,7 @@ class TwitapistatusesAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -415,7 +415,7 @@ class TwitapistatusesAction extends TwitterapiAction } } else { // XXX: Twitter just sets a 404 header and doens't bother to return an err msg - $this->client_error(_('No status with that ID found.'), 404, $apidata['content-type']); + $this->clientError(_('No status with that ID found.'), 404, $apidata['content-type']); } } @@ -426,14 +426,14 @@ class TwitapistatusesAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } // Check for RESTfulness if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { // XXX: Twitter just prints the err msg, no XML / JSON. - $this->client_error(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); return; } @@ -443,7 +443,7 @@ class TwitapistatusesAction extends TwitterapiAction $notice = Notice::staticGet($notice_id); if (!$notice) { - $this->client_error(_('No status found with that ID.'), 404, $apidata['content-type']); + $this->clientError(_('No status found with that ID.'), 404, $apidata['content-type']); return; } @@ -460,7 +460,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_single_json_status($notice); } } else { - $this->client_error(_('You may not delete another user\'s status.'), 403, $apidata['content-type']); + $this->clientError(_('You may not delete another user\'s status.'), 403, $apidata['content-type']); } } @@ -487,7 +487,7 @@ class TwitapistatusesAction extends TwitterapiAction $user = $this->get_user($apidata['api_arg'], $apidata); if (!$user) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } @@ -500,7 +500,7 @@ class TwitapistatusesAction extends TwitterapiAction $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -552,14 +552,14 @@ class TwitapistatusesAction extends TwitterapiAction print json_encode($arrays); break; default: - $this->client_error(_('unsupported file type')); + $this->clientError(_('unsupported file type')); } } function featured($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function supported($cmd) diff --git a/actions/twitapiusers.php b/actions/twitapiusers.php index 409986985..ed2417561 100644 --- a/actions/twitapiusers.php +++ b/actions/twitapiusers.php @@ -29,7 +29,7 @@ class TwitapiusersAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -44,7 +44,7 @@ class TwitapiusersAction extends TwitterapiAction if (!$user) { // XXX: Twitter returns a random(?) user instead of throwing and err! -- Zach - $this->client_error(_('Not found.'), 404, $apidata['content-type']); + $this->clientError(_('Not found.'), 404, $apidata['content-type']); return; } diff --git a/actions/twittersettings.php b/actions/twittersettings.php index 663688037..9c879c965 100644 --- a/actions/twittersettings.php +++ b/actions/twittersettings.php @@ -285,7 +285,7 @@ class TwittersettingsAction extends SettingsAction if (!$result) { common_log_db_error($flink, 'DELETE', __FILE__); - common_server_error(_('Couldn\'t remove Twitter user.')); + $this->serverError(_('Couldn\'t remove Twitter user.')); return; } diff --git a/actions/unblock.php b/actions/unblock.php index 112304f71..59270f882 100644 --- a/actions/unblock.php +++ b/actions/unblock.php @@ -30,28 +30,28 @@ class UnblockAction extends Action parent::prepare($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return false; } $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $id = $this->trimmed('unblockto'); if (!$id) { - $this->client_error(_('No profile specified.')); + $this->clientError(_('No profile specified.')); return false; } $this->profile = Profile::staticGet('id', $id); if (!$this->profile) { - $this->client_error(_('No profile with that ID.')); + $this->clientError(_('No profile with that ID.')); return false; } @@ -74,7 +74,7 @@ class UnblockAction extends Action $result = $cur->unblock($this->profile); if (!$result) { - $this->server_error(_('Error removing the block.')); + $this->serverError(_('Error removing the block.')); return; } diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index 455c5e28e..32511a4b4 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -24,7 +24,7 @@ class UnsubscribeAction extends Action { parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -40,28 +40,28 @@ class UnsubscribeAction extends Action $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $other_id = $this->arg('unsubscribeto'); if (!$other_id) { - $this->client_error(_('No profile id in request.')); + $this->clientError(_('No profile id in request.')); return; } $other = Profile::staticGet('id', $other_id); if (!$other_id) { - $this->client_error(_('No profile with that id.')); + $this->clientError(_('No profile with that id.')); return; } $result = subs_unsubscribe_to($user, $other); if ($result != true) { - common_user_error($result); + $this->clientError($result); return; } diff --git a/actions/updateprofile.php b/actions/updateprofile.php index abb034c81..c79112dac 100644 --- a/actions/updateprofile.php +++ b/actions/updateprofile.php @@ -37,7 +37,7 @@ class UpdateprofileAction extends Action print "omb_version=".OMB_VERSION_01; } } catch (OAuthException $e) { - $this->server_error($e->getMessage()); + $this->serverError($e->getMessage()); return; } } @@ -46,14 +46,14 @@ class UpdateprofileAction extends Action { $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { - $this->client_error(_('Unsupported OMB version'), 400); + $this->clientError(_('Unsupported OMB version'), 400); return false; } # First, check to see if listenee exists $listenee = $req->get_parameter('omb_listenee'); $remote = Remote_profile::staticGet('uri', $listenee); if (!$remote) { - $this->client_error(_('Profile unknown'), 404); + $this->clientError(_('Profile unknown'), 404); return false; } # Second, check to see if they should be able to post updates! @@ -64,72 +64,72 @@ class UpdateprofileAction extends Action $sub->subscribed = $remote->id; $sub->token = $token->key; if (!$sub->find(true)) { - $this->client_error(_('You did not send us that profile'), 403); + $this->clientError(_('You did not send us that profile'), 403); return false; } $profile = Profile::staticGet('id', $remote->id); if (!$profile) { # This one is our fault - $this->server_error(_('Remote profile with no matching profile'), 500); + $this->serverError(_('Remote profile with no matching profile'), 500); return false; } $nickname = $req->get_parameter('omb_listenee_nickname'); if ($nickname && !Validate::string($nickname, array('min_length' => 1, 'max_length' => 64, 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { - $this->client_error(_('Nickname must have only lowercase letters and numbers and no spaces.')); + $this->clientError(_('Nickname must have only lowercase letters and numbers and no spaces.')); return false; } $license = $req->get_parameter('omb_listenee_license'); if ($license && !common_valid_http_url($license)) { - $this->client_error(sprintf(_("Invalid license URL '%s'"), $license)); + $this->clientError(sprintf(_("Invalid license URL '%s'"), $license)); return false; } $profile_url = $req->get_parameter('omb_listenee_profile'); if ($profile_url && !common_valid_http_url($profile_url)) { - $this->client_error(sprintf(_("Invalid profile URL '%s'."), $profile_url)); + $this->clientError(sprintf(_("Invalid profile URL '%s'."), $profile_url)); return false; } # optional stuff $fullname = $req->get_parameter('omb_listenee_fullname'); if ($fullname && strlen($fullname) > 255) { - $this->client_error(_("Full name is too long (max 255 chars).")); + $this->clientError(_("Full name is too long (max 255 chars).")); return false; } $homepage = $req->get_parameter('omb_listenee_homepage'); if ($homepage && (!common_valid_http_url($homepage) || strlen($homepage) > 255)) { - $this->client_error(sprintf(_("Invalid homepage '%s'"), $homepage)); + $this->clientError(sprintf(_("Invalid homepage '%s'"), $homepage)); return false; } $bio = $req->get_parameter('omb_listenee_bio'); if ($bio && strlen($bio) > 140) { - $this->client_error(_("Bio is too long (max 140 chars).")); + $this->clientError(_("Bio is too long (max 140 chars).")); return false; } $location = $req->get_parameter('omb_listenee_location'); if ($location && strlen($location) > 255) { - $this->client_error(_("Location is too long (max 255 chars).")); + $this->clientError(_("Location is too long (max 255 chars).")); return false; } $avatar = $req->get_parameter('omb_listenee_avatar'); if ($avatar) { if (!common_valid_http_url($avatar) || strlen($avatar) > 255) { - $this->client_error(sprintf(_("Invalid avatar URL '%s'"), $avatar)); + $this->clientError(sprintf(_("Invalid avatar URL '%s'"), $avatar)); return false; } $size = @getimagesize($avatar); if (!$size) { - $this->client_error(sprintf(_("Can't read avatar URL '%s'"), $avatar)); + $this->clientError(sprintf(_("Can't read avatar URL '%s'"), $avatar)); return false; } if ($size[0] != AVATAR_PROFILE_SIZE || $size[1] != AVATAR_PROFILE_SIZE) { - $this->client_error(sprintf(_("Wrong size image at '%s'"), $avatar)); + $this->clientError(sprintf(_("Wrong size image at '%s'"), $avatar)); return false; } if (!in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG))) { - $this->client_error(sprintf(_("Wrong image type for '%s'"), $avatar)); + $this->clientError(sprintf(_("Wrong image type for '%s'"), $avatar)); return false; } } @@ -156,14 +156,14 @@ class UpdateprofileAction extends Action } if (!$profile->update($orig_profile)) { - $this->server_error(_('Could not save new profile info'), 500); + $this->serverError(_('Could not save new profile info'), 500); return false; } else { if ($avatar) { $temp_filename = tempnam(sys_get_temp_dir(), 'listenee_avatar'); copy($avatar, $temp_filename); if (!$profile->setOriginal($temp_filename)) { - $this->server_error(_('Could not save avatar info'), 500); + $this->serverError(_('Could not save avatar info'), 500); return false; } } diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 196fae9ad..838458932 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -54,7 +54,7 @@ class UserauthorizationAction extends Action common_debug('getting new request', __FILE__); $req = $this->get_new_request(); if (!$req) { - $this->client_error(_('No request found!')); + $this->clientError(_('No request found!')); } common_debug('validating request', __FILE__); # XXX: only validate new requests, since nonce is one-time use @@ -64,7 +64,7 @@ class UserauthorizationAction extends Action $this->show_form($req); } catch (OAuthException $e) { $this->clear_request(); - $this->client_error($e->getMessage()); + $this->clientError($e->getMessage()); return; } @@ -137,7 +137,7 @@ class UserauthorizationAction extends Action $req = $this->get_stored_request(); if (!$req) { - common_user_error(_('No authorization request!')); + $this->clientError(_('No authorization request!')); return; } @@ -145,10 +145,10 @@ class UserauthorizationAction extends Action if ($this->arg('accept')) { if (!$this->authorize_token($req)) { - $this->client_error(_('Error authorizing token')); + $this->clientError(_('Error authorizing token')); } if (!$this->save_remote_profile($req)) { - $this->client_error(_('Error saving remote profile')); + $this->clientError(_('Error saving remote profile')); } if (!$callback) { $this->show_accept_message($req->get_parameter('oauth_token')); @@ -160,7 +160,7 @@ class UserauthorizationAction extends Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->server_error(_('User without matching profile')); + $this->serverError(_('User without matching profile')); return; } $params['omb_listener_nickname'] = $user->nickname; diff --git a/actions/userbyid.php b/actions/userbyid.php index d57ed21a5..3ff2c9c41 100644 --- a/actions/userbyid.php +++ b/actions/userbyid.php @@ -32,11 +32,11 @@ class UserbyidAction extends Action parent::handle($args); $id = $this->trimmed('id'); if (!$id) { - $this->client_error(_('No id.')); + $this->clientError(_('No id.')); } $user =& User::staticGet($id); if (!$user) { - $this->client_error(_('No such user.')); + $this->clientError(_('No such user.')); } // support redirecting to FOAF rdf/xml if the agent prefers it diff --git a/actions/userrss.php b/actions/userrss.php index 1e9fe121f..d14fc523e 100644 --- a/actions/userrss.php +++ b/actions/userrss.php @@ -34,7 +34,7 @@ class UserrssAction extends Rss10Action $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return false; } else { return true; @@ -78,7 +78,7 @@ class UserrssAction extends Rss10Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->server_error(_('User without matching profile')); + $this->serverError(_('User without matching profile')); return null; } $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); diff --git a/actions/xrds.php b/actions/xrds.php index 9c51f1dd2..7cb2cd210 100644 --- a/actions/xrds.php +++ b/actions/xrds.php @@ -35,7 +35,7 @@ class XrdsAction extends Action $nickname = $this->trimmed('nickname'); $user = User::staticGet('nickname', $nickname); if (!$user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return; } $this->show_xrds($user); diff --git a/lib/action.php b/lib/action.php index d02a1b709..207be3c82 100644 --- a/lib/action.php +++ b/lib/action.php @@ -529,14 +529,14 @@ class Action extends HTMLOutputter // lawsuit } } - function server_error($msg, $code=500) + function serverError($msg, $code=500) { $action = $this->trimmed('action'); common_debug("Server error '$code' on '$action': $msg", __FILE__); common_server_error($msg, $code); } - function client_error($msg, $code=400) + function clientError($msg, $code=400) { $action = $this->trimmed('action'); common_debug("User error '$code' on '$action': $msg", __FILE__); -- cgit v1.2.3-54-g00ecf From f294eab92a4e44c0ad8790b7875173a1340f4b5c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 23:07:49 +0000 Subject: is_readonly() -> isReadOnly() --- index.php | 2 +- lib/action.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/action.php') diff --git a/index.php b/index.php index 3cecb5c8b..387b642e2 100644 --- a/index.php +++ b/index.php @@ -55,7 +55,7 @@ if (file_exists($actionfile)) { $action_obj = new $action_class(); - if ($config['db']['mirror'] && $action_obj->is_readonly()) { + if ($config['db']['mirror'] && $action_obj->isReadOnly()) { if (is_array($config['db']['mirror'])) { // "load balancing", ha ha $k = array_rand($config['db']['mirror']); diff --git a/lib/action.php b/lib/action.php index 207be3c82..2a8f5677c 100644 --- a/lib/action.php +++ b/lib/action.php @@ -460,7 +460,7 @@ class Action extends HTMLOutputter // lawsuit return null; } - function is_readonly() + function isReadOnly() { return false; } -- cgit v1.2.3-54-g00ecf From a22714b5ee84afe387d3a2671b787822461154b0 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 23:15:13 +0000 Subject: Fix errant } in action --- lib/action.php | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 2a8f5677c..ed8b5c352 100644 --- a/lib/action.php +++ b/lib/action.php @@ -331,11 +331,10 @@ class Action extends HTMLOutputter // lawsuit $this->elementStart('dl', array('id' => 'page_notice', 'class' => 'system_notice')); $this->element('dt', null, _('Page notice')); - $this->elementStart('dd', null); + $this->elementStart('dd'); $this->showPageNotice(); $this->elementEnd('dd'); $this->elementEnd('dl'); - } } // SHOULD overload (unless there's not a notice) @@ -554,42 +553,6 @@ class Action extends HTMLOutputter // lawsuit return common_local_url($action, $args); } - function nav_menu($menu) - { - $action = $this->trimmed('action'); - $this->elementStart('ul', array('id' => 'nav_views')); - foreach ($menu as $menuaction => $menudesc) { - $this->menuItem(common_local_url($menuaction, - isset($menudesc[2]) ? $menudesc[2] : null), - $menudesc[0], - $menudesc[1], - $action == $menuaction); - } - $this->elementEnd('ul'); - } - - function common_show_header($pagetitle, $callable=null, $data=null, $headercall=null) - { - global $config, $xw; - global $action; /* XXX: kind of cheating here. */ - - common_start_html(); - - $this->elementStart('head'); - - if ($callable) { - if ($data) { - call_user_func($callable, $data); - } else { - call_user_func($callable); - } - } - $this->elementEnd('head'); - $this->elementStart('body', $action); - $this->elementStart('div', array('id' => 'wrap')); - $this->elementStart('div', array('id' => 'content')); - } - // Added @id to li for some control. // XXX: We might want to move this to htmloutputter.php -- cgit v1.2.3-54-g00ecf From 16619439ab7d67331722cc00e3b24f451ee8fa6a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 15 Jan 2009 23:44:19 +0000 Subject: Move some accounting stuff from publicgroupnav to action More dl's and dd's. Rather than replicate them in every sub-class, let's just put them in one place. --- lib/action.php | 5 +++++ lib/publicgroupnav.php | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index ed8b5c352..9534073ec 100644 --- a/lib/action.php +++ b/lib/action.php @@ -297,7 +297,12 @@ class Action extends HTMLOutputter // lawsuit function showCore() { $this->elementStart('div', array('id' => 'core')); + $this->elementStart('dl', array('id' => 'site_nav_local_views')); + $this->element('dt', null, _('Local views')); + $this->elementStart('dd'); $this->showLocalNav(); + $this->elementEnd('dd'); + $this->elementEnd('dl'); $this->showContentBlock(); $this->showAside(); $this->elementEnd('div'); diff --git a/lib/publicgroupnav.php b/lib/publicgroupnav.php index 1e5ed7359..7860783fa 100644 --- a/lib/publicgroupnav.php +++ b/lib/publicgroupnav.php @@ -77,9 +77,6 @@ class PublicGroupNav extends Widget function show() { - $this->action->elementStart('dl', array('id' => 'site_nav_local_views')); - $this->action->element('dt', null, _('Local views')); - $this->action->elementStart('dd', null); $this->action->elementStart('ul', array('class' => 'nav')); $this->out->menuItem(common_local_url('public'), _('Public'), @@ -97,7 +94,5 @@ class PublicGroupNav extends Widget _("Popular notices"), $this->action == 'favorited', 'nav_timeline_favorited'); $this->action->elementEnd('ul'); - $this->action->elementEnd('dd'); - $this->action->elementEnd('dl'); } } -- cgit v1.2.3-54-g00ecf From ba1e36dd492cedbad49f00715cf35a8cdf23ac07 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 16 Jan 2009 02:21:58 +0000 Subject: Fix use of $config in Action --- lib/action.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 90bb67870..159621b7a 100644 --- a/lib/action.php +++ b/lib/action.php @@ -222,15 +222,13 @@ class Action extends HTMLOutputter // lawsuit 'class' => 'vcard')); $this->elementStart('a', array('class' => 'url home bookmark', 'href' => common_local_url('public'))); - if ((isset($config['site']['logo']) && is_string($config['site']['logo']) && (strlen($config['site']['logo']) > 0)) - || file_exists(theme_file('logo.png'))) + if (common_config('site', 'logo') || file_exists(theme_file('logo.png'))) { $this->element('img', array('class' => 'logo photo', - 'src' => isset($config['site']['logo']) ? - ($config['site']['logo']) : theme_path('logo.png'), - 'alt' => $config['site']['name'])); + 'src' => (common_config('site', 'logo')) ? common_config('site', 'logo') : theme_path('logo.png'), + 'alt' => common_config('site', 'name'))); } - $this->element('span', array('class' => 'fn org'), $config['site']['name']); + $this->element('span', array('class' => 'fn org'), common_config('site', 'name')); $this->elementEnd('a'); $this->elementEnd('address'); } -- cgit v1.2.3-54-g00ecf From 1e8bb6bb31d66af8d68f5a5d4bde855d040baaa4 Mon Sep 17 00:00:00 2001 From: sarven Date: Fri, 16 Jan 2009 15:25:22 +0000 Subject: Minor --- lib/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 159621b7a..19f48d673 100644 --- a/lib/action.php +++ b/lib/action.php @@ -198,7 +198,7 @@ class Action extends HTMLOutputter // lawsuit $this->showHeader(); $this->showCore(); $this->showFooter(); - $this->elementEnd('div', 'wrap'); + $this->elementEnd('div'); $this->elementEnd('body'); } -- cgit v1.2.3-54-g00ecf From 20b4cae84a1451804d43e63bb990d1d8c7337197 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 16 Jan 2009 15:38:35 +0000 Subject: Put action name as body ID --- lib/action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 19f48d673..792b9c057 100644 --- a/lib/action.php +++ b/lib/action.php @@ -193,7 +193,7 @@ class Action extends HTMLOutputter // lawsuit function showBody() { - $this->elementStart('body'); + $this->elementStart('body', array('id' => $this->trimmed('action'))); $this->elementStart('div', 'wrap'); $this->showHeader(); $this->showCore(); -- cgit v1.2.3-54-g00ecf From 4549e577ac2c349881c7a411c0e25d5bdd0a0c51 Mon Sep 17 00:00:00 2001 From: sarven Date: Fri, 16 Jan 2009 15:52:17 +0000 Subject: Updating Creative Commons text and image --- lib/action.php | 10 +++++----- lib/common.php | 2 +- theme/base/css/display.css | 11 +++++++---- 3 files changed, 13 insertions(+), 10 deletions(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 792b9c057..129a4b24b 100644 --- a/lib/action.php +++ b/lib/action.php @@ -436,16 +436,16 @@ class Action extends HTMLOutputter // lawsuit $this->element('dt', array('id' => 'site_content_license'), _('Laconica software license')); $this->elementStart('dd', array('id' => 'site_content_license_cc')); $this->elementStart('p'); - $this->text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the ')); + $this->element('img', array('id' => 'license_cc', + 'src' => common_config('license', 'image'), + 'alt' => common_config('license', 'title'))); + $this->text(_('All criti.ca content and data are available under the ')); $this->element('a', array('class' => 'license', 'rel' => 'external license', 'href' => common_config('license', 'url')), common_config('license', 'title')); - $this->text(_('. Contributors should be attributed by full name or nickname.')); + $this->text(_('license.')); $this->elementEnd('p'); - $this->element('img', array('id' => 'license_cc', - 'src' => common_config('license', 'image'), - 'alt' => common_config('license', 'title'))); $this->elementEnd('dd'); } diff --git a/lib/common.php b/lib/common.php index 2ef26cfc6..05fef045a 100644 --- a/lib/common.php +++ b/lib/common.php @@ -79,7 +79,7 @@ $config = 'license' => array('url' => 'http://creativecommons.org/licenses/by/3.0/', 'title' => 'Creative Commons Attribution 3.0', - 'image' => 'http://i.creativecommons.org/l/by/3.0/88x31.png'), + 'image' => 'http://i.creativecommons.org/l/by/3.0/80x15.png'), 'mail' => array('backend' => 'mail', 'params' => null), diff --git a/theme/base/css/display.css b/theme/base/css/display.css index d56b41693..87a3a01e0 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -253,6 +253,9 @@ margin-left:0; +#licenses { +font-size:0.9em; +} #licenses dt { font-weight:bold; @@ -260,17 +263,17 @@ display:none; } #licenses dd { margin-bottom:11px; +line-height:1.5; } #site_content_license_cc p { -float:left; -margin-left:10%; width:90%; } #site_content_license_cc img { -float:left; -margin-left:-100%; +display:inline; +vertical-align:top; +margin-right:4px; } -- cgit v1.2.3-54-g00ecf From eacb8df69157e3151e3de5074dec6a152882e207 Mon Sep 17 00:00:00 2001 From: sarven Date: Fri, 16 Jan 2009 16:17:27 +0000 Subject: Added jquery.form.js --- js/jquery.form.js | 632 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/action.php | 4 - 2 files changed, 632 insertions(+), 4 deletions(-) create mode 100644 js/jquery.form.js (limited to 'lib/action.php') diff --git a/js/jquery.form.js b/js/jquery.form.js new file mode 100644 index 000000000..cb8b5a660 --- /dev/null +++ b/js/jquery.form.js @@ -0,0 +1,632 @@ +/* + * jQuery Form Plugin + * version: 2.17 (06-NOV-2008) + * @requires jQuery v1.2.2 or later + * + * Examples and documentation at: http://malsup.com/jquery/form/ + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Revision: $Id$ + */ +;(function($) { + +/* + Usage Note: + ----------- + Do not use both ajaxSubmit and ajaxForm on the same form. These + functions are intended to be exclusive. Use ajaxSubmit if you want + to bind your own submit handler to the form. For example, + + $(document).ready(function() { + $('#myForm').bind('submit', function() { + $(this).ajaxSubmit({ + target: '#output' + }); + return false; // <-- important! + }); + }); + + Use ajaxForm when you want the plugin to manage all the event binding + for you. For example, + + $(document).ready(function() { + $('#myForm').ajaxForm({ + target: '#output' + }); + }); + + When using ajaxForm, the ajaxSubmit function will be invoked for you + at the appropriate time. +*/ + +/** + * ajaxSubmit() provides a mechanism for immediately submitting + * an HTML form using AJAX. + */ +$.fn.ajaxSubmit = function(options) { + // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) + if (!this.length) { + log('ajaxSubmit: skipping submit process - no element selected'); + return this; + } + + if (typeof options == 'function') + options = { success: options }; + + options = $.extend({ + url: this.attr('action') || window.location.toString(), + type: this.attr('method') || 'GET' + }, options || {}); + + // hook for manipulating the form data before it is extracted; + // convenient for use with rich editors like tinyMCE or FCKEditor + var veto = {}; + this.trigger('form-pre-serialize', [this, options, veto]); + if (veto.veto) { + log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); + return this; + } + + // provide opportunity to alter form data before it is serialized + if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { + log('ajaxSubmit: submit aborted via beforeSerialize callback'); + return this; + } + + var a = this.formToArray(options.semantic); + if (options.data) { + options.extraData = options.data; + for (var n in options.data) { + if(options.data[n] instanceof Array) { + for (var k in options.data[n]) + a.push( { name: n, value: options.data[n][k] } ) + } + else + a.push( { name: n, value: options.data[n] } ); + } + } + + // give pre-submit callback an opportunity to abort the submit + if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { + log('ajaxSubmit: submit aborted via beforeSubmit callback'); + return this; + } + + // fire vetoable 'validate' event + this.trigger('form-submit-validate', [a, this, options, veto]); + if (veto.veto) { + log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); + return this; + } + + var q = $.param(a); + + if (options.type.toUpperCase() == 'GET') { + options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; + options.data = null; // data is null for 'get' + } + else + options.data = q; // data is the query string for 'post' + + var $form = this, callbacks = []; + if (options.resetForm) callbacks.push(function() { $form.resetForm(); }); + if (options.clearForm) callbacks.push(function() { $form.clearForm(); }); + + // perform a load on the target only if dataType is not provided + if (!options.dataType && options.target) { + var oldSuccess = options.success || function(){}; + callbacks.push(function(data) { + $(options.target).html(data).each(oldSuccess, arguments); + }); + } + else if (options.success) + callbacks.push(options.success); + + options.success = function(data, status) { + for (var i=0, max=callbacks.length; i < max; i++) + callbacks[i].apply(options, [data, status, $form]); + }; + + // are there files to upload? + var files = $('input:file', this).fieldValue(); + var found = false; + for (var j=0; j < files.length; j++) + if (files[j]) + found = true; + + // options.iframe allows user to force iframe mode + if (options.iframe || found) { + // hack to fix Safari hang (thanks to Tim Molendijk for this) + // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d + if ($.browser.safari && options.closeKeepAlive) + $.get(options.closeKeepAlive, fileUpload); + else + fileUpload(); + } + else + $.ajax(options); + + // fire 'notify' event + this.trigger('form-submit-notify', [this, options]); + return this; + + + // private function for handling file uploads (hat tip to YAHOO!) + function fileUpload() { + var form = $form[0]; + + if ($(':input[@name=submit]', form).length) { + alert('Error: Form elements must not be named "submit".'); + return; + } + + var opts = $.extend({}, $.ajaxSettings, options); + var s = jQuery.extend(true, {}, $.extend(true, {}, $.ajaxSettings), opts); + + var id = 'jqFormIO' + (new Date().getTime()); + var $io = $('