summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-06-17 21:40:52 +0000
committerZach Copley <zach@controlyourself.ca>2009-06-17 21:40:52 +0000
commit164588ef0fd2c9c9f1858f1d21d6758356ce7885 (patch)
tree2e5d5c9cc8adf07a1d610728dbfa201756884640 /lib
parentaf4b18b1e2ef8aded26fc4788c571012da04d1cf (diff)
parentcd1361fe960eb3afbbdb34b14061b8475dea60c8 (diff)
Merge branch '0.8.x' into userdesign
Diffstat (limited to 'lib')
-rw-r--r--lib/common.php2
-rw-r--r--lib/noticeform.php18
-rw-r--r--lib/router.php3
-rw-r--r--lib/twitterapi.php8
4 files changed, 19 insertions, 12 deletions
diff --git a/lib/common.php b/lib/common.php
index bcf2e5d0c..eb8a2b873 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -213,9 +213,11 @@ $config =
'file_quota' => 5000000,
'user_quota' => 50000000,
'monthly_quota' => 15000000,
+ 'uploads' => true,
),
'group' =>
array('maxaliases' => 3),
+ 'oohembed' => array('endpoint' => 'http://oohembed.com/oohembed/')
);
$config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');
diff --git a/lib/noticeform.php b/lib/noticeform.php
index 0ad365856..a36b7f31f 100644
--- a/lib/noticeform.php
+++ b/lib/noticeform.php
@@ -90,7 +90,9 @@ class NoticeForm extends Form
$this->user = common_current_user();
}
- $this->enctype = 'multipart/form-data';
+ if (common_config('attachments', 'uploads')) {
+ $this->enctype = 'multipart/form-data';
+ }
}
/**
@@ -148,12 +150,14 @@ class NoticeForm extends Form
$this->out->element('dd', array('id' => 'notice_text-count'),
'140');
$this->out->elementEnd('dl');
- $this->out->element('label', array('for' => 'notice_data-attach'),_('Attach'));
- $this->out->element('input', array('id' => 'notice_data-attach',
- 'type' => 'file',
- 'name' => 'attach',
- 'title' => _('Attach a file')));
- $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
+ if (common_config('attachments', 'uploads')) {
+ $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
+ $this->out->element('label', array('for' => 'notice_data-attach'),_('Attach'));
+ $this->out->element('input', array('id' => 'notice_data-attach',
+ 'type' => 'file',
+ 'name' => 'attach',
+ 'title' => _('Attach a file')));
+ }
if ($this->action) {
$this->out->hidden('notice_return-to', $this->action, 'returnto');
}
diff --git a/lib/router.php b/lib/router.php
index 0fbaba9ed..8b6f63618 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -351,7 +351,8 @@ class Router
$m->connect('api/favorites/:method/:argument',
array('action' => 'api',
- 'apiaction' => 'favorites'));
+ 'apiaction' => 'favorites',
+ array('method' => '(create|destroy)')));
$m->connect('api/favorites/:argument',
array('action' => 'api',
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index 569bc6d7a..269b60efc 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -545,7 +545,7 @@ class TwitterapiAction extends Action
$this->init_twitter_atom();
break;
default:
- $this->client_error(_('Not a supported data format.'));
+ $this->clientError(_('Not a supported data format.'));
break;
}
@@ -573,13 +573,13 @@ class TwitterapiAction extends Action
$this->end_twitter_rss();
break;
default:
- $this->client_error(_('Not a supported data format.'));
+ $this->clientError(_('Not a supported data format.'));
break;
}
return;
}
- function client_error($msg, $code = 400, $content_type = 'json')
+ function clientError($msg, $code = 400, $content_type = 'json')
{
static $status = array(400 => 'Bad Request',
@@ -666,7 +666,7 @@ class TwitterapiAction extends Action
$this->show_json_objects($profile_array);
break;
default:
- $this->client_error(_('Not a supported data format.'));
+ $this->clientError(_('Not a supported data format.'));
return;
}
return;