WordPress.org

Plugin Directory

Changeset 701381


Ignore:
Timestamp:
04/22/13 05:45:05 (12 months ago)
Author:
eskapism
Message:

updates

Location:
simple-history/trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • simple-history/trunk/index.php

    r699313 r701381  
    4444    $aa = $plugin; 
    4545} 
    46 $plugin_dir_url = plugin_dir_url(basename($aa)) . 'simple-history/'; 
     46 
     47$plugin_dir_url = plugin_dir_url(basename($aa)) . basename(dirname(__FILE__)) . '/'; 
    4748define("SIMPLE_HISTORY_URL", $plugin_dir_url); 
     49 
     50// http://playground-nightly.ep/wordpress/wp-content/plugins/simple-history/ 
     51// sf_d( SIMPLE_HISTORY_URL ); 
    4852 
    4953/** 
     
    8791     */ 
    8892    function add_types_for_translation() { 
     93        $dummy = __("added", "simple-history"); 
    8994        $dummy = __("approved", "simple-history"); 
    9095        $dummy = __("unapproved", "simple-history"); 
     
    106111        $dummy = __("modified", "simple-history"); 
    107112        $dummy = __("upgraded it\'s database", "simple-history"); 
     113        $dummy = __("plugin", "simple-history"); 
    108114    } 
    109115 
     
    205211 
    206212        $db_version = get_option("simple_history_db_version"); 
     213        $table_name = $wpdb->prefix . "simple_history"; 
    207214        // $db_version = FALSE; 
    208215         
    209         if ($db_version === FALSE) { 
     216        if ( false === $db_version ) { 
     217 
    210218            // db fix has never been run 
    211219            // user is on version 0.4 or earlier 
    212220            // = database is not using utf-8 
    213221            // so fix that 
    214             $table_name = $wpdb->prefix . "simple_history"; 
     222             
    215223            require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 
    216224            #echo "begin upgrading database"; 
     225             
    217226            // We change the varchar size to add one num just to force update of encoding. dbdelta didn't see it otherwise. 
    218227            $sql = "CREATE TABLE " . $table_name . " ( 
     
    241250             
    242251            update_option("simple_history_db_version", 1); 
    243         } else { 
    244             // echo "db up to date"; 
     252 
     253        } // done pre db ver 1 things 
     254 
     255        // DB version is 1, upgrade to 2 
     256        if ( 1 == intval($db_version) ) { 
     257             
     258            // Add column for free text 
     259            // require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 
     260            // update_option("simple_history_db_version", 2); 
     261 
    245262        } 
    246263         
     
    330347            $self_link = simple_history_get_rss_address(); 
    331348     
    332             if ($rss_secret_option == $rss_secret_get) { 
     349            if ($rss_secret_option === $rss_secret_get) { 
    333350                ?> 
    334351                <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
     
    339356                        <atom:link href="<?php echo $self_link; ?>" rel="self" type="application/atom+xml" /> 
    340357                        <?php 
     358 
     359                        // Add filters here 
     360                        /* 
     361                                "page"        => 0, 
     362                                "items"       => $simple_history->get_pager_size(), 
     363                                "filter_type" => "", 
     364                                "filter_user" => "", 
     365                                "search"      => "", 
     366                                "num_added"   => 0 
     367                        */ 
    341368                        $arr_items = simple_history_get_items_array("items=10"); 
    342369                        foreach ($arr_items as $one_item) { 
     
    400427    } // rss 
    401428 
     429    /** 
     430     * Get history from ajax 
     431     */ 
    402432    function ajax() { 
    403433     
     
    407437        $subtype = isset($_POST["subtype"]) ? $_POST["subtype"] : ""; 
    408438     
    409         $user = $_POST["user"]; 
    410         if ($user == __( "By all users", 'simple-history' )) { $user = "";  } 
     439        // We get users by username, so get username from id 
     440        $user_id = (int) $_POST["user_id"]; 
     441        if (empty($user_id)) { 
     442            $user = ""; 
     443        } else { 
     444            $user_obj = new WP_User($user_id); 
     445            if ( ! $user_obj->exists() ) exit; 
     446            $user = $user_obj->user_login; 
     447        }; 
    411448     
    412449        // page to show. 1 = first page. 
     
    617654// @todo: move all add-related stuff to own file? there are so many of them.. kinda confusing, ey. 
    618655 
     656/** 
     657 * Plugin is activated 
     658 * plugin_name is like admin-menu-tree-page-view/index.php 
     659 */ 
    619660function simple_history_activated_plugin($plugin_name) { 
    620     $plugin_name = urlencode($plugin_name); 
     661 
     662    // Fetch info about the plugin 
     663    $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_name ); 
     664     
     665    if ( is_array( $plugin_data ) && ! empty( $plugin_data["Name"] ) ) { 
     666        $plugin_name = urlencode( $plugin_data["Name"] ); 
     667    } else { 
     668        $plugin_name = urlencode($plugin_name); 
     669    } 
     670 
    621671    simple_history_add("action=activated&object_type=plugin&object_name=$plugin_name"); 
    622672} 
     
    9581008function simple_history_dashboard() { 
    9591009    simple_history_purge_db(); 
     1010    echo '<div class="wrap simple-history-wrap">'; 
    9601011    simple_history_print_nav(); 
    9611012    echo simple_history_print_history(); 
    9621013    echo simple_history_get_pagination(); 
     1014    echo '</div>'; 
    9631015} 
    9641016 
     
    9721024    ?> 
    9731025 
    974     <div class="wrap"> 
     1026    <div class="wrap simple-history-wrap"> 
    9751027        <h2><?php echo __("History", 'simple-history') ?></h2> 
    9761028        <?php    
     
    10441096} 
    10451097 
     1098/** 
     1099 * Output navigation at top with filters for type, users, and free text search input 
     1100 */ 
    10461101function simple_history_print_nav() { 
    10471102 
     
    10551110        $simple_history_type_to_show = ""; 
    10561111    } 
    1057     $sql = "SELECT DISTINCT object_type, object_subtype FROM {$tableprefix}simple_history ORDER BY object_type, object_subtype"; 
     1112 
     1113    // Get all object types and object subtypes 
     1114    // order by the number of times they occur 
     1115    $sql = "SELECT  
     1116                count(object_type) AS object_type_count, 
     1117                object_type, object_subtype  
     1118            FROM {$tableprefix}simple_history  
     1119            GROUP BY object_type, object_subtype 
     1120            ORDER BY object_type_count DESC, object_type, object_subtype 
     1121        "; 
    10581122    $arr_types = $wpdb->get_results($sql); 
    10591123 
    1060     $str_types = ""; 
    1061     $str_types .= "<ul class='simple-history-filter simple-history-filter-type'>"; 
    10621124    $css = ""; 
    10631125    if (empty($simple_history_type_to_show)) { 
     
    10651127    } 
    10661128 
     1129    // Begin list 
     1130    $str_types = ""; 
     1131    $str_types .= "<ul class='simple-history-filter simple-history-filter-type'>"; 
     1132 
     1133    // Begin select 
     1134    $str_types_select = ""; 
     1135    $str_types_select .= "<select name='' class='simple-history-filter simple-history-filter-type'>"; 
     1136 
     1137    $total_object_num_count = 0; 
     1138    foreach ( $arr_types as $one_type ) { 
     1139        $total_object_num_count += $one_type->object_type_count; 
     1140    } 
     1141 
     1142    // First filter is "all types" 
    10671143    $link = esc_html(add_query_arg("simple_history_type_to_show", "")); 
    10681144    $str_types_desc = __("All types", 'simple-history'); 
    1069     $str_types .= "<li $css><a data-simple-history-filter-type='' href='$link'>" . esc_html($str_types_desc) . "</a> | </li>"; 
     1145    $str_types .= "<li $css><a data-simple-history-filter-type='' href='$link'>" . esc_html($str_types_desc) . " <span>($total_object_num_count)</span></a> | </li>"; 
     1146 
     1147    $str_types_select .= sprintf('<option data-simple-history-filter-type="" data-simple-history-filter-subtype="" value="%1$s">%2$s (%3$d)</option>', $link, esc_html($str_types_desc), $total_object_num_count ); 
     1148 
     1149    // Loop through all types 
     1150    // $one_type->object_type = user | post | attachment | comment | plugin | attachment | post | Reply | Topic | Widget | Wordpress_core 
     1151    // $one_type->object_subtype = page | nav_menu_item | ... 
     1152    #sf_d($arr_types); 
    10701153    foreach ($arr_types as $one_type) { 
     1154 
    10711155        $css = ""; 
     1156        $option_selected = ""; 
    10721157        if ($one_type->object_subtype && $simple_history_type_to_show == ($one_type->object_type."/".$one_type->object_subtype)) { 
    10731158            $css = "class='selected'"; 
     1159            $option_selected = " selected "; 
    10741160        } elseif (!$one_type->object_subtype && $simple_history_type_to_show == $one_type->object_type) { 
    10751161            $css = "class='selected'"; 
    1076         } 
     1162            $option_selected = " selected "; 
     1163        } 
     1164 
     1165        // Begin LI 
    10771166        $str_types .= sprintf('<li %1$s data-simple-history-filter-type="%2$s" data-simple-history-filter-subtype="%3$s" >', $css, $one_type->object_type, $one_type->object_subtype); 
     1167 
     1168        // Create link to filter this type + subtype 
    10781169        $arg = ""; 
    10791170        if ($one_type->object_subtype) { 
     
    10841175        $link = esc_html(add_query_arg("simple_history_type_to_show", $arg)); 
    10851176        $str_types .= "<a href='$link'>"; 
     1177 
     1178        // Begin option 
     1179        $str_types_select .= sprintf( 
     1180            '<option %1$s data-simple-history-filter-type="%2$s" data-simple-history-filter-subtype="%3$s" value="%4$s">', 
     1181            $option_selected, // 1 
     1182            $one_type->object_type, // 2 
     1183            $one_type->object_subtype, // 3 
     1184            $link // 4 
     1185        ); 
    10861186         
    10871187        // Some built in types we translate with built in translation, the others we use simple history for 
     1188        // TODO: use WP-function to get all built in types? 
    10881189        $arr_built_in_types_with_translation = array("page", "post"); 
    10891190        $object_type_translated = ""; 
    10901191        $object_subtype_translated = ""; 
    1091         if ( in_array($one_type->object_type, $arr_built_in_types_with_translation) ) { 
    1092             $object_type_translated = esc_html__(ucfirst($one_type->object_type)); 
    1093         } else { 
    1094             $object_type_translated = esc_html__(ucfirst($one_type->object_type), "simple-history");             
    1095         } 
    1096         if (in_array($one_type->object_subtype, $arr_built_in_types_with_translation) ) { 
    1097             $object_subtype_translated = esc_html__(ucfirst($one_type->object_subtype));             
    1098         } else { 
    1099             $object_subtype_translated = esc_html__(ucfirst($one_type->object_subtype), "simple-history"); 
    1100         } 
    1101          
     1192 
     1193        // Get built in post types 
     1194        $arr_built_in_post_types = get_post_types( array("_builtin" => true) ); 
     1195 
     1196        $object_type_translated = ""; 
     1197        $object_subtype_translated = ""; 
     1198        if ( in_array( $one_type->object_type, $arr_built_in_post_types ) ) { 
     1199             
     1200            $object_post_type_object = get_post_type_object( $one_type->object_type ); 
     1201            $object_type_translated = $object_post_type_object->labels->singular_name; 
     1202 
     1203            $object_subtype_post_type_object = get_post_type_object( $one_type->object_subtype ); 
     1204            if ( ! is_null( $object_subtype_post_type_object ) ) { 
     1205                $object_subtype_translated = $object_subtype_post_type_object->labels->singular_name;; 
     1206            } 
     1207 
     1208        } 
     1209         
     1210        if ( empty( $object_type_translated ) ) { 
     1211            $object_type_translated = ucfirst( esc_html__( $one_type->object_type, "simple-history") ); 
     1212        } 
     1213 
     1214        if ( empty( $object_subtype_translated ) ) { 
     1215            $object_subtype_translated = ucfirst( esc_html__( $one_type->object_subtype, "simple-history") ); 
     1216        } 
     1217         
     1218        // Add name of type (post / attachment / user / etc.) 
    11021219        $str_types .= $object_type_translated; 
     1220        $str_types_select .= $object_type_translated; 
     1221 
     1222        // And subtype, if different from main type 
    11031223        if ($object_subtype_translated && $object_subtype_translated != $object_type_translated) { 
    11041224            $str_types .= "/". $object_subtype_translated; 
    1105         } 
    1106          
     1225            $str_types_select .= "/" . $object_subtype_translated; 
     1226        } 
     1227 
     1228        // Add object count 
     1229        $str_types .= sprintf(' <span>(%d)</span>', $one_type->object_type_count); 
     1230        $str_types_select .= sprintf(' (%d)', $one_type->object_type_count); 
     1231         
     1232        // Close link and li 
    11071233        $str_types .= "</a> | "; 
    11081234        $str_types .= "</li>"; 
     1235 
     1236        // Close option 
     1237        $str_types_select .= "\n</option>"; 
    11091238         
    11101239        // debug 
     
    11131242        #$str_types .= " subtype: " . $one_type->object_subtype. " "; 
    11141243         
    1115     } 
     1244    } // foreach arr types 
     1245 
    11161246    $str_types .= "</ul>"; 
    11171247    $str_types = str_replace("| </li></ul>", "</li></ul>", $str_types); 
    1118     if (!empty($arr_types)) { 
    1119         echo $str_types; 
     1248 
     1249    $str_types_select .= "\n</select>"; 
     1250 
     1251    // Output filters 
     1252    if ( ! empty( $arr_types ) ) { 
     1253        // echo $str_types; 
     1254        echo $str_types_select; 
    11201255    } 
    11211256 
     
    11261261        $arr_users[$one_user->user_id] = array("user_id" => $one_user->user_id); 
    11271262    } 
    1128     if (!empty($arr_users)) { 
     1263     
     1264    if ( ! empty( $arr_users ) ) { 
     1265     
    11291266        foreach ($arr_users as $user_id => $one_user) { 
    11301267            $user = get_user_by("id", $user_id); 
     
    11401277            } 
    11411278        } 
     1279 
    11421280    } 
    11431281 
    11441282    if (isset($arr_users) && $arr_users) { 
     1283 
    11451284        if (isset($_GET["simple_history_user_to_show"])) { 
    11461285            $simple_history_user_to_show = $_GET["simple_history_user_to_show"]; 
     
    11481287            $simple_history_user_to_show = ""; 
    11491288        } 
     1289 
    11501290        $str_users = ""; 
    11511291        $str_users .= "<ul class='simple-history-filter simple-history-filter-user'>"; 
     1292 
     1293        $str_users_select = ""; 
     1294        $str_users_select .= "<select name='' class='simple-history-filter simple-history-filter-user'>"; 
     1295 
    11521296        $css = ""; 
     1297        $option_selected = ""; 
    11531298        if (empty($simple_history_user_to_show)) { 
    11541299            $css = " class='selected' "; 
    1155         } 
     1300            $option_selected = " selected "; 
     1301        } 
     1302 
     1303        // All users 
    11561304        $link = esc_html(add_query_arg("simple_history_user_to_show", "")); 
    11571305        $str_users .= "<li $css><a href='$link'>" . __("By all users", 'simple-history') ."</a> | </li>"; 
     1306 
     1307        $str_users_select .= sprintf( 
     1308                '<option data-simple-history-filter-user-id="%4$s" value="%3$s" %2$s>%1s</option>',  
     1309                __("By all users", 'simple-history'), // 1 
     1310                $option_selected, // 2 
     1311                $link, // 3 
     1312                "" // 4 
     1313            ); 
     1314 
    11581315        foreach ($arr_users as $user_id => $user_info) { 
    11591316 
     
    11621319 
    11631320            $link = esc_html(add_query_arg("simple_history_user_to_show", $user_id)); 
     1321             
    11641322            $css = ""; 
     1323            $option_selected = ""; 
     1324 
    11651325            if ($user_id == $simple_history_user_to_show) { 
    11661326                $css = " class='selected' "; 
     1327                $option_selected = " selected "; 
    11671328            } 
     1329 
     1330            // all users must have username and email 
     1331            $str_user_name = sprintf('%1$s (%2$s)', esc_attr($user->user_login), esc_attr($user->user_email)); 
     1332            // if ( ! empty( $user_info["first_name"] )  $user_info["last_name"] ); 
     1333 
    11681334            $str_users .= "<li $css>"; 
    11691335            $str_users .= "<a href='$link'>"; 
    1170             $str_users .= $user_info["user_nicename"]; 
     1336            $str_users .= $str_user_name; 
    11711337            $str_users .= "</a> | "; 
    11721338            $str_users .= "</li>"; 
    1173         } 
     1339             
     1340            $str_users_select .= sprintf( 
     1341                '<option data-simple-history-filter-user-id="%4$s" %2$s value="%1$s">%1$s</option>', 
     1342                $str_user_name, // 1 
     1343                $option_selected, // 2 
     1344                $link, // 3 
     1345                $user_id 
     1346            ); 
     1347 
     1348        } 
     1349 
    11741350        $str_users .= "</ul>"; 
    11751351        $str_users = str_replace("| </li></ul>", "</li></ul>", $str_users); 
    1176         echo $str_users; 
     1352 
     1353        $str_users_select .= "</select>"; 
     1354 
     1355        if ( ! empty($str_users) ) { 
     1356            // echo $str_users; 
     1357            echo $str_users_select; 
     1358        } 
     1359 
    11771360    } 
    11781361     
     
    12031386                <span class="displaying-num">%1$s</span> 
    12041387                <span class="pagination-links"> 
    1205                     <a class="first-page disabled" title="%5$s" href="#">«</a> 
    1206                     <a class="prev-page disabled" title="%6$s" href="#"></a> 
     1388                    <a class="first-page disabled" title="%5$s" href="#"><span>«</span></a> 
     1389                    <a class="prev-page disabled" title="%6$s" href="#"><span>‹</span></a> 
    12071390                    <span class="paging-input"><input class="current-page" title="%7$s" type="text" name="paged" value="%2$d" size="2"> %8$s <span class="total-pages">%3$d</span></span> 
    1208                     <a class="next-page %4$s" title="%9$s" href="#"></a> 
    1209                     <a class="last-page %4$s" title="%10$s" href="#">»</a> 
     1391                    <a class="next-page %4$s" title="%9$s" href="#"><span>›</span></a> 
     1392                    <a class="last-page %4$s" title="%10$s" href="#"><span>»</span></a> 
    12101393                </span> 
    12111394            </div> 
     
    14331616            $occasions = $one_row->occasions; 
    14341617            $num_occasions = sizeof($occasions); 
     1618            $object_image_out = ""; 
    14351619 
    14361620            $css = ""; 
     
    14911675                 
    14921676                $post_out = ""; 
    1493                 $post_out .= esc_html__(ucfirst($object_subtype)); 
     1677                 
     1678                // Get real name for post type (not just the slug for custom post types) 
     1679                $post_type_object = get_post_type_object( $object_subtype ); 
     1680                if ( is_null($post_type_object) ) { 
     1681                    $post_out .= esc_html__( ucfirst( $object_subtype ) ); 
     1682                } else { 
     1683                    $post_out .= esc_html__( ucfirst( $post_type_object->labels->singular_name ) ); 
     1684                } 
     1685 
    14941686                $post = get_post($object_id); 
    14951687 
     
    15261718                 
    15271719                if ($post) { 
     1720 
     1721                    // Post for attachment was found 
     1722 
    15281723                    $title = esc_html(get_the_title($post->ID)); 
    15291724                    $edit_link = get_edit_post_link($object_id, 'display'); 
    1530                     $attachment_image_src = wp_get_attachment_image_src($object_id, array(50,50), true); 
    1531                     $attachment_image = ""; 
     1725                    $attachment_metadata = wp_get_attachment_metadata( $object_id ); 
     1726                    $attachment_file = get_attached_file( $object_id ); 
     1727                    $attachment_mime = get_post_mime_type( $object_id ); 
     1728                    $attachment_url = wp_get_attachment_url( $object_id ); 
     1729 
     1730                    // Get attachment thumbnail. 60 x 60 is the same size as the media overview uses 
     1731                    // Is thumbnail of object if image, is wp icon if not 
     1732                    $attachment_image_src = wp_get_attachment_image_src($object_id, array(60, 60), true);                    
    15321733                    if ($attachment_image_src) { 
    1533                         $attachment_image = "<a class='simple-history-attachment-thumbnail' href='$edit_link'><img src='{$attachment_image_src[0]}' alt='Attachment icon' width='{$attachment_image_src[1]}' height='{$attachment_image_src[2]}' /></a>"; 
     1734                        $object_image_out .= "<a class='simple-history-attachment-thumbnail' href='$edit_link'><img src='{$attachment_image_src[0]}' alt='Attachment icon' width='{$attachment_image_src[1]}' height='{$attachment_image_src[2]}' /></a>"; 
    15341735                    } 
    1535                     $attachment_out .= $attachment_image; 
     1736                     
     1737                    // Begin adding nice to have meta info about to attachment (name, size, mime, etc.)                  
     1738                    $object_image_out .= "<div class='simple-history-attachment-meta'>"; 
     1739 
     1740                    // File name 
     1741 
     1742                    // Get size in human readable format. Code snippet from media.php 
     1743                    $sizes = array( 'KB', 'MB', 'GB' ); 
     1744                    $attachment_filesize = filesize( $attachment_file ); 
     1745                    for ( $u = -1; $attachment_filesize > 1024 && $u < count( $sizes ) - 1; $u++ ) { 
     1746                        $attachment_filesize /= 1024; 
     1747                    } 
     1748 
     1749                    // File type 
     1750                    $file_type_out = ""; 
     1751                    if ( preg_match( '/^.*?\.(\w+)$/', $attachment_file, $matches ) ) 
     1752                        $file_type_out .= esc_html( strtoupper( $matches[1] ) ); 
     1753                    else 
     1754                        $file_type_out .= strtoupper( str_replace( 'image/', '', $post->post_mime_type ) ); 
     1755             
     1756                    // Media size, width x height 
     1757                    $media_dims = ""; 
     1758                    if ( ! empty( $attachment_metadata['width'] ) && ! empty( $attachment_metadata['height'] ) ) { 
     1759                        $media_dims .= "<span>{$attachment_metadata['width']}&nbsp;&times;&nbsp;{$attachment_metadata['height']}</span>"; 
     1760                         
     1761                    } 
     1762 
     1763                    // Generate string with metainfo 
     1764                    $object_image_out .= sprintf('<p>%1$s %2$s</p>', __("File name:"), esc_html( basename( $attachment_file ) ) );; 
     1765                    $object_image_out .= sprintf('<p>%1$s %2$s %3$s</p>', __("File size:", "simple-history"), round( $attachment_filesize, 0 ), $sizes[$u] ); 
     1766                    // $object_image_out .= sprintf('<p>%1$s %2$s</p>', __("File type:"), $file_type_out ); 
     1767                    if ( ! empty( $media_dims ) ) $object_image_out .= sprintf('<p>%1$s %2$s</p>', __("Dimensions:"), $media_dims );                     
     1768                    if ( ! empty( $attachment_metadata["length_formatted"] ) ) $object_image_out .= sprintf('<p>%1$s %2$s</p>', __("Length:"), $attachment_metadata["length_formatted"] );                   
     1769                                         
     1770                    // end attachment meta info box output 
     1771                    $object_image_out .= "</div>"; // close simple-history-attachment-meta 
     1772 
    15361773                    $attachment_out .= " <a href='$edit_link'>"; 
    15371774                    $attachment_out .= "<span class='simple-history-title'>{$title}</span>"; 
     
    15391776                     
    15401777                } else { 
     1778 
     1779                    // Post for attachment was not found 
    15411780                    if ($object_name) { 
    15421781                        $attachment_out .= "<span class='simple-history-title'>\"" . esc_html($object_name) . "\"</span>"; 
     
    15441783                        $attachment_out .= " <span class='simple-history-title'>&lt;deleted&gt;</span>"; 
    15451784                    } 
     1785 
    15461786                } 
    15471787 
     
    15801820                } 
    15811821 
     1822                /* 
    15821823                $user_avatar = get_avatar($user->user_email, "50");  
    15831824                if ($user_link) { 
     
    15861827                    $user_out .= "<span class='simple-history-attachment-thumbnail' href='$user_link'>$user_avatar</span>"; 
    15871828                } 
     1829                */ 
    15881830 
    15891831                $user_out .= " " . esc_html__($action, "simple-history"); 
     
    16231865            $output .= "</div>"; 
    16241866             
     1867            // second div = when and who 
    16251868            $output .= "<div class='second'>"; 
    1626             // when 
     1869             
    16271870            $date_i18n_date = date_i18n(get_option('date_format'), strtotime($one_row->date), $gmt=false); 
    16281871            $date_i18n_time = date_i18n(get_option('time_format'), strtotime($one_row->date), $gmt=false);       
     
    16311874            $output .= $diff_str; 
    16321875            $output .= "<span class='when_detail'>".sprintf(__('%s at %s', 'simple-history'), $date_i18n_date, $date_i18n_time)."</span>"; 
     1876             
    16331877            $output .= "</div>"; 
     1878 
     1879            // Object image 
     1880            if ( $object_image_out ) { 
     1881 
     1882                $output .= sprintf( 
     1883                    ' 
     1884                    <div class="simple-history-object-image"> 
     1885                        %1$s 
     1886                    </div> 
     1887                    ', 
     1888                    $object_image_out 
     1889                ); 
     1890 
     1891            } 
    16341892 
    16351893            // occasions 
     
    16671925        } 
    16681926         
    1669         if (!$args["is_ajax"]) { 
     1927        if ( ! $args["is_ajax"] ) { 
    16701928 
    16711929            // if not ajax, print the divs and stuff we need 
     
    16771935            $show_more .= "</select>"; 
    16781936 
    1679             $loading = __("Loading...", 'simple-history'); 
    1680             $loading =  "<img src='".site_url("wp-admin/images/loading.gif")."' width=16 height=16>" . $loading; 
    16811937            $no_found = __("No matching items found.", 'simple-history'); 
    16821938            $view_rss = __("RSS feed", 'simple-history'); 
    16831939            $view_rss_link = simple_history_get_rss_address(); 
    16841940            $str_show = __("Show", 'simple-history'); 
    1685             $output .= "</ol> 
    1686             </div> 
    1687             <!-- 
    1688             <p class='simple-history-load-more'>$show_more<input type='button' value='$str_show' class='button' /></p> 
    1689             <p class='hidden simple-history-load-more-loading'>$loading</p> 
    1690             --> 
    1691             <p class='hidden simple-history-no-more-items'>$no_found</p> 
    1692              
    1693             <p class='simple-history-rss-feed-dashboard'><a title='$view_rss' href='$view_rss_link'>$view_rss</a></p> 
    1694             <p class='simple-history-rss-feed-page'><a title='$view_rss' href='$view_rss_link'><span></span>$view_rss</a></p> 
     1941            $output .= "</ol>"; 
     1942 
     1943            $output .= sprintf( ' 
     1944                    <div class="simple-history-loading">%2$s %1$s</div> 
     1945                    ',  
     1946                    __("Loading...", 'simple-history'), // 1 
     1947                    "<img src='".site_url("wp-admin/images/loading.gif")."' width=16 height=16>" 
     1948                ); 
     1949 
     1950            $output .= "</div>"; 
     1951 
     1952            $output .= " 
     1953                <p class='hidden simple-history-no-more-items'>$no_found</p>             
     1954                <p class='simple-history-rss-feed-dashboard'><a title='$view_rss' href='$view_rss_link'>$view_rss</a></p> 
     1955                <p class='simple-history-rss-feed-page'><a title='$view_rss' href='$view_rss_link'><span></span>$view_rss</a></p> 
    16951956            "; 
     1957 
    16961958        } 
    16971959 
  • simple-history/trunk/languages/simple-history-ar.po

    r686348 r701381  
    1414"X-Generator: Poedit 1.5.5\n" 
    1515 
     16# 'action' => $retval[$module]['active'] ? __('activated', 'sh-extender') : __('deactivated', 'sh-extender'), 
     17# 'type'   => __('Simple History Extender Module', 'sh-extender'), 
     18# 'name'   => $field['title'], 
     19msgid "Simple History Extender Module" 
     20msgstr "زيادة التاريخ المبسط" 
     21 
     22# public function modules_settings_intro(){ 
     23# echo '<p>'. __( 'Activate or deactivate the events you want to log. Read the Help tab if you want to know which actions are supported and which aren\'t.', 'sh-extender') .'</p>'; 
     24# } 
     25msgid "" 
     26"Activate or deactivate the events you want to log. Read the Help tab if you " 
     27"want to know which actions are supported and which aren't." 
     28msgstr "" 
     29"قم بتنشيط أو تعطيل الأحداث التي تريد تسجيلها. إقرأ تبويبة مساعدة إذا أردت " 
     30"معرفة الأحداث المدعومة وتلك غير المدعومة." 
     31 
     32# public function register_settings(){ 
     33# add_settings_section( $this->modules_section, __('Simple History Extender Modules', 'sh-extender'), array( $this, 'modules_settings_intro' ), $this->page ); 
     34# register_setting( $this->opt_group, $this->modules_name, array( $this, 'modules_settings_sanitize' ) ); 
     35msgid "Simple History Extender Modules" 
     36msgstr "زيادات التاريخ المبسط" 
     37 
     38# 0 => __('The Simple History Extender plugin was deactivated because the Simple History plugin was not found installed or active.', 'sh-extender'), 
     39# 1 => __('The Simple History Extender plugin was deactivated.', 'sh-extender') 
     40# ); 
     41msgid "The Simple History Extender plugin was deactivated." 
     42msgstr "إضافة زيادات التاريخ المبسط تم تعطيلها." 
     43 
     44# $messages = array( 
     45# 0 => __('The Simple History Extender plugin was deactivated because the Simple History plugin was not found installed or active.', 'sh-extender'), 
     46# 1 => __('The Simple History Extender plugin was deactivated.', 'sh-extender') 
     47msgid "" 
     48"The Simple History Extender plugin was deactivated because the Simple " 
     49"History plugin was not found installed or active." 
     50msgstr "" 
     51"إضافة زيادات التاريخ المبسط تم تعطيلها لأنه لم يتم إيجاد إضافة التاريخ " 
     52"المبسط منصبة أو مفعلة." 
     53 
     54# 
     55# $content .= '</p><p><strong>'. sprintf( __('The %s module does not support the following events:', 'sh-extender'), $this->title ) .'</strong></p><p>'; 
     56# 
     57msgid "The %s module does not support the following events:" 
     58msgstr "زيادة %s لا تدعم الأحداث التالية:" 
     59 
     60# // Build content string starting with supporting events 
     61# $content = '<p><strong>'. sprintf( __('The %s module logs the following events:', 'sh-extender'), $this->title ) .'</strong></p><p>'; 
     62# 
     63msgid "The %s module logs the following events:" 
     64msgstr "زيادة %s تسجل الأحداث التالية:" 
     65 
     66# ? sprintf( __('Log events for the %s plugin.', 'sh-extender'), $this->title ) 
     67# : sprintf( __('Log events for %s.', 'sh-extender'), $this->title ) 
     68# ); 
     69msgid "Log events for %s." 
     70msgstr "سجل أحداث %s." 
     71 
     72# else 
     73# $action = __('added to sidebar %s', 'sh-extender'); 
     74# 
     75msgid "added to sidebar %s" 
     76msgstr "تمت الإضافة إلى مربع جانبي %s" 
     77 
     78# elseif ( isset( $wp_registered_widgets[$_POST['widget-id']] ) ) 
     79# $action = __('updated in sidebar %s', 'sh-extender'); 
     80# else 
     81msgid "updated in sidebar %s" 
     82msgstr "تم التحديث في مربع جانبي %s" 
     83 
     84# if ( isset( $_POST['delete_widget'] ) ) 
     85# $action = __('removed from sidebar %s', 'sh-extender'); 
     86# elseif ( isset( $wp_registered_widgets[$_POST['widget-id']] ) ) 
     87msgid "removed from sidebar %s" 
     88msgstr "تم الحذف من مربع جانبي %s" 
     89 
     90# $bbp_roles = bbp_get_dynamic_roles(); 
     91# $this->extend_user( $user_id, sprintf( __('changed forum role to %s', 'sh-extender'), !empty( $new_role ) ? translate_user_role( $bbp_roles[$new_role]['name'] ) : __('none') ) ); 
     92# } 
     93msgid "changed forum role to %s" 
     94msgstr "تم تغيير دور المنتدى إلى %s" 
     95 
     96# public function user_register( $user_id ){ 
     97# $this->extend_user( $user_id, __('registered', 'sh-extender') ); 
     98# } 
     99msgid "registered" 
     100msgstr "تم التسجيل" 
     101 
     102# public function profile_update( $user_id, $old_user_data ){ 
     103# $this->extend_user( $user_id, __('profile updated', 'sh-extender') ); 
     104# } 
     105msgid "profile updated" 
     106msgstr "تم تحديث الملف الشخصي" 
     107 
     108# public function remove_user_subscription( $user_id, $topic_id ){ 
     109# $this->extend_topic( $topic_id, __('unsubscribed', 'sh-extender') ); 
     110# } 
     111msgid "unsubscribed" 
     112msgstr "تم إلغاء الاشتراك" 
     113 
     114# public function add_user_subscription( $user_id, $topic_id ){ 
     115# $this->extend_topic( $topic_id, __('subscribed', 'sh-extender') ); 
     116# } 
     117msgid "subscribed" 
     118msgstr "تم الاشتراك" 
     119 
     120# public function remove_user_favorite( $user_id, $topic_id ){ 
     121# $this->extend_topic( $topic_id, __('unfavorited', 'sh-extender') ); 
     122# } 
     123msgid "unfavorited" 
     124msgstr "تم إلغاء التفضيل" 
     125 
     126# public function add_user_favorite( $user_id, $topic_id ){ 
     127# $this->extend_topic( $topic_id, __('favorited', 'sh-extender') ); 
     128# } 
     129msgid "favorited" 
     130msgstr "تم التفضيل" 
     131 
     132# $topic_id, 
     133# $this->events['edit'] .' '. sprintf( __('in forum %s', 'sh-extender'), bbp_get_forum_title( $forum_id ) ) 
     134# ); 
     135msgid "in forum %s" 
     136msgstr "في منتدى %s" 
     137 
     138# 'action' => sprintf( __('by %s', 'sh-extender'), $user->user_login ) .' '. $action, 
     139# 'type'   => __('Reply', 'bbpress'), 
     140# 'name'   => bbp_get_reply_title( $reply_id ), 
     141msgid "Reply" 
     142msgstr "رد" 
     143 
     144# $this->extend( array( 
     145# 'action' => sprintf( __('by %s', 'sh-extender'), $user->user_login ) .' '. $action, 
     146# 'type'   => __('Reply', 'bbpress'), 
     147msgid "by %s" 
     148msgstr "عن طريق %s" 
     149 
     150# 'action' => $action, 
     151# 'type'   => __('Topic Tag', 'bbpress'), 
     152# 'name'   => bbp_get_topic_tag_name( $tag ), 
     153msgid "Topic Tag" 
     154msgstr "وسم موضوع" 
     155 
     156# 'action'  => $action, 
     157# 'type'    => __('Topic', 'bbpress'), 
     158# 'name'    => bbp_get_topic_title( $topic_id ), 
     159msgid "Topic" 
     160msgstr "موضوع" 
     161 
     162# 'action' => $action, 
     163# 'type'   => __('Forum', 'bbpress'), 
     164# 'name'   => bbp_get_forum_title( $forum_id ), 
     165msgid "Forum" 
     166msgstr "منتدى" 
     167 
     168# default: 
     169# $action = __('changed status', 'sh-extender'); 
     170# } 
     171msgid "changed status" 
     172msgstr "تم تغيير الحالة" 
     173 
     174# default : 
     175# $action = __('restored', 'sh-extender'); 
     176# } 
     177msgid "restored" 
     178msgstr "تم الاستعادة" 
     179 
     180# $form_id, 
     181# sprintf( __('field %s deleted', 'sh-extender'), $field['label'] .' (ID: '. $field_id .')' ) 
     182# ); 
     183msgid "field %s deleted" 
     184msgstr "تم حذف حقل %s" 
     185 
     186# ? __('without entries deleted', 'sh-extender') 
     187# : sprintf( __('with %d entries deleted', 'sh-extender'), $entries ) 
     188# ); 
     189msgid "with %d entries deleted" 
     190msgstr "مع %d مدخل تم حذفه" 
     191 
     192# 0 == $entries 
     193# ? __('without entries deleted', 'sh-extender') 
     194# : sprintf( __('with %d entries deleted', 'sh-extender'), $entries ) 
     195msgid "without entries deleted" 
     196msgstr "بدون حذف مدخلات" 
     197 
     198# 'action' => $created_by ? $this->created_by( $entry_id ) . $action : $action, 
     199# 'type'   => __('Form entry', 'sh-extender'), 
     200# 'name'   => $this->entry_form_title( $entry_id ), 
     201msgid "Form entry" 
     202msgstr "مدخل استمارة" 
     203 
     204# 'action' => $action, 
     205# 'type'   => __('Form', 'sh-extender'), 
     206# 'name'   => $this->form_title( $form_id ), 
     207msgid "Form" 
     208msgstr "استمارة" 
     209 
     210# } else 
     211# $from = __('from unknown', 'sh-extender'); 
     212# 
     213msgid "from unknown" 
     214msgstr "بواسطة غير معروف" 
     215 
     216# $user = get_userdata( $user_id ); 
     217# $from = sprintf( __('from %s', 'sh-extender'), $user->user_login ); 
     218# } else 
     219msgid "from %s" 
     220msgstr "بواسطة %s" 
     221 
     222# echo "<div class='simple-history-settings-page-updated'><p>"; 
     223# _e("Created new secret RSS address", 'simple-history'); 
     224# echo "</p></div>"; 
     225msgid "Created new secret RSS address" 
     226msgstr "تم إنشاء عنوان تغذية RSS سري جديد" 
     227 
     228# $dummy = __("modified", "simple-history"); 
     229# $dummy = __("upgraded it\'s database", "simple-history"); 
     230# } 
     231msgid "upgraded it's database" 
     232msgstr "تم تحديث قاعدة بياناته" 
     233 
     234# $dummy = __("added", "simple-history"); 
     235# $dummy = __("modified", "simple-history"); 
     236# $dummy = __("upgraded it\'s database", "simple-history"); 
     237msgid "modified" 
     238msgstr "تم التعديل" 
     239 
     240# $dummy = __("logged out", "simple-history"); 
     241# $dummy = __("added", "simple-history"); 
     242# $dummy = __("modified", "simple-history"); 
     243msgid "added" 
     244msgstr "تمت الإضافة" 
     245 
     246# __('Moving widgets between sidebars.', 'sh-extender'), 
     247# __('Setting a widget to active/inactive.', 'sh-extender') 
     248# ) 
     249msgid "Setting a widget to active/inactive." 
     250msgstr "تعيين مربع جانبي كمفعل/معطل." 
     251 
     252# 'lacks'    => array( 
     253# __('Moving widgets between sidebars.', 'sh-extender'), 
     254# __('Setting a widget to active/inactive.', 'sh-extender') 
     255msgid "Moving widgets between sidebars." 
     256msgstr "تحويل المربعات الجانبية من مكان إلى آخر." 
     257 
     258# 'supports' => array( 
     259# __('Adding, updating and deleting widgets in/from a sidebar.', 'sh-extender'), 
     260# ), 
     261msgid "Adding, updating and deleting widgets in/from a sidebar." 
     262msgstr "إضافة، تحديث وحذف مربعات جانبية." 
     263 
     264# 'plugin'      => false, 
     265# 'description' => __('Log events for the Widgets section of your WP install.', 'sh-extender'), 
     266# 'tabs'        => array( 
     267msgid "Log events for the Widgets section of your WP install." 
     268msgstr "قم بتسجيل الأحداث في قسم المربعات الجانبية في تنصيب ووردبريس الخاص بك." 
     269 
     270# 'id'          => 'widgets', 
     271# 'title'       => __('Widgets', 'sh-extender'), 
     272# 'plugin'      => false, 
     273msgid "Widgets" 
     274msgstr "المربعات الجانبية" 
     275 
     276# 'read'   => __('marked as read', 'sh-extender'), 
     277# 'unread' => __('marked as unread', 'sh-extender'), 
     278# ); 
     279msgid "marked as unread" 
     280msgstr "تم التعيين كغير مقروء" 
     281 
     282# 'unstar' => __('unstarred', 'sh-extender'), 
     283# 'read'   => __('marked as read', 'sh-extender'), 
     284# 'unread' => __('marked as unread', 'sh-extender'), 
     285msgid "marked as read" 
     286msgstr "تم التعيين كمقروء" 
     287 
     288# 'star'   => __('starred', 'sh-extender'), 
     289# 'unstar' => __('unstarred', 'sh-extender'), 
     290# 'read'   => __('marked as read', 'sh-extender'), 
     291msgid "unstarred" 
     292msgstr "تم إلغاء التفضيل" 
     293 
     294# $events = array( 
     295# 'star'   => __('starred', 'sh-extender'), 
     296# 'unstar' => __('unstarred', 'sh-extender'), 
     297msgid "starred" 
     298msgstr "تم التفضيل" 
     299 
     300# __('Duplicating a form.', 'sh-extender'), 
     301# __('Setting a form to active/inactive.', 'sh-extender') 
     302# ) 
     303msgid "Setting a form to active/inactive." 
     304msgstr "تعيين استمارة كمفعلة/معطلة." 
     305 
     306# 'lacks'    => array( 
     307# __('Duplicating a form.', 'sh-extender'), 
     308# __('Setting a form to active/inactive.', 'sh-extender') 
     309msgid "Duplicating a form." 
     310msgstr "نسخ استمارة." 
     311 
     312# __('Submitting, editing and deleting an entry.', 'sh-extender'), 
     313# __('Changing the status of an entry, including read/unread and star/unstar.', 'sh-extender') 
     314# ), 
     315msgid "Changing the status of an entry, including read/unread and star/unstar." 
     316msgstr "تغيير حالة مدخل، يتضمن ذلك مقروء/غير مقروء وتفضيل/إلغاء تفضيل." 
     317 
     318# __('Deleting a field from an existing form.', 'sh-extender'), 
     319# __('Submitting, editing and deleting an entry.', 'sh-extender'), 
     320# __('Changing the status of an entry, including read/unread and star/unstar.', 'sh-extender') 
     321msgid "Submitting, editing and deleting an entry." 
     322msgstr "إرسال، تعديل وحذف مدخل." 
     323 
     324# __('Creating, editing and deleting a form.', 'sh-extender'), 
     325# __('Deleting a field from an existing form.', 'sh-extender'), 
     326# __('Submitting, editing and deleting an entry.', 'sh-extender'), 
     327msgid "Deleting a field from an existing form." 
     328msgstr "حذف حقل من استمارة موجودة." 
     329 
     330# 'supports' => array( 
     331# __('Creating, editing and deleting a form.', 'sh-extender'), 
     332# __('Deleting a field from an existing form.', 'sh-extender'), 
     333msgid "Creating, editing and deleting a form." 
     334msgstr "إنشاء، تعديل وحذف استمارة." 
     335 
     336# 'id'     => 'gravityforms', 
     337# 'title'  => __('Gravity Forms', 'sh-extender'), 
     338# 'plugin' => 'gravityforms/gravityforms.php', 
     339msgid "Gravity Forms" 
     340msgstr "Gravity Forms" 
     341 
     342# 'merge'       => __('in forum %s merged into %s', 'sh-extender'), 
     343# 'split'       => __('in forum %s split from reply %s by %s into %s in forum %s', 'sh-extender') 
     344# ); 
     345msgid "in forum %s split from reply %s by %s into %s in forum %s" 
     346msgstr "في منتدى %s تم الفصل من رد %s بواسطة %s في %s في منتدى %s" 
     347 
     348# 'hide'        => __('set to hidden', 'sh-extender'), 
     349# 'merge'       => __('in forum %s merged into %s', 'sh-extender'), 
     350# 'split'       => __('in forum %s split from reply %s by %s into %s in forum %s', 'sh-extender') 
     351msgid "in forum %s merged into %s" 
     352msgstr "في منتدى %s تم الدمج في %s" 
     353 
     354# 'privatize'   => __('set to private', 'sh-extender'), 
     355# 'hide'        => __('set to hidden', 'sh-extender'), 
     356# 'merge'       => __('in forum %s merged into %s', 'sh-extender'), 
     357msgid "set to hidden" 
     358msgstr "تم التعيين كمخفي" 
     359 
     360# 'publicize'   => __('set to public', 'sh-extender'), 
     361# 'privatize'   => __('set to private', 'sh-extender'), 
     362# 'hide'        => __('set to hidden', 'sh-extender'), 
     363msgid "set to private" 
     364msgstr "تم التعيين كخاص" 
     365 
     366# 'normalize'   => __('set to forum type', 'sh-extender'), 
     367# 'publicize'   => __('set to public', 'sh-extender'), 
     368# 'privatize'   => __('set to private', 'sh-extender'), 
     369msgid "set to public" 
     370msgstr "تم التعيين كعام" 
     371 
     372# 'categorize'  => __('set to category type', 'sh-extender'), 
     373# 'normalize'   => __('set to forum type', 'sh-extender'), 
     374# 'publicize'   => __('set to public', 'sh-extender'), 
     375msgid "set to forum type" 
     376msgstr "تعيين لنوع منتدي" 
     377 
     378# 'unstick'     => __('unmarked as sticky', 'sh-extender'), 
     379# 'categorize'  => __('set to category type', 'sh-extender'), 
     380# 'normalize'   => __('set to forum type', 'sh-extender'), 
     381msgid "set to category type" 
     382msgstr "تعيين لنوع تصنيف" 
     383 
     384# 'super-stick' => __('marked as super sticky', 'sh-extender'), 
     385# 'unstick'     => __('unmarked as sticky', 'sh-extender'), 
     386# 'categorize'  => __('set to category type', 'sh-extender'), 
     387msgid "unmarked as sticky" 
     388msgstr "تم حذف التعليم كمثبت" 
     389 
     390# 'stick'       => __('marked as sticky', 'sh-extender'), 
     391# 'super-stick' => __('marked as super sticky', 'sh-extender'), 
     392# 'unstick'     => __('unmarked as sticky', 'sh-extender'), 
     393msgid "marked as super sticky" 
     394msgstr "تم التعليم كمثبت جداً" 
     395 
     396# 'open'        => __('opened', 'sh-extender'), 
     397# 'stick'       => __('marked as sticky', 'sh-extender'), 
     398# 'super-stick' => __('marked as super sticky', 'sh-extender'), 
     399msgid "marked as sticky" 
     400msgstr "تم التعليم كمثبت" 
     401 
     402# 'close'       => __('closed', 'sh-extender'), 
     403# 'open'        => __('opened', 'sh-extender'), 
     404# 'stick'       => __('marked as sticky', 'sh-extender'), 
     405msgid "opened" 
     406msgstr "تم الفتح" 
     407 
     408# $events = array( 
     409# 'close'       => __('closed', 'sh-extender'), 
     410# 'open'        => __('opened', 'sh-extender'), 
     411msgid "closed" 
     412msgstr "تم الإغلاق" 
     413 
     414# 'untrash' => __('untrashed', 'sh-extender'), 
     415# 'submit'  => __('submitted', 'sh-extender') 
     416# ); 
     417msgid "submitted" 
     418msgstr "تم الإرسال" 
     419 
     420# 'spam'    => __('marked as spam', 'sh-extender'), 
     421# 'unspam'  => __('unmarked as spam', 'sh-extender'), 
     422# 'trash'   => __('trashed', 'sh-extender'), 
     423msgid "unmarked as spam" 
     424msgstr "تم حذف التعليم كمزعج" 
     425 
     426# : ( $this->plugin 
     427# ? sprintf( __('Log events for the %s plugin.', 'sh-extender'), $this->title ) 
     428# : sprintf( __('Log events for %s.', 'sh-extender'), $this->title ) 
     429msgid "Log events for the %s plugin." 
     430msgstr "سجل الأحداث للإضافة %s." 
     431 
     432# __('A user (un)favoriting and (un)subscribing to a topic.', 'sh-extender'), 
     433# __('A user saving his/her profile.', 'sh-extender') 
     434# ) 
     435msgid "A user saving his/her profile." 
     436msgstr "مستخدم يقوم بحفظ ملفه الشخصي" 
     437 
     438# __('Updating, merging and deleting a topic tag.', 'sh-extender'), 
     439# __('A user (un)favoriting and (un)subscribing to a topic.', 'sh-extender'), 
     440# __('A user saving his/her profile.', 'sh-extender') 
     441msgid "A user (un)favoriting and (un)subscribing to a topic." 
     442msgstr "مستخدم يقوم بإلغاء تفضيل وإلغاء اشتراك في موضوع." 
     443 
     444# __('Merging and splitting a topic.', 'sh-extender'), 
     445# __('Updating, merging and deleting a topic tag.', 'sh-extender'), 
     446# __('A user (un)favoriting and (un)subscribing to a topic.', 'sh-extender'), 
     447msgid "Updating, merging and deleting a topic tag." 
     448msgstr "تحديث، دمج وحذف وسم موضوع." 
     449 
     450# __('Marking and unmarking a topic as sticky.', 'sh-extender'), 
     451# __('Merging and splitting a topic.', 'sh-extender'), 
     452# __('Updating, merging and deleting a topic tag.', 'sh-extender'), 
     453msgid "Merging and splitting a topic." 
     454msgstr "دمج وفصل موضوع." 
     455 
     456# __('Marking and unmarking a topic, reply as spam.', 'sh-extender'), 
     457# __('Marking and unmarking a topic as sticky.', 'sh-extender'), 
     458# __('Merging and splitting a topic.', 'sh-extender'), 
     459msgid "Marking and unmarking a topic as sticky." 
     460msgstr "تعليم وإلغاء تعليم موضوع كمثبت." 
     461 
     462# __('Trashing and untrashing a forum, topic, reply.', 'sh-extender'), 
     463# __('Marking and unmarking a topic, reply as spam.', 'sh-extender'), 
     464# __('Marking and unmarking a topic as sticky.', 'sh-extender'), 
     465msgid "Marking and unmarking a topic, reply as spam." 
     466msgstr "تعليم وإلغاء تعليم موضوع أو تعليق كمزعج." 
     467 
     468# __('Setting the forum visibility to public, private or hidden.', 'sh-extender'), 
     469# __('Trashing and untrashing a forum, topic, reply.', 'sh-extender'), 
     470# __('Marking and unmarking a topic, reply as spam.', 'sh-extender'), 
     471msgid "Trashing and untrashing a forum, topic, reply." 
     472msgstr "مسح وإلغاء مسح منتدى، موضوع، رد." 
     473 
     474# __('Setting the status of a forum, topic to open or closed.', 'sh-extender'), 
     475# __('Setting the forum visibility to public, private or hidden.', 'sh-extender'), 
     476# __('Trashing and untrashing a forum, topic, reply.', 'sh-extender'), 
     477msgid "Setting the forum visibility to public, private or hidden." 
     478msgstr "تعيين رؤية منتدى لعام، خاص أو مخفي." 
     479 
     480# __('Setting the type of a forum to category or forum.', 'sh-extender'), 
     481# __('Setting the status of a forum, topic to open or closed.', 'sh-extender'), 
     482# __('Setting the forum visibility to public, private or hidden.', 'sh-extender'), 
     483msgid "Setting the status of a forum, topic to open or closed." 
     484msgstr "تعيين حالة منتدى أو موضوع كمفتوح أو مغلق." 
     485 
     486# __('Creating, editing and deleting a forum, topic, reply.', 'sh-extender'), 
     487# __('Setting the type of a forum to category or forum.', 'sh-extender'), 
     488# __('Setting the status of a forum, topic to open or closed.', 'sh-extender'), 
     489msgid "Setting the type of a forum to category or forum." 
     490msgstr "تعيين نوع منتدى لتصنيف أو منتدى." 
     491 
     492# 'supports' => array( 
     493# __('Creating, editing and deleting a forum, topic, reply.', 'sh-extender'), 
     494# __('Setting the type of a forum to category or forum.', 'sh-extender'), 
     495msgid "Creating, editing and deleting a forum, topic, reply." 
     496msgstr "إنشاء، تعديل أو حذف منتدى، موضوع، رد." 
     497 
     498# 'id'     => 'bbpress', 
     499# 'title'  => __('BBPress', 'sh-extender'), 
     500# 'plugin' => 'bbpress/bbpress.php', 
     501msgid "BBPress" 
     502msgstr "BBPress" 
     503 
    16504# echo "<br />"; 
    17505# _e("This is a secret RSS feed for Simple History. Only share the link with people you trust", 'simple-history'); 
     
    21509"people you trust" 
    22510msgstr "هذه تغذية RSS سرّية خاصة بالتاريخ. شارك الرابط فقط مع أناس تثق بهم." 
    23  
    24 # echo "<div class='simple-history-settings-page-updated'><p>"; 
    25 # _e("Created new secret RSS adress", 'simple-history'); 
    26 # echo "</p></div>"; 
    27 msgid "Created new secret RSS adress" 
    28 msgstr "تم إنشاء عنوان RSS سرّي جديد" 
    29511 
    30512# <?php 
     
    190672msgstr "تم التفعيل" 
    191673 
    192 # case "deactivated": 
    193 # $unknown_action = __("deactivated", 'simple-history'); 
    194 # break; 
     674# Simple_History_Extend::extend( array( 
     675# 'action' => $retval[$module]['active'] ? __('activated', 'sh-extender') : __('deactivated', 'sh-extender'), 
     676# 'type'   => __('Simple History Extender Module', 'sh-extender'), 
    195677msgid "deactivated" 
    196678msgstr "تم التعطيل" 
    197679 
    198 # case "activated": 
    199 # $unknown_action = __("activated", 'simple-history'); 
    200 # break; 
     680# Simple_History_Extend::extend( array( 
     681# 'action' => $retval[$module]['active'] ? __('activated', 'sh-extender') : __('deactivated', 'sh-extender'), 
     682# 'type'   => __('Simple History Extender Module', 'sh-extender'), 
    201683msgid "activated" 
    202684msgstr "تم التنشيط" 
     
    236718msgstr "امسحها الآن." 
    237719 
    238 # $link = esc_html(add_query_arg("simple_history_user_to_show", "")); 
    239 # $str_users .= "<li $css><a href='$link'>" . __("By all users", 'simple-history') ."</a> | </li>"; 
    240 # foreach ($arr_users as $user_id => $user_info) { 
     720# $user = $_POST["user"]; 
     721# if ($user == __( "By all users", 'simple-history' )) { $user = "";    } 
     722# 
    241723msgid "By all users" 
    242724msgstr "عن طريق جميع الأعضاء" 
     
    256738# <title><?php printf(__("History for %s", 'simple-history'), get_bloginfo("name")) ?></title> 
    257739# <description><?php printf(__("WordPress History for %s", 'simple-history'), get_bloginfo("name")) ?></description> 
    258 # <link><?php echo get_bloginfo("siteurl") ?></link> 
     740# <link><?php echo get_bloginfo("url") ?></link> 
    259741msgid "WordPress History for %s" 
    260742msgstr "تاريخ ووردبريس ل%s" 
     
    272754msgstr "مسح السجل" 
    273755 
    274 # $no_found = __("No matching items found.", 'simple-history'); 
    275 # $view_rss = __("RSS feed", 'simple-history'); 
    276 # $view_rss_link = simple_history_get_rss_address(); 
     756# add_settings_field("simple_history_settings_field_5", __("Number of items per page", "simple-history"),       "simple_history_settings_field_number_of_items",            "simple_history_settings_menu_slug", "simple_history_settings_section"); 
     757# add_settings_field("simple_history_settings_field_2", __("RSS feed", "simple-history"),           "simple_history_settings_field_rss",                        "simple_history_settings_menu_slug", "simple_history_settings_section"); 
     758# add_settings_field("simple_history_settings_field_4", __("Clear log", "simple-history"),          "simple_history_settings_field_clear_log",                  "simple_history_settings_menu_slug", "simple_history_settings_section"); 
    277759msgid "RSS feed" 
    278760msgstr "تغذية RSS" 
     
    290772msgstr "إظهار التاريخ المبسط" 
    291773 
    292 # <form method="post" action="options.php"> 
    293 # <h2><?php _e("Simple History Settings", "simple-history") ?></h2> 
    294 # <?php do_settings_sections("simple_history_settings_menu_slug"); ?> 
     774# if ($show_settings_page) { 
     775# add_options_page(__('Simple History Settings', "simple-history"), SIMPLE_HISTORY_NAME, $this->view_history_capability, "simple_history_settings_menu_slug", array($this, 'settings_page')); 
     776# } 
    295777msgid "Simple History Settings" 
    296778msgstr "إعدادات التاريخ المبسط" 
    297779 
    298 # add_settings_field("simple_history_settings_field_4", __("Clear log", "simple-history"),          "simple_history_settings_field_clear_log",                  "simple_history_settings_menu_slug", "simple_history_settings_section"); 
    299 # add_settings_field("simple_history_settings_field_3", __("Donate", "simple-history"),                 "simple_history_settings_field_donate",                     "simple_history_settings_menu_slug", "simple_history_settings_section"); 
    300 # 
     780# $links, 
     781# array( sprintf( '<a href="http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=pluginpage&utm_campaign=simplehistory">%1$s</a>', __('Donate', "simple-history") ) ) 
     782# ); 
    301783msgid "Donate" 
    302784msgstr "تبرع" 
     
    308790msgstr "ووردبريس %1$s" 
    309791 
    310 # <div class="wrap"> 
    311 # <h2><?php echo __("History", 'simple-history') ?></h2> 
    312 # <?php 
     792# if (current_user_can($this->view_history_capability)) { 
     793# wp_add_dashboard_widget("simple_history_dashboard_widget", __("History", 'simple-history'), "simple_history_dashboard"); 
     794# } 
    313795msgid "History" 
    314796msgstr "التاريخ" 
     
    316798# $dummy = __("logged in", "simple-history"); 
    317799# $dummy = __("logged out", "simple-history"); 
    318 # } 
     800# $dummy = __("added", "simple-history"); 
    319801msgid "logged out" 
    320802msgstr "سجّل الخروج" 
     
    332814msgstr "تعليق" 
    333815 
    334 # $dummy = __("settings page", "simple-history"); 
    335 # $dummy = __("edited", "simple-history"); 
    336 # $dummy = __("comment", "simple-history"); 
     816# 'new'     => __('created', 'sh-extender'), 
     817# 'edit'    => __('edited', 'sh-extender'), 
     818# 'delete'  => __('deleted', 'sh-extender'), 
    337819msgid "edited" 
    338820msgstr "تم التحرير" 
     
    344826msgstr "صفحة الإعدادات" 
    345827 
    346 # $user_out = ""; 
    347 # $user_out .= __("user", 'simple-history'); 
    348 # $user = get_user_by("id", $object_id); 
     828# 'action' => $action, 
     829# 'type'   => __('User'), 
     830# 'name'   => apply_filters( 'she_extend_user_name', $user->user_login ), 
    349831msgid "user" 
    350832msgstr "المستخدم" 
    351833 
    352 # $attachment_out = ""; 
    353 # $attachment_out .= __("attachment", 'simple-history') . " "; 
    354 # 
     834# $dummy = __("nav_menu_item", "simple-history"); 
     835# $dummy = __("attachment", "simple-history"); 
     836# $dummy = __("user", "simple-history"); 
    355837msgid "attachment" 
    356838msgstr "المرفق" 
     
    362844msgstr "عنصر القائمة" 
    363845 
    364 # $dummy = __("deleted", "simple-history"); 
    365 # $dummy = __("updated", "simple-history"); 
    366 # $dummy = __("nav_menu_item", "simple-history"); 
     846# $args = array( 
     847# 'action'         => isset( $r['action']  ) ? $r['action']  : __('updated'), 
     848# 'object_type'    => isset( $r['type']    ) ? $r['type']    : null, 
    367849msgid "updated" 
    368850msgstr "تم التحديث" 
    369851 
    370 # $dummy = __("created", "simple-history"); 
    371 # $dummy = __("deleted", "simple-history"); 
    372 # $dummy = __("updated", "simple-history"); 
     852# 'edit'    => __('edited', 'sh-extender'), 
     853# 'delete'  => __('deleted', 'sh-extender'), 
     854# 'spam'    => __('marked as spam', 'sh-extender'), 
    373855msgid "deleted" 
    374856msgstr "تم الحذف" 
    375857 
    376 # $dummy = __("untrashed", "simple-history"); 
    377 # $dummy = __("created", "simple-history"); 
    378 # $dummy = __("deleted", "simple-history"); 
     858# $events = array( 
     859# 'new'     => __('created', 'sh-extender'), 
     860# 'edit'    => __('edited', 'sh-extender'), 
    379861msgid "created" 
    380862msgstr "تم الإنشاء" 
    381863 
    382 # $dummy = __("trashed", "simple-history"); 
    383 # $dummy = __("untrashed", "simple-history"); 
    384 # $dummy = __("created", "simple-history"); 
     864# 'trash'   => __('trashed', 'sh-extender'), 
     865# 'untrash' => __('untrashed', 'sh-extender'), 
     866# 'submit'  => __('submitted', 'sh-extender') 
    385867msgid "untrashed" 
    386868msgstr "تم إلغاء الحذف" 
    387869 
    388 # $dummy = __("marked as spam", "simple-history"); 
    389 # $dummy = __("trashed", "simple-history"); 
    390 # $dummy = __("untrashed", "simple-history"); 
     870# 'unspam'  => __('unmarked as spam', 'sh-extender'), 
     871# 'trash'   => __('trashed', 'sh-extender'), 
     872# 'untrash' => __('untrashed', 'sh-extender'), 
    391873msgid "trashed" 
    392874msgstr "تم الحذف" 
    393875 
    394 # $dummy = __("unapproved", "simple-history"); 
    395 # $dummy = __("marked as spam", "simple-history"); 
    396 # $dummy = __("trashed", "simple-history"); 
     876# 'delete'  => __('deleted', 'sh-extender'), 
     877# 'spam'    => __('marked as spam', 'sh-extender'), 
     878# 'unspam'  => __('unmarked as spam', 'sh-extender'), 
    397879msgid "marked as spam" 
    398880msgstr "تم التعليم كتعليق غير مرغوب فيه" 
  • simple-history/trunk/readme.txt

    r699313 r701381  
    22Contributors: eskapism, MarsApril, offereins 
    33Donate link: http://eskapism.se/sida/donate/ 
    4 Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, cms, dashboard, admin 
     4Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, cms, dashboard, admin, syslog 
    55Requires at least: 3.5.1 
    66Tested up to: 3.5.1 
     
    1717Out of the box Simple History has support for: 
    1818 
    19 * **Posts and pages - see who added, updated or deleted a post or page 
     19* **Posts and pages** - see who added, updated or deleted a post or page 
    2020* **Attachments** - see who added, updated or deleted an attachment 
    2121* **Comments** - see who edited, approved or removed a comment 
     
    2727* **Gravity Forms** - see who created, edited or deleted a form, field, or entry 
    2828 
     29With it's easy to use Extender system, developers can add their own settings and items to track. 
     30 
    2931There is also a **RSS feed of changes** available, so you can keep track of the changes made 
    3032via your favorite RSS reader on your phone, on your iPad, or on your computer. 
     
    9294` 
    9395 
    94 ####  Translations/Languages 
     96#### Filters 
     97 
     98Available filters if you want to modify any behavior 
     99 
     100* simple_history_rss_item_title 
     101* simple_history_view_history_capability 
     102* simple_history_show_settings_page 
     103* simple_history_rss_item_description 
     104* simple_history_rss_item_title 
     105* simple_history_show_on_dashboard 
     106* simple_history_show_as_page 
     107* simple_history_allow_db_purge 
     108* simple_history_db_purge_days_interval 
     109 
     110 
     111#### Translations/Languages 
    95112 
    96113This plugin is available in the following languages: 
     
    105122Lots of thanks to the translators! 
    106123 
     124#### Contribute at GitHub 
     125Development of this plugin takes place at GitHub. Please join in with feature requests, bug reports, or even pull requests! 
     126https://github.com/bonny/WordPress-Simple-History 
     127 
    107128#### Donation and more plugins 
    108129* If you like this plugin don't forget to [donate to support further development](http://eskapism.se/sida/donate/). 
     
    118139 
    119140== Feedback == 
     141 
    120142Like the plugin? Dislike it? Got bugs or feature request? 
    121 Great! Contact me at par.thernstrom@gmail.com or at twitter.com/eskapism and hopefully  
     143Great! Contact me at par.thernstrom@gmail.com or at https://twitter.com/eskapism and hopefully  
    122144I can do something about it. 
     145 
    123146 
    124147== Screenshots == 
     
    1331564. Widgets can be tracked too! 
    134157 
     158 
    135159== Changelog == 
    136160 
    137161= 1.x = 
    138 - Fixed: Plugin name is included when plugin is deactivated. Previosuly only folder name and name of php file was included. 
     162- Fixed: Plugin name is included when plugins is activated or deactivated. Previosuly only folder name and name of php file was included. 
     163- Changed: Filters now use dropdowns for type and user. When a site had lots of users and lots of post types, the filter section could be way to big. 
     164- Added keyboard navigation. Use right and left arrow when you are on Simple History's own page to navigation between next and previous history page. 
     165- Added loading indicator, so you know it's grabbing your history, even if it's taking a while 
    139166 
    140167= 1.1 = 
  • simple-history/trunk/scripts.js

    r605848 r701381  
    11 
    22/** 
    3  *  load history items via ajax 
     3 * Object for Simple History 
    44 */ 
    5 var simple_history_current_page = 0; 
     5var simple_history = (function($) { 
     6 
     7    var elms = {}; 
     8 
     9    function init() { 
     10         
     11        // Only add JS things if Simple History exists on page 
     12        if (! $("div.simple-history-ol-wrapper").length) { 
     13            return; 
     14        } 
     15 
     16        // setup elements 
     17        elms.wrap = $(".simple-history-wrap"); 
     18        elms.ol_wrapper = elms.wrap.find(".simple-history-ol-wrapper"); 
     19 
     20        // so wrapper does not collapse when loading new items 
     21        elms.ol_wrapper.height( elms.ol_wrapper.height() ); 
     22 
     23        addListeners(); 
     24 
     25        elms.wrap.addClass("simple-history-is-ready simple-history-has-items"); 
     26    } 
     27 
     28    function addListeners() { 
     29 
     30        /* 
     31            Character codes: 
     32            37 - left 
     33            38 - up 
     34            39 - right 
     35            40 - down 
     36        */ 
     37         
     38        // Enable keyboard navigation if we are on Simple Historys own page 
     39        if ( $(".dashboard_page_simple_history_page").length ) { 
     40             
     41            $(document).keydown(function(e) { 
     42                 
     43                var link_to_click = null; 
     44 
     45                if (e.keyCode == 37) { 
     46                    link_to_click = ".prev-page"; 
     47                } else if (e.keyCode == 39) { 
     48                    link_to_click = ".next-page"; 
     49                } 
     50 
     51                if (link_to_click) { 
     52                    $(".simple-history-tablenav").find(link_to_click).trigger("click"); 
     53                } 
     54 
     55            }); 
     56 
     57        } 
     58 
     59        // show occasions 
     60        $("a.simple-history-occasion-show").live("click", function(e) { 
     61            $(this).closest("li").find("ul.simple-history-occasions").toggle("fast"); 
     62            e.preventDefault(); 
     63        }); 
     64 
     65 
     66    } // function 
     67 
     68    /** 
     69     * Get currently selected filters 
     70     * @return object with type, subtype, user_id 
     71     */ 
     72    function get_selected_filters() { 
     73 
     74        var obj = { 
     75            type:  $("select.simple-history-filter-type option:selected").data("simple-history-filter-type"), 
     76            subtype: $("select.simple-history-filter-type option:selected").data("simple-history-filter-subtype"), 
     77            user_id: $("select.simple-history-filter-user option:selected").data("simple-history-filter-user-id") 
     78        }; 
     79 
     80        return obj; 
     81 
     82    } 
     83 
     84    return { 
     85        "init": init, 
     86        "get_selected_filters": get_selected_filters 
     87    }; 
     88 
     89})(jQuery); 
     90 
     91jQuery(function() { 
     92    simple_history.init(); 
     93}); 
     94 
     95 
     96// the current page 
     97var simple_history_current_page = 0, 
     98    simple_history_jqXHR = null; 
    699 
    7100// search on enter 
     
    21114}); 
    22115 
    23 // click on filter-link = load new via ajax 
     116// click on filter-link/change value is filter dropdowns = load new via ajax 
    24117// begin at position 0 unless click on pagination then check pagination page 
    25 jQuery(".simple-history-filter a, .simple-history-filter input[type='button'], .simple-history-tablenav a").live("click", function(e, extraParams) { 
     118jQuery("select.simple-history-filter, .simple-history-filter a, .simple-history-filter input[type='button'], .simple-history-tablenav a").live("click change", function(e, extraParams) { 
    26119 
    27120    var $t = jQuery(this), 
     
    31124        search = jQuery("p.simple-history-filter-search input[type='text']").val(), 
    32125        $target = jQuery(e.target), 
     126        $target_link = $target.closest("a"), 
    33127        $tablenav = jQuery("div.simple-history-tablenav"), 
    34128        $current_page = $tablenav.find(".current-page"), 
     
    38132        $first_page = $tablenav.find(".first-page"), 
    39133        $last_page = $tablenav.find(".last-page"), 
    40         $displaying_num = $tablenav.find(".displaying-num"); 
     134        $displaying_num = $tablenav.find(".displaying-num"), 
     135        filters = simple_history.get_selected_filters(), 
     136        $simple_history_wrap = jQuery(".simple-history-wrap"); 
    41137 
    42138    e.preventDefault(); 
     
    44140    // if target is a child of simple-history-tablenav then this is a click in pagination 
    45141    if ($t.closest("div.simple-history-tablenav").length > 0) { 
    46  
    47         if ($target.hasClass("disabled")) { 
     142     
     143        if ($target_link.hasClass("disabled")) { 
    48144            return; 
    49         } else if ($target.hasClass("first-page")) { 
     145        } else if ($target_link.hasClass("first-page")) { 
    50146            simple_history_current_page = 0; 
    51         } else if ($target.hasClass("last-page")) { 
    52             simple_history_current_page = $total_pages.text()-1; 
    53         } else if ($target.hasClass("prev-page")) { 
    54             simple_history_current_page = simple_history_current_page-1; 
    55         } else if ($target.hasClass("next-page")) { 
    56             simple_history_current_page = simple_history_current_page+1; 
     147        } else if ($target_link.hasClass("last-page")) { 
     148            simple_history_current_page = parseInt($total_pages.text(), 10) - 1; 
     149        } else if ($target_link.hasClass("prev-page")) { 
     150            simple_history_current_page = simple_history_current_page - 1; 
     151        } else if ($target_link.hasClass("next-page")) { 
     152            simple_history_current_page = simple_history_current_page + 1; 
    57153        } 
    58154             
     
    63159        if (extraParams && extraParams.enterType && extraParams.enterType == "goToPage") { 
    64160            // pressed enter on go to page-input 
    65             simple_history_current_page = parseInt($current_page.val())-1; // -1 because we add one later on. feels kinda wierd, I know. 
     161            simple_history_current_page = parseInt($current_page.val(), 10)-1; // -1 because we add one later on. feels kinda wierd, I know. 
    66162            if (isNaN(simple_history_current_page)) { 
    67163                simple_history_current_page = 0; 
     
    74170    } 
    75171     
    76     // so dashboard widget does not collapse when loading new items 
    77     $wrapper.height($wrapper.height()); 
    78  
    79     $t.closest("ul").find("li").removeClass("selected"); 
    80     $t.closest("li").addClass("selected"); 
    81  
    82     jQuery(".simple-history-load-more").hide("fast"); 
    83     jQuery(".simple-history-no-more-items").hide(); 
    84     $ol.fadeOut("fast"); 
     172    $simple_history_wrap.addClass("simple-history-is-loading simple-history-has-items"); 
    85173     
    86174    // update current page 
    87175    $current_page.val(simple_history_current_page+1); 
    88      
    89     var type = jQuery("ul.simple-history-filter-type li.selected").data("simple-history-filter-type"); 
    90     var subtype = jQuery("ul.simple-history-filter-type li.selected").data("simple-history-filter-subtype"); 
    91      
     176         
    92177    var data = { 
    93178        "action": "simple_history_ajax", 
    94         "type": type, 
    95         "subtype" : subtype, 
    96         "user": jQuery("ul.simple-history-filter-user li.selected a").text(), 
     179        "type": filters.type, 
     180        "subtype" : filters.subtype, 
     181        "user_id": filters.user_id, 
    97182        "search": search, 
    98183        "num_added": num_added, 
    99184        "page": simple_history_current_page 
    100185    }; 
    101     jQuery.post(ajaxurl, data, function(data, textStatus, XMLHttpRequest){ 
    102          
     186 
     187    // If a previous ajax call is ongoing: cancel it 
     188    if (simple_history_jqXHR) { 
     189        simple_history_jqXHR.abort(); 
     190    } 
     191 
     192    simple_history_jqXHR = jQuery.post(ajaxurl, data, function(data, textStatus, XMLHttpRequest){ 
     193         
     194        // If no more can be loaded show message about that 
    103195        if (data.error == "noMoreItems") { 
    104             // jQuery(".simple-history-load-more,.simple-history-load-more-loading").hide(); 
    105             jQuery(".simple-history-no-more-items").show(); 
     196             
    106197            jQuery(".simple-history-ol-wrapper").height("auto"); 
     198            $simple_history_wrap.removeClass("simple-history-has-items simple-history-is-loading"); 
    107199 
    108200            $displaying_num.html(0); 
    109201            $total_pages.text(1); 
    110              
    111             $tablenav.hide(); 
    112202 
    113203        } else { 
     204 
     205            // Items found, add and show 
    114206 
    115207            // update number of existing items and total pages 
    116208            $displaying_num.html(data.filtered_items_total_count_string); 
    117209            $total_pages.text(data.filtered_items_total_pages); 
    118          
    119             $tablenav.show(); 
    120              
     210                 
    121211            $ol.html(data.items_li); 
    122             $wrapper.animate({ 
    123                 height: $ol.height() 
    124             }, "fast", "swing", function() { 
    125                 $ol.fadeIn("fast"); 
    126                 jQuery(".simple-history-ol-wrapper").height("auto"); 
    127             }); 
     212 
     213            // set wrapper to the height required to show items 
     214            $wrapper.height( $ol.height() ); 
     215            $simple_history_wrap.removeClass("simple-history-is-loading"); 
    128216 
    129217        } 
     
    150238         
    151239        // if we are at first then disable first + prev 
    152         if (simple_history_current_page == 0) { 
     240        if (simple_history_current_page === 0) { 
    153241            $prev_page.addClass("disabled"); 
    154242            $first_page.addClass("disabled"); 
    155243        } 
    156244 
     245        $wrapper.removeClass("simple-history-is-loading"); 
    157246 
    158247    }); 
    159248     
    160 }); 
    161  
    162 /** 
    163  * Click on load more = load more items via AJAX 
    164  */ 
    165 jQuery(".simple-history-load-more a, .simple-history-load-more input[type='button']").live("click", function() { 
    166  
    167     simple_history_current_page++; 
    168  
    169     // the number of new history items to get 
    170     var num_to_get = jQuery(this).prev("select").find(":selected").val(); 
    171      
    172     // the number of added li-items = the number of added history items 
    173     var num_added = jQuery("ol.simple-history > li").length; 
    174  
    175     jQuery(".simple-history-load-more,.simple-history-load-more-loading").toggle(); 
    176      
    177     var search = jQuery("p.simple-history-filter-search input[type='text']").val(); 
    178      
    179     $ol = jQuery("ol.simple-history:last"); 
    180     var data = { 
    181         "action": "simple_history_ajax", 
    182         "type": jQuery(".simple-history-filter-type li.selected a").text(), 
    183         "user": jQuery(".simple-history-filter-user li.selected a").text(), 
    184         "page": simple_history_current_page, 
    185         "items": num_to_get, 
    186         "num_added": num_added, 
    187         "search": search 
    188     }; 
    189     jQuery.post(ajaxurl, data, function(data, textStatus, XMLHttpRequest){ 
    190      
    191         // if data = simpleHistoryNoMoreItems then no more items found, so hide load-more-link 
    192         if (data == "simpleHistoryNoMoreItems") { 
    193             jQuery(".simple-history-load-more,.simple-history-load-more-loading").hide(); 
    194             jQuery(".simple-history-no-more-items").show(); 
    195         } else { 
    196             var $new_lis = jQuery(data); 
    197             $new_lis.hide(); 
    198             $ol.append($new_lis); 
    199             $new_lis.fadeIn("fast"); 
    200             jQuery(".simple-history-load-more,.simple-history-load-more-loading").toggle(); 
    201         } 
    202  
    203     }); 
    204     return false; 
    205249}); 
    206250 
     
    211255    jQuery(this).closest("li").find(".when_detail").fadeOut("fast"); 
    212256}); 
    213  
    214 // show occasions 
    215 jQuery("a.simple-history-occasion-show").live("click", function() { 
    216     jQuery(this).closest("li").find("ul.simple-history-occasions").toggle("fast"); 
    217     return false; 
    218 }); 
  • simple-history/trunk/styles.css

    r686348 r701381  
     1 
     2 
     3.simple-history-ol-wrapper { 
     4    margin-top: .75em; 
     5} 
    16 
    27.simple-history-filter { 
    38    margin-bottom: .5em; 
    49    margin-top: .5em; 
    5 } 
    6 .simple-history-filter li { 
    7     display: inline; 
    8 } 
    9 .simple-history-filter a { 
    10     text-decoration: none; 
    11 } 
    12 .simple-history-filter .selected a { 
    13     font-weight: bold; 
    14     text-decoration: none; 
    15     color: black; 
     10    margin-right: 1em; 
     11    display: inline-block; 
    1612} 
    1713 
     
    6864} 
    6965 
     66.simple-history-who-avatar { 
     67    position: absolute; 
     68    top: 10px; 
     69    left: 10px; 
     70} 
     71 
     72ol.simple-history .when { 
     73    color: #999; 
     74    cursor: help; 
     75    border-bottom: 1px dotted #bbb; 
     76} 
     77ol.simple-history .when_detail { 
     78    display: none; 
     79    position: absolute; 
     80    top: .4em; 
     81    left: 5.5em; 
     82    padding: .75ex; 
     83    background-color: #fffdb5; 
     84    border: 1px solid #eee; 
     85    color: black; 
     86    z-index: 1; 
     87    box-shadow: 3px 3px 10px -3px rgba(0,0, 0, .25); 
     88} 
     89 
     90 
    7091li.simple-history-has-attachment-thumnbail { 
    7192    /*min-height: 50px;*/ 
     
    7899} 
    79100 
    80 .simple-history-who-avatar { 
    81     position: absolute; 
    82     top: 10px; 
    83     left: 10px; 
    84 } 
    85  
    86 ol.simple-history .when { 
    87     color: #999; 
    88     cursor: help; 
    89     border-bottom: 1px dotted #bbb; 
    90 } 
    91 ol.simple-history .when_detail { 
    92     display: none; 
    93     position: relative; 
    94     top: 1.75em; 
    95     left: -2em; 
    96     padding: .5ex; 
    97     background-color: #fffdb5; 
    98     border: 1px solid #eee; 
    99     color: black; 
    100     z-index: 1; 
     101 
     102.simple-history-object-image { 
     103    margin: 1em 0 0 0; 
     104    overflow: hidden; 
     105} 
     106.simple-history-object-image img { 
     107    max-width: 80px; 
     108    max-height: 60px; 
    101109} 
    102110 
    103111.simple-history-attachment-thumbnail { 
    104     position: absolute; 
    105     left: 10px; 
    106     top: 10px; 
    107     display: none;; 
    108 } 
     112    float: left; 
     113    margin-right: 1em; 
     114    /*min-width: 60px;*/ 
     115} 
     116 
     117.simple-history-attachment-meta { 
     118    float: left; 
     119    color: #666; 
     120} 
     121 
     122.simple-history-attachment-meta p { 
     123    margin: 0 0 .5em 0; 
     124} 
     125 
     126 
    109127.simple-history-title { 
    110128    font-weight: bold; 
     
    132150} 
    133151 
    134 .simple-history-load-more-loading { 
    135     height: 26px; 
    136     line-height: 26px; 
    137 } 
    138 .simple-history-load-more-loading img { 
    139     display: inline-block; 
    140     position: relative; 
    141     top: 3px; 
    142     margin-right: .5em; 
    143 } 
    144152.simple-history-no-more-items { 
    145153    padding: .5em; 
     
    160168    display: block; 
    161169} 
     170 
    162171.simple-history-rss-feed-dashboard a, 
    163 .simple-history-rss-feed-page span 
    164 { 
    165     background: transparent url(http://jquery-ui.googlecode.com/svn/trunk/themes/base/images/ui-icons_888888_256x240.png) no-repeat -17px -176px; 
     172.simple-history-rss-feed-page span { 
     173    background: transparent url(./img/ui-icons_888888_256x240.png) no-repeat -17px -176px; 
    166174    display: block; 
    167175    width: 16px; 
     
    207215} 
    208216 
     217.simple-history-tablenav { 
     218    visibility: hidden; 
     219} 
     220.simple-history-has-items .simple-history-tablenav { 
     221    visibility: visible; 
     222} 
     223 
    209224.simple-history-tablenav .tablenav-pages { 
    210225    float: none; 
     
    215230} 
    216231 
     232 
     233.simple-history-tablenav .tablenav-pages a { 
     234    background: #eee; 
     235    display: inline-block; 
     236} 
     237 
     238.simple-history-tablenav .tablenav-pages a:hover { 
     239    background-color: #e4e4e4; 
     240} 
     241 
     242.simple-history-tablenav .tablenav-pages a span { 
     243    background: transparent url(./img/ui-icons_888888_256x240.png) no-repeat -240px -48px; 
     244    display: block; 
     245    text-indent: -30px; 
     246    line-height: 1; 
     247    overflow: hidden; 
     248    padding: 2px 9px; 
     249} 
     250 
     251.simple-history-tablenav .tablenav-pages a.disabled { 
     252    opacity: .5; 
     253} 
     254 
     255.simple-history-tablenav .tablenav-pages .prev-page span { 
     256    background-position: -96px -16px; 
     257} 
     258 
     259.simple-history-tablenav .tablenav-pages .next-page span { 
     260    background-position: -32px -16px; 
     261} 
     262 
     263.simple-history-tablenav .tablenav-pages .last-page span { 
     264    background-position: -208px -48px; 
     265} 
     266 
     267 
     268.simple-history-loading { 
     269    position: absolute; 
     270    top: 55%; 
     271    left: 10%; 
     272    opacity: 0; 
     273} 
     274#simple_history_dashboard_widget .simple-history-loading { 
     275    left: 40%; 
     276} 
     277.simple-history-loading img { 
     278    vertical-align: text-bottom; 
     279} 
     280 
     281.simple-history-is-loading { 
     282     
     283} 
     284 
     285/* show loading indicator after a short while */ 
     286.simple-history-is-loading .simple-history-loading { 
     287    transition: all .25s ease-out; 
     288    transition-delay: .75s; 
     289    opacity: .75; 
     290} 
     291 
     292 
     293.simple-history-ol-wrapper { 
     294    overflow: hidden; 
     295} 
     296 
     297.simple-history-wrap, 
     298.simple-history-ol-wrapper, 
     299ol.simple-history, 
     300.simple-history-tablenav 
     301 { 
     302    transition: all .15s ease-out; 
     303} 
     304 
     305.simple-history-is-loading ol.simple-history { 
     306    opacity: 0; 
     307} 
     308.simple-history-is-loading .simple-history-tablenav { 
     309    opacity: .75; 
     310} 
     311 
     312.simple-history-wrap { 
     313    visibility: hidden; 
     314} 
     315 
     316.simple-history-is-ready { 
     317    visibility: visible; 
     318} 
Note: See TracChangeset for help on using the changeset viewer.