- Add: List with Features

- Add: Hyperlink to manfisher.eu in the "other plugins" page
- Bugfix: Load text domain
- Bugfix: Display the Footnotes button in the plain text editor of posts/pages

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@997524 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
Aricura 2014-09-27 07:56:40 +00:00
parent 5a6cf06525
commit 14cda8a316
7 changed files with 70 additions and 17 deletions

View file

@ -141,6 +141,23 @@ class MCI_Footnotes_Layout_Init {
* @since 1.5.0
*/
public function displayOtherPlugins() {
printf("<br/>");
printf("<h3>%s</h3>", __('Take a look on other Plugins we have developed.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
printf('<em><a href="http://manfisher.net/" target="_blank">visit ManFisher Medien ManuFaktur</a></em>');
printf("<br/><br/>");
/*
// collect plugin list as JSON
$l_arr_Response = wp_remote_get("http://herndler.org/wordpress/plugins/get.json");
// check if response is valid
if (is_wp_error($l_arr_Response)) {
printf(__("Error loading other WordPress Plugins from Manfisher. Sorry!", MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
return;
}
// get the body of the response
$l_str_Response = $l_arr_Response["body"];
// convert the body to a json string
$l_arr_Plugins = json_decode($l_str_Response, true);
*/
$l_arr_Plugins = array(
array("name" => "identity", "title" => "Identity"),
array("name" => "google-keyword-suggest", "title" => "Google Keyword Suggest"),
@ -151,9 +168,7 @@ class MCI_Footnotes_Layout_Init {
// load template file
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "other-plugins");
echo sprintf("<br/><h3>%s</h3><br/>", __('Take a look on other Plugins we have developed.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
echo '<div id="the-list">';
printf('<div id="the-list">');
// iterate through each Plugin
foreach($l_arr_Plugins as $l_arr_PluginInfo) {
// replace Plugin information
@ -168,7 +183,7 @@ class MCI_Footnotes_Layout_Init {
// reload template
$l_obj_Template->reload();
}
echo '</div>';
printf('</div>');
}
/**

View file

@ -30,19 +30,29 @@ class MCI_Footnotes_Language {
* @since 1.5.0
*/
public static function loadTextDomain() {
$l_str_LanguagePath = dirname(__FILE__) . "/../languages/" . MCI_Footnotes_Config::C_STR_PLUGIN_NAME - "-";
// language file with localization exists
$l_bool_DomainLoaded = load_textdomain(MCI_Footnotes_Config::C_STR_PLUGIN_NAME, $l_str_LanguagePath . apply_filters('plugin_locale', get_locale(), MCI_Footnotes_Config::C_STR_PLUGIN_NAME) . '.mo');
if (!empty($l_bool_DomainLoaded)) {
if (self::load(apply_filters('plugin_locale', get_locale()))) {
return;
}
// language file without localization exists
$l_bool_DomainLoaded = load_textdomain(MCI_Footnotes_Config::C_STR_PLUGIN_NAME, $l_str_LanguagePath . self::getLanguageCode() . '.mo');
if (!empty($l_bool_DomainLoaded)) {
if (self::load(self::getLanguageCode())) {
return;
}
// fallback to english
load_textdomain(MCI_Footnotes_Config::C_STR_PLUGIN_NAME, $l_str_LanguagePath . '-en.mo');
self::load("en");
}
/**
* Loads a specific text domain.
*
* @author Stefan Herndler
* @since 1.5.1
* @param string $p_str_LanguageCode Language Code to load a specific text domain.
* @return bool
*/
private static function load($p_str_LanguageCode) {
return load_textdomain(MCI_Footnotes_Config::C_STR_PLUGIN_NAME,
dirname(__FILE__) . "/../languages/" . MCI_Footnotes_Config::C_STR_PLUGIN_NAME . "-" . $p_str_LanguageCode . '.mo');
}
/**
@ -54,7 +64,7 @@ class MCI_Footnotes_Language {
*/
private static function getLanguageCode() {
// read current WordPress language
$l_str_locale = apply_filters('plugin_locale', get_locale(), MCI_Footnotes_Config::C_STR_PLUGIN_NAME);
$l_str_locale = apply_filters('plugin_locale', get_locale());
// check if WordPress language has a localization (e.g. "en_US" or "de_AT")
if (strpos($l_str_locale, "_") !== false) {
// remove localization code

View file

@ -7,6 +7,11 @@
* @since 1.5.0 14.09.14 17:30
*/
/**
*
* @author Stefan Herndler
* @since 1.5.0
*/
class MCI_Footnotes_WYSIWYG {
public static function registerHooks() {
@ -41,7 +46,7 @@ class MCI_Footnotes_WYSIWYG {
*/
public static function newPlainTextEditorButton() {
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "editor-button");
$l_obj_Template->getContent();
echo $l_obj_Template->getContent();
}
/**