Skip to content

Commit

Permalink
Merge pull request #452 from RRZE-Webteam/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rvdforst authored Jan 10, 2024
2 parents 25e89bd + 77ae0e3 commit d08d49d
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 83 deletions.
2 changes: 1 addition & 1 deletion fau-person.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Plugin URI: https://github.com/RRZE-Webteam/fau-person
GitHub Plugin URI: https://github.com/RRZE-Webteam/fau-person
Description: Visitenkarten-Plugin für FAU Webauftritte
Version: 3.10.0
Version: 3.10.1
Author: RRZE-Webteam
Author URI: http://blogs.fau.de/webworking/
License: GPLv3 or later
Expand Down
12 changes: 5 additions & 7 deletions includes/BackendMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
/**
* Define Image Sizes
*/
class BackendMenu
{
class BackendMenu {

protected $pluginFile;
private $settings = '';

public function __construct($pluginFile, $settings)
{
public $search_univis_id_page;

public function __construct($pluginFile, $settings) {
$this->pluginFile = $pluginFile;
$this->settings = $settings;
}
Expand All @@ -28,8 +27,7 @@ public function onLoaded()

}

public function add_options_pages()
{
public function add_options_pages() {
//Umgehen von register_setting für die Suche-Seite, da register_setting nur für Standard-Settings-Seiten funktioniert!!!
$options = $this->settings->options;
$optionname = $this->settings->optionName;
Expand Down
1 change: 1 addition & 0 deletions includes/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Settings
protected $pluginFile;
public $optionName;
public $options;
public $optionsPage;
protected $defaults;
protected $settingsMenu;
protected $settingsSections;
Expand Down
131 changes: 64 additions & 67 deletions includes/Taxonomy/Standort.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,91 +10,88 @@
class Standort {

protected $postType = 'standort';

protected $pluginFile;
protected $settings;

public function __construct($pluginFile, $settings) {
$this->pluginFile = $pluginFile;
$this->settings = $settings;
}

public function onLoaded() {
add_action('init', [$this, 'set']);
// add_action('admin_init', [$this, 'register']);
add_action('init', [$this, 'set']);
// add_action('admin_init', [$this, 'register']);

}

public function set() {

$standort_labels = array(
'name' => _x('Standorte', 'Post Type General Name', 'fau-person'),
'singular_name' => _x('Standort', 'Post Type Singular Name', 'fau-person'),
'menu_name' => __('Standort', 'fau-person'),
'parent_item_colon' => __('Übergeordneter Standort', 'fau-person'),
'all_items' => __('Alle Standorte', 'fau-person'),
'view_item' => __('Standort ansehen', 'fau-person'),
'add_new_item' => __('Standort hinzufügen', 'fau-person'),
'add_new' => __('Neuer Standort', 'fau-person'),
'edit_item' => __('Standort bearbeiten', 'fau-person'),
'update_item' => __('Standort aktualisieren', 'fau-person'),
'search_items' => __('Standorte suchen', 'fau-person'),
'not_found' => __('Keine Standorte gefunden', 'fau-person'),
'not_found_in_trash' => __('Keine Standorte in Papierkorb gefunden', 'fau-person'),
);
$standort_rewrite = array(
'slug' => 'standort',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$standort_args = array(
'label' => __('standort', 'fau-person'),
'description' => __('Standortinformationen', 'fau-person'),
'labels' => $standort_labels,
'supports' => array('title', 'editor', 'excerpt', 'thumbnail'),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => 'edit.php?post_type=person',
'show_in_nav_menus' => false,
'show_in_admin_bar' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'query_var' => 'standort',
'rewrite' => $standort_rewrite,
'capability_type' => 'standort',
'capabilities' => array(
'edit_post' => 'edit_standort',
'read_post' => 'read_standort',
'delete_post' => 'delete_standort',
'edit_posts' => 'edit_standorts',
'edit_others_posts' => 'edit_others_standorts',
'publish_posts' => 'publish_standorts',
'read_private_posts' => 'read_private_standorts',
'delete_posts' => 'delete_standorts',
'delete_private_posts' => 'delete_private_standorts',
'delete_published_posts' => 'delete_published_standorts',
'delete_others_posts' => 'delete_others_standorts',
'edit_private_posts' => 'edit_private_standorts',
'edit_published_posts' => 'edit_published_standorts'
),
'map_meta_cap' => true
);


register_post_type($this->postType, $standort_args);
$standort_labels = array(
'name' => _x('Standorte', 'Post Type General Name', 'fau-person'),
'singular_name' => _x('Standort', 'Post Type Singular Name', 'fau-person'),
'menu_name' => __('Standort', 'fau-person'),
'parent_item_colon' => __('Übergeordneter Standort', 'fau-person'),
'all_items' => __('Alle Standorte', 'fau-person'),
'view_item' => __('Standort ansehen', 'fau-person'),
'add_new_item' => __('Standort hinzufügen', 'fau-person'),
'add_new' => __('Neuer Standort', 'fau-person'),
'edit_item' => __('Standort bearbeiten', 'fau-person'),
'update_item' => __('Standort aktualisieren', 'fau-person'),
'search_items' => __('Standorte suchen', 'fau-person'),
'not_found' => __('Keine Standorte gefunden', 'fau-person'),
'not_found_in_trash' => __('Keine Standorte in Papierkorb gefunden', 'fau-person'),
);
$standort_rewrite = array(
'slug' => 'standort',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$standort_args = array(
'label' => __('standort', 'fau-person'),
'description' => __('Standortinformationen', 'fau-person'),
'labels' => $standort_labels,
'supports' => array('title', 'editor', 'excerpt', 'thumbnail'),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => 'edit.php?post_type=person',
'show_in_nav_menus' => false,
'show_in_admin_bar' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'query_var' => 'standort',
'rewrite' => $standort_rewrite,
'capability_type' => 'standort',
'capabilities' => array(
'edit_post' => 'edit_standort',
'read_post' => 'read_standort',
'delete_post' => 'delete_standort',
'edit_posts' => 'edit_standorts',
'edit_others_posts' => 'edit_others_standorts',
'publish_posts' => 'publish_standorts',
'read_private_posts' => 'read_private_standorts',
'delete_posts' => 'delete_standorts',
'delete_private_posts' => 'delete_private_standorts',
'delete_published_posts' => 'delete_published_standorts',
'delete_others_posts' => 'delete_others_standorts',
'edit_private_posts' => 'edit_private_standorts',
'edit_published_posts' => 'edit_published_standorts'
),
'map_meta_cap' => true
);


register_post_type($this->postType, $standort_args);


}

public function register() {

}





}


Expand Down
8 changes: 0 additions & 8 deletions vendor/UnivIS/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ private static function get_remote_data_by($field, $value, $delete = false)
return false;
}

if (!fopen($url, "r")) {
return false;
}

$persArray = self::xml2array($url, $delete);
if (empty($persArray) || is_wp_error($persArray)) {
return false;
Expand All @@ -129,10 +125,6 @@ private static function get_remote_data_by_fullname($firstname, $lastname, $dele
$apiurl = $config['api_url'];
$url = sprintf('%1$s?search=persons&firstname=%2$s&name=%3$s&show=xml', $apiurl, urlencode($firstname), urlencode($lastname));

if (!fopen($url, "r")) {
return false;
}

$persArray = self::xml2array($url, $delete);
if (empty($persArray) || is_wp_error($persArray)) {
return false;
Expand Down

0 comments on commit d08d49d

Please sign in to comment.