Permalink
Browse files

allow admin to search for users on userscope page; fix bug with live …

…translate mode
  • Loading branch information...
1 parent a25031d commit ce1f0a134ea8a6d89601f54f0de4ff2433d4c5c3 Jesse Young committed Dec 1, 2011
View
@@ -30,7 +30,7 @@
'queue:port' => 22133,
'cache:backend' => "Cache_Database",
- 'cache:version' => 200, // increment when all cached objects need to be invalidated (rare)
+ 'cache:version' => 201, // increment when all cached objects need to be invalidated (rare)
'analytics:backend' => "Analytics_Null",
View
@@ -14,7 +14,6 @@
'mail:reply_email' => "reply@localhost",
'mail:status_email' => '',
'mail:email_from' => "web@localhost",
- 'mail:email_pass' => "",
'mail:error_emails_enabled' => false,
@@ -28,8 +28,8 @@ function action_app()
$this->set_status(403);
$this->set_content("Invalid request signature");
throw new RequestAbortedException();
- }
-
+ }
+
$request = EnvayaSMS::get_request();
$app_log = $request->log;
@@ -55,7 +55,7 @@ function action_app()
{
case EnvayaSMS::ACTION_INCOMING:
return $this->receive_sms($provider);
- case EnvayaSMS::ACTION_OUTGOING:
+ case EnvayaSMS::ACTION_OUTGOING:
$messages = $provider->get_outgoing_messages();
$message_ids = array_map(function ($m) { return $m->id; }, $messages);
@@ -128,6 +128,8 @@ function index_widget($widget)
{
$user_actions_menu->add_link("Email Subscriptions", EmailSubscription::get_all_settings_url($user->email));
}
+
+ $user_actions_menu->add_link('User Properties', $user->get_admin_url());
}
if (Permission_UseAdminTools::has_for_entity($widget))
@@ -22,7 +22,8 @@ function process_input()
if (get_input('delete'))
{
- $photo->delete();
+ $photo->disable();
+ $photo->save();
SessionMessages::add(__("featured:photo:deleted"));
$this->redirect("/admin/envaya/featured_photos");
View
@@ -69,23 +69,21 @@ static function patch_Language()
if (Config::get('translate:live_interface'))
{
- Engine::add_autoload_action('Language', function() {
- $language = Language::current();
+ $language = Language::current();
+
+ $translation_language = TranslationLanguage::get_by_code($language->get_code());
- $translation_language = TranslationLanguage::get_by_code($language->get_code());
-
- $language->load_all();
+ $language->load_all();
+
+ $interface_keys = $translation_language->query_keys()->where("best_translation <> ''")->filter();
- $interface_keys = $translation_language->query_keys()->where("best_translation <> ''")->filter();
-
- $translations = array();
- foreach ($interface_keys as $interface_key)
- {
- $translations[$interface_key->name] = $interface_key->best_translation;
- }
-
- $language->add_translations($translations);
- });
+ $translations = array();
+ foreach ($interface_keys as $interface_key)
+ {
+ $translations[$interface_key->name] = $interface_key->best_translation;
+ }
+
+ $language->add_translations($translations);
}
}
View
@@ -23,6 +23,11 @@
$user->save();
}
+ foreach (EmailSubscription::query()->filter() as $subscription)
+ {
+ $subscription->email = $admin_email;
+ }
+
// also disable sms subscriptions
foreach (SMSSubscription::query()->filter() as $subscription)
{
View
@@ -7,7 +7,7 @@ fi
# overwrite sources.list with our own sources
-if ! grep -q envaya /etc/php5/fpm/php.ini ; then
+if ! grep -q envaya /etc/apt/sources.list ; then
cat <<EOF >> /etc/apt/sources.list
@@ -20,17 +20,36 @@
$users_query = $scope->query_users();
+ $q = get_input('q');
+
+ if ($q)
+ {
+ $users_query->fulltext($q);
+ }
+
$limit = 20;
$offset = (int)get_input('offset');
$num_users = $users_query->count();
+ if ($num_users || $q)
+ {
+ echo "<div style='float:right'>";
+ echo "<form method='GET' action='{$scope->get_admin_url()}'>";
+ echo view('input/text', array('name' => 'q', 'value' => $q, 'style' => 'width:150px'));
+ echo view('input/submit', array('name' => '', 'style' => 'margin:0px', 'value' => __('search')));
+ echo "</form>";
+ echo "</div>";
+
+ echo "<h4>Users ($num_users)</h4>";
+
+ }
+
if ($num_users)
{
$users = $users_query
->limit($limit, $offset)
->order_by('time_created desc')
->filter();
- echo "<h4>Users ($num_users)</h4>";
$items = array();
foreach ($users as $user)
@@ -49,4 +68,5 @@
'offset' => $offset,
'count' => $num_users
));
+ echo "<br />";
}
@@ -16,6 +16,7 @@
<?php
echo view('input/submit', array(
+ 'name' => '',
'value' => __('search:submit')
));
?>

0 comments on commit ce1f0a1

Please sign in to comment.