Skip to content

Commit

Permalink
v1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Dernerd committed Dec 11, 2023
1 parent 647c4df commit 267539a
Show file tree
Hide file tree
Showing 29 changed files with 5,051 additions and 601 deletions.
749 changes: 326 additions & 423 deletions msreader-files/css/admin.css

Large diffs are not rendered by default.

20 changes: 4 additions & 16 deletions msreader-files/includes/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,12 @@ abstract class WMD_MSReader_Modules {

var $helpers;

var $details;

function __construct( $slug, $options = array() ) {
function __construct($options = array(), $slug = null) {
global $msreader_available_modules, $wpdb, $msreader_helpers;

//set module details
/*end($msreader_available_modules);
$this->details = $msreader_available_modules[$slug];*/

// Check if $slug is a valid type (string) before accessing the array element
if (is_string($slug) && isset($msreader_available_modules[$slug])) {
// Set module details only if $slug is a valid string and exists in the array
$this->details = $msreader_available_modules[$slug];
end($msreader_available_modules);
$this->details = $msreader_available_modules[$slug];

//set options for module
$this->options = $options;
Expand Down Expand Up @@ -90,11 +83,6 @@ function __construct( $slug, $options = array() ) {
if(isset($_GET['msreader_'.$this->details['slug']]) && $_GET['msreader_'.$this->details['slug']] == 'open_post' && isset($_GET['post_id']) && isset($_GET['blog_id'])) {
add_action('init', array( $this, "open_site_post" ), 20);
}

} else {
// Handle the case when $slug is not valid or not found in the array.
// You may throw an exception, log an error, or handle it based on your use case.
}
}
abstract function init();

Expand All @@ -115,7 +103,7 @@ function get_page_title() {

//by default page title is module title
function get_empty_message() {
return __('Noch nichts hier!', 'wmd_msreader' );
return __('Hier ist noch nichts!', 'wmd_msreader' );
}

function get_featured_media_html($post) {
Expand Down
34 changes: 17 additions & 17 deletions msreader-files/includes/modules/featured-posts.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
$module = array(
'name' => __( 'Hervorgehobene Beiträge', 'wmd_msreader' ),
'description' => __( 'Aktiviert hervorgehobene Beiträge', 'wmd_msreader' ),
'name' => __( 'Ausgewählte Beiträge', 'wmd_msreader' ),
'description' => __( 'Aktiviert Ausgewählte Beiträge', 'wmd_msreader' ),
'slug' => 'featured_posts',
'class' => 'WMD_MSReader_Module_FeaturedPosts',
'type' => 'query'
Expand Down Expand Up @@ -41,14 +41,14 @@ function add_link_to_widget($widgets) {

function add_featured_indicator($title, $post) {
if(isset($post->featured) && $post->featured)
$title = '<div class="msreader-post-indicator dashicons dashicons-star-filled featured-post" title="'.__( 'Dieser Beitrag wird hervorgehoben', 'wmd_msreader' ).'"></div>'.$title;
$title = '<div class="msreader-post-indicator dashicons dashicons-star-filled featured-post" title="'.__( 'Dieser Beitrag wird ausgewählt', 'wmd_msreader' ).'"></div>'.$title;

return $title;
}

function add_featuring_button($button, $post) {
if(is_super_admin() && $post->post_date != '0000-00-00 00:00:00') {
$text = (isset($post->featured) && $post->featured) ? __( 'Normal', 'wmd_msreader' ): __( 'Empfehlen', 'wmd_msreader' );
$text = (isset($post->featured) && $post->featured) ? __( 'Unfeature', 'wmd_msreader' ): __( 'Feature', 'wmd_msreader' );

$button .= '<button class="right button button-secondary featured-posts-control">'.$text.'</button>';
}
Expand All @@ -58,7 +58,7 @@ function add_featuring_button($button, $post) {

function dashboard_single_add_featuring_button($links, $post) {
if(is_super_admin() && $post->post_status == 'publish') {
$text = (isset($post->featured) && $post->featured) ? __( 'Normal', 'wmd_msreader' ): __( 'Empfehlen', 'wmd_msreader' );
$text = (isset($post->featured) && $post->featured) ? __( 'Unfeature', 'wmd_msreader' ): __( 'Feature', 'wmd_msreader' );

$links .= '<button class="featured-posts-control">'.$text.'</button>';
}
Expand All @@ -73,9 +73,9 @@ function add_featuring_button_in_content($content) {
$post->BLOG_ID = get_current_blog_id();
$post = $this->additional_post_data($post);

$text = (isset($post->featured) && $post->featured) ? __( 'Normal', 'wmd_msreader' ): __( 'Empfehlen', 'wmd_msreader' );
$text = (isset($post->featured) && $post->featured) ? __( 'Unfeature', 'wmd_msreader' ): __( 'Feature', 'wmd_msreader' );

$content = $content.'<p><small><a style="text-transform:capitalize;" class="featured-posts-control msreader-frontend" href="#" data-blog_id="'.$post->BLOG_ID.'" data-post_id="'.$post->ID.'" title="'.__( 'Einschließen/Ausschließen von der Liste der empfohlenen Beiträge in Reader', 'wmd_msreader' ).'">'.$text.'</a></small></p>';
$content = $content.'<p><small><a style="text-transform:capitalize;" class="featured-posts-control msreader-frontend" href="#" data-blog_id="'.$post->BLOG_ID.'" data-post_id="'.$post->ID.'" title="'.__( 'Include/Exclude from featured post list in Reader', 'wmd_msreader' ).'">'.$text.'</a></small></p>';
}

return $content;
Expand All @@ -87,9 +87,9 @@ function enqueue_scripts() {
wp_localize_script('jquery', 'ajaxurl', admin_url( 'admin-ajax.php' ));
wp_localize_script('jquery', 'msreader_featured_posts', array(
'saving' => __( 'Speichern...', 'wmd_msreader' ),
'post_featured' => __( "Dieser Beitrag wird vhervorgehoben", "wmd_msreader" ),
'feature' => __( "Empfehlen", "wmd_msreader" ),
'unfeature' => __( "Normal", "wmd_msreader" )
'post_featured' => __( "Dieser Beitrag ist ausgewählt", "wmd_msreader" ),
'feature' => __( "Feature", "wmd_msreader" ),
'unfeature' => __( "Unfeature", "wmd_msreader" )
));
}

Expand Down Expand Up @@ -243,14 +243,14 @@ function feature_link() {
$followed_by_user = $this->get_featured_posts();

if(in_array($current_blog_id, $followed_by_user)) {
$text = __( 'Hervorgehoben', 'wmd_msreader' );
$hover_text = __( 'Normal', 'wmd_msreader' );
$text = __( 'Featured', 'wmd_msreader' );
$hover_text = __( 'Unfeature', 'wmd_msreader' );
$url = $this->get_module_dashboard_url(array('action' => 'unfollow', 'blog_id' => $current_blog_id));
$class = 'following';
}
else {
$text = __( 'Empfehlen', 'wmd_msreader' );
$hover_text = __( 'Folge', 'wmd_msreader' );
$text = __( 'Feature', 'wmd_msreader' );
$hover_text = __( 'Folgen', 'wmd_msreader' );
$url = $this->get_module_dashboard_url(array('action' => 'follow', 'blog_id' => $current_blog_id));
$class = 'follow';
}
Expand All @@ -263,7 +263,7 @@ function feature_link() {
'href' => $url,
'meta' => array(
'class' => $class,
'title' => $hover_text.' '.__( 'dieser Seite', 'wmd_msreader' )
'title' => $hover_text.' '.__( 'dieser Webseite', 'wmd_msreader' )
),
)
);
Expand Down Expand Up @@ -317,9 +317,9 @@ function query() {
}

function get_empty_message() {
$return = __( 'Noch nichts hier!', 'wmd_msreader' );
$return = __( 'Hier ist noch nichts!', 'wmd_msreader' );
if(is_super_admin())
$return .= __( '...Aber es sieht so aus, als wärst Du ein Super-Administrator, was bedeutet, dass Du Beiträge veröffentlichen kannst, indem Du auf die Schaltfläche "Empfehlen" klickst.', 'wmd_msreader' );
$return .= __( '...Aber es sieht so aus, als wärst Du Superadministrator, was bedeutet, dass Du Beiträge hervorheben kannst, indem Du auf die Schaltfläche "Feature" klickst.', 'wmd_msreader' );
if($this->helpers->is_module_enabled('recent_posts'))
$return .= '<br/> <a href="'.$this->get_module_dashboard_url(array(), 'recent_posts').'">'.__( 'Suche nach etwas Interessantem.', 'wmd_msreader' ).'</a>';

Expand Down
8 changes: 4 additions & 4 deletions msreader-files/includes/modules/filter-blog-author.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
$module = array(
'name' => __( 'Nach Autor oder Webseite filtern', 'wmd_msreader' ),
'description' => __( 'Zeigt Beiträge des ausgewählten Autors oder der ausgewählten Webseite an', 'wmd_msreader' ),
'description' => __( 'Zeigt Beiträge des ausgewählten Autors oder der Webseite an', 'wmd_msreader' ),
'slug' => 'filter_blog_author',
'class' => 'WMD_MSReader_Module_FilterBlogAuthor',
'can_be_default' => false,
Expand All @@ -19,18 +19,18 @@ function init() {
}

function add_author_link($name, $post) {
return '<a title="'.__('Zeige alle Beiträge dieses Autors', 'wmd_msreader').'" href="'.$this->get_module_dashboard_url(array('author_id' => $post->post_author)).'">'.$name.'</a>';
return '<a title="'.__('Alle Beiträge dieses Autors anzeigen', 'wmd_msreader').'" href="'.$this->get_module_dashboard_url(array('author_id' => $post->post_author)).'">'.$name.'</a>';
}

function add_blog_link($name, $post) {
return '<a title="'.__('Zeige alle Beiträge auf dieser Seite', 'wmd_msreader').'" href="'.$this->get_module_dashboard_url(array('blog_id' => $post->blog_details->blog_id)).'">'.$name.'</a>';
return '<a title="'.__('Alle Beiträge auf dieser Webseite anzeigen', 'wmd_msreader').'" href="'.$this->get_module_dashboard_url(array('blog_id' => $post->blog_details->blog_id)).'">'.$name.'</a>';
}

function get_page_title() {
$title = '';
if(isset($this->args['blog_id']) && is_numeric($this->args['blog_id'])) {
$blog_details = get_blog_details($this->args['blog_id']);
return __('Beiträge von:', 'wmd_msreader').' <span>'.$blog_details->blogname.'</span> <a href="'.$blog_details->siteurl.'" class="add-new-h2"><span class="dashicons dashicons-admin-links"></span> '.__('Besuche Webseite', 'wmd_msreader').'</a>';
return __('Beiträge von:', 'wmd_msreader').' <span>'.$blog_details->blogname.'</span> <a href="'.$blog_details->siteurl.'" class="add-new-h2"><span class="dashicons dashicons-admin-links"></span> '.__('Webseite besuchen', 'wmd_msreader').'</a>';
}
elseif(isset($this->args['author_id']) && is_numeric($this->args['author_id'])) {
$user_details = get_userdata( $this->args['author_id'] );
Expand Down
Loading

0 comments on commit 267539a

Please sign in to comment.