]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
adding margin to admin buttons
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 26 Jan 2011 02:03:29 +0000 (02:03 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 26 Jan 2011 02:03:29 +0000 (02:03 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7931 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/reportedcontent/languages/en.php
mod/reportedcontent/start.php
mod/reportedcontent/views/default/admin/utilities/reportedcontent.php
mod/reportedcontent/views/default/object/reported_content.php
mod/reportedcontent/views/default/reportedcontent/admin_css.php
views/default/css/admin.php

index 8c0755b92d01849af80e53d02e5ba0d5895a6aa7..407717082914895af302e7c073f00e6c8d36f1c3 100644 (file)
@@ -8,6 +8,7 @@
 $english = array(
 
        'item:object:reported_content' => 'Reported items',
+       'admin:utilities:reportedcontent' => 'Reported content',
        'reportedcontent' => 'Reported content',
        'reportedcontent:this' => 'Report this',
        'reportedcontent:this:tooltip' => 'Report this page to an administrator',
@@ -32,6 +33,9 @@ $english = array(
        'reportedcontent:report' => 'Report this',
        'reportedcontent:moreinfo' => 'More info',
        'reportedcontent:instructions' => 'This report will be sent to the administrators of this site for review.',
+       'reportedcontent:numbertodisplay' => 'Number of reports to display',
+       'reportedcontent:widget:description' => 'Display reported content',
+       'reportedcontent:user' => 'Report user',
 
        'reportedcontent:failed' => 'Sorry, the attempt to report this content has failed.',
        'reportedcontent:notarchived' => 'We were not able to archive that report',
index d92eb05a217b64e0e1f34dd5b0ad8d55895f798c..9708c3b14395825ae6a9b9fd1c171cdeec2d2306 100644 (file)
@@ -19,15 +19,22 @@ function reportedcontent_init() {
        elgg_extend_view('css/screen', 'reportedcontent/css');
        elgg_extend_view('css/admin', 'reportedcontent/admin_css');
 
-       // Extend context menu and footer with report content link
+       // Extend footer with report content link
        if (isloggedin()) {
-               elgg_extend_view('profile/menu/links', 'reportedcontent/user_report');
                elgg_extend_view('footer/links', 'reportedcontent/footer_link');
        }
 
+       elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'reportedcontent_user_hover_menu');
+
        // Add admin menu item
        elgg_add_admin_menu_item('reportedcontent', elgg_echo('reportedcontent'), 'utilities');
 
+       elgg_register_widget_type(
+                       'reportedcontent',
+                       elgg_echo('reportedcontent'),
+                       elgg_echo('reportedcontent:widget:description'),
+                       'admin');
+
        // Register actions
        $action_path = elgg_get_plugin_path() . "reportedcontent/actions";
        elgg_register_action('reportedcontent/add', "$action_path/add.php");
@@ -58,3 +65,25 @@ function reportedcontent_page_handler($page) {
 
        echo elgg_view_page(elgg_echo('reportedcontent:this'), $body);
 }
+
+/**
+ * Add report user link to hover menu
+ */
+function reportedcontent_user_hover_menu($hook, $type, $return, $params) {
+       $user = $params['entity'];
+
+       $profile_url = urlencode($user->getURL());
+       $name = urlencode($user->name);
+       $url = "pg/reportedcontent/add/?address=$profile_url&title=$name";
+
+       if (isloggedin() && get_loggedin_userid() != $user->guid) {
+               $item = new ElggMenuItem(
+                               'reportuser',
+                               elgg_echo('reportedcontent:user'),
+                               $url);
+               $item->setSection('action');
+               $return[] = $item;
+       }
+
+       return $return;
+}
\ No newline at end of file
index 3f79d500abf1f06c823fbd22d0746ca0deb9e064..32f1083128382dbe0f96fac79131bd6939f8d7f5 100644 (file)
@@ -5,16 +5,9 @@
  * @package ElggReportedContent
  */
 
-$title = elgg_view_title(elgg_echo('reportedcontent'));
-
 $list = elgg_list_entities(array('types' => 'object', 'subtypes' => 'reported_content'));
 if (!$list) {
-       $list = '<p class="margin-top">' . elgg_echo('reportedcontent:none') . '</p>';
+       $list = '<p class="mtm">' . elgg_echo('reportedcontent:none') . '</p>';
 }
 
-$body = <<<__HTML
-$title
-$list
-__HTML;
-
-echo $body;
\ No newline at end of file
+echo $list;
\ No newline at end of file
index 0ac4457da486db6c8984ca4dcd0cbe99f30f3dd4..0ab157d621785a48e2a14347af847f589499e694 100644 (file)
@@ -13,14 +13,14 @@ $delete_url = elgg_get_site_url() . "action/reportedcontent/delete?guid=$report-
 
 //find out if the report is current or archive
 if ($report->state == 'archived') {
-       $reportedcontent_background = "archived_report";
+       $reportedcontent_background = "reported-content-archived";
 } else {
-       $reportedcontent_background = "active_report";
+       $reportedcontent_background = "reported-content-active";
 }
 
 ?>
 
-<div class="admin_settings reported_content <?php echo $reportedcontent_background; ?>">
+<div class="reported-content <?php echo $reportedcontent_background; ?>">
        <div class="clearfix controls">
 <?php
        if ($report->state != 'archived') {
@@ -36,7 +36,7 @@ if ($report->state == 'archived') {
                'href' => $delete_url,
                'text' => elgg_echo('reportedcontent:delete'),
                'is_action' => true,
-               'class' => 'elgg-action-button disabled',
+               'class' => 'elgg-action-button',
        );
        echo elgg_view('output/url', $params);
 ?>
@@ -57,12 +57,12 @@ if ($report->state == 'archived') {
                <?php echo elgg_view('output/url', array(
                        'href' => '#',
                        'text' => elgg_echo('reportedcontent:moreinfo'),
-                       'class' => 'details_link',
-                       'onclick' => "elgg_slide_toggle(this, '.reported_content', '.reported_content_more{$report->getGUID()}'); return false;"
+                       'class' => "elgg-toggle",
+                       'internalid' => "elgg-toggler-report-$report->guid",
                ));
                ?>
        </p>
-       <div class="details hidden reported_content_more<?php echo $report->getGUID();?>">
+       <div class="hidden" id="elgg-togglee-report-<?php echo $report->getGUID();?>">
                <p>
                        <b><?php echo elgg_echo('reportedcontent:objecturl'); ?>:</b>
                        <?php echo elgg_view('output/url', array(
index 82566ff3af692d8bb583c5624b21378a3a2586d7..02c235a99fdc784ea079a649a5f97ab4b2b86c09 100644 (file)
@@ -7,32 +7,24 @@
 ?>
 
 /* REPORTED CONTENT */
-.admin_settings.reported_content {
-       margin:5px 0 0 0;
-       padding:5px 7px 3px 9px;
+.reported-content {
+       margin: 5px 0 0 0;
+       padding: 5px 7px 3px 9px;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
 }
-.admin_settings.reported_content p {
-       margin:0;
+.reported-content p {
+       margin: 0;
 }
-.active_report {
-       border:1px solid #D3322A;
-       background:#F7DAD8;
+.reported-content-active {
+       border: 1px solid #D3322A;
+       background: #F7DAD8;
 }
-.archived_report {
-       border:1px solid #666666;
-       background:#dedede;
+.reported-content-archived {
+       border: 1px solid #666666;
+       background: #dedede;
 }
-.admin_settings.reported_content .controls {
-       float:right;
-       margin:14px 5px 0 0;
-}
-.admin_settings.reported_content a.action_button {
-       display:inline;
-       float:right;
-       margin-left:15px;
-}
-.admin_settings.reported_content .details_link {
-       cursor: pointer;
+.reported-content .controls {
+       float: right;
+       margin: 14px 5px 0 0;
 }
index 930ee2fe3b61211a02671af57911af285c5b27c5..f5b408e3ae7e67f7fd164cd4d57b0756d70e6904 100644 (file)
@@ -396,7 +396,7 @@ input[type="submit"], .elgg-submit-button, .elgg-action-button {
        -moz-border-radius: 5px;
        width: auto;
        padding: 2px 4px;
-       margin:10px 0 10px 0;
+       margin: 10px 5px 10px 0;
        cursor: pointer;
        outline: none;
 }