diff --git a/e107_handlers/e_pluginbuilder_class.php b/e107_handlers/e_pluginbuilder_class.php index add136960b..589ee8c6a7 100644 --- a/e107_handlers/e_pluginbuilder_class.php +++ b/e107_handlers/e_pluginbuilder_class.php @@ -319,11 +319,13 @@ private function step2() $text = $frm->open('buildTab', 'get', e_REQUEST_SELF); + $lanSelectTable = e107::getParser()->lanVars(EPL_ADLAN_258, "".$this->pluginName."_sql.php"); + $text .= " - +

".ucfirst(LAN_OPTIONAL)."

To generate your ".$this->pluginName."_sql.php table creation file, please select your sql table then click 'Refresh'".$lanSelectTable." "; $text .= $frm->select('build', $tables, null, array('useValues'=>1), "(".LAN_OPTIONAL.")"); @@ -568,11 +570,11 @@ private function addons() //Todo LANS $dizOther = array( - '_blank' => "Simple frontend script", - '_blank_setup' => "Create default table data during install, upgrade, uninstall etc", - '_blank_menu' => "Menu item for use in the menu manager.", - '_blank_template' => "Template to allow layout customization by themes.", - '_blank_shortcodes' => "Shortcodes for the template." + '_blank' => EPL_ADLAN_259, // Simple frontend script + '_blank_setup' => EPL_ADLAN_260, // Create default table data during install, upgrade, uninstall etc + '_blank_menu' => EPL_ADLAN_261, // Menu item for use in the menu manager. + '_blank_template' => EPL_ADLAN_262, // Template to allow layout customization by themes. + '_blank_shortcodes' => EPL_ADLAN_263, // Shortcodes for the template. ); array_unshift($list,'_blank', '_blank_setup', '_blank_menu', '_blank_template', '_blank_shortcodes'); diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 11896d0637..f1158b7246 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -1452,33 +1452,7 @@ class e107plugin - private $plugin_addons_diz = array( - 'e_admin' => "Add form elements to existing core admin areas.", - 'e_cron' => "Include your plugin's cron in the 'Scheduled Tasks' admin area.", - 'e_notify' => "Include your plugin's notification to the Notify admin area.", - 'e_linkgen' => "Add link generation into the sitelinks area.", - 'e_frontpage' => "Add your plugin as a frontpage option.", - 'e_menu' => "Gives your plugin's menu(s) configuration options in the Menu Manager.", - 'e_featurebox' => "Allow your plugin to generate content for the featurebox plugin.", - 'e_search' => "Add your plugin to the search page.", - 'e_shortcode' => "Add a global shortcode which can be used site-wide. (use sparingly)", - 'e_module' => "Include a file within class2.php (every page of the site).", - 'e_event' => "Hook into core events and process them with custom functions.", - 'e_comment' => "Override the core commenting system.", - 'e_dashboard' => "Add something to the default admin dashboard panel.", // Admin Front-Page addon. - 'e_header' => "Have your plugin include code in the head of every page of the site. eg. css", // loaded in header prior to javascript manager. - 'e_footer' => "Have your plugin include code in the foot of every page of the site. eg. javascript", // Loaded in footer prior to javascript manager. - 'e_url' => "Give your plugin search-engine-friendly URLs", // simple mod-rewrite. - 'e_mailout' => "Allow the mailing engine to use data from your plugin's database tables.", - 'e_sitelink' => "Create dynamic navigation links for your plugin.", // sitelinks generator. - 'e_related' => "Allow your plugin to be included in the 'related' links.", - 'e_rss' => "Give your plugin an rss feed.", - 'e_upload' => "Use data from your plugin in the user upload form.", - 'e_user' => "Have your plugin include data on the user-profile page.", - 'e_library' => "Include a third-party library", - 'e_parse' => "Hook into e107's text/html parser", - 'e_output' => "Hook into all pages at the end (after closing )" - ); + private $plugin_addons_diz = array(); // i18n via getAddonsDiz() var $disAllowed = array( @@ -5150,6 +5124,38 @@ public function getAddonsList() */ public function getAddonsDiz($v) { + if(empty($this->plugin_addons_diz)) + { + $this->plugin_addons_diz = array( + 'e_admin' => EPL_ADLAN_264, // Add form elements to existing core admin areas. + 'e_cron' => EPL_ADLAN_265, // Include your plugin's cron in the 'Scheduled Tasks' admin area. + 'e_notify' => EPL_ADLAN_266, // Include your plugin's notification to the Notify admin area. + 'e_linkgen' => EPL_ADLAN_267, // Add link generation into the sitelinks area. + 'e_frontpage' => EPL_ADLAN_268, // Add your plugin as a frontpage option. + 'e_menu' => EPL_ADLAN_269, // Gives your plugin's menu(s) configuration options in the Menu Manager. + 'e_featurebox' => EPL_ADLAN_270, // Allow your plugin to generate content for the featurebox plugin. + 'e_search' => EPL_ADLAN_271, // Add your plugin to the search page. + 'e_shortcode' => EPL_ADLAN_272, // Add a global shortcode which can be used site-wide. (use sparingly) + 'e_module' => EPL_ADLAN_273, // Include a file within class2.php (every page of the site). + 'e_event' => EPL_ADLAN_274, // Hook into core events and process them with custom functions. + 'e_comment' => EPL_ADLAN_275, // Override the core commenting system. + 'e_dashboard' => EPL_ADLAN_276, // Add something to the default admin dashboard panel. + 'e_header' => EPL_ADLAN_277, // Include code in the head of every page of the site. eg. css + 'e_footer' => EPL_ADLAN_278, // Include code in the foot of every page of the site. eg. javascript + 'e_url' => EPL_ADLAN_279, // Give your plugin search-engine-friendly URLs. + 'e_mailout' => EPL_ADLAN_280, // Allow the mailing engine to use data from your plugin's database tables. + 'e_sitelink' => EPL_ADLAN_281, // Create dynamic navigation links for your plugin. + 'e_related' => EPL_ADLAN_282, // Allow your plugin to be included in the 'related' links. + 'e_rss' => EPL_ADLAN_283, // Give your plugin an rss feed. + 'e_upload' => EPL_ADLAN_284, // Use data from your plugin in the user upload form. + 'e_user' => EPL_ADLAN_285, // Have your plugin include data on the user-profile page. + 'e_library' => EPL_ADLAN_286, // Include a third-party library. + 'e_parse' => EPL_ADLAN_287, // Hook into e107's text/html parser. + 'e_output' => EPL_ADLAN_288, // Hook into all pages at the end (after closing ). + 'e_print' => EPL_ADLAN_289, // Customize the [Print] function for your plugin's content. + ); + } + if(!empty($this->plugin_addons_diz[$v])) { return $this->plugin_addons_diz[$v]; diff --git a/e107_languages/English/admin/lan_plugin.php b/e107_languages/English/admin/lan_plugin.php index 1d06a01ebd..6b173190f3 100644 --- a/e107_languages/English/admin/lan_plugin.php +++ b/e107_languages/English/admin/lan_plugin.php @@ -266,4 +266,36 @@ 'EPL_ADLAN_255' => "Overwrite Files", 'EPL_ADLAN_256' => "Skipped [x] (already exists)", 'EPL_ADLAN_257' => "Readonly", + 'EPL_ADLAN_258' => "To generate your [x] table creation file, please select your sql table then click 'Refresh'", + 'EPL_ADLAN_259' => "Simple frontend script", + 'EPL_ADLAN_260' => "Create default table data during install, upgrade, uninstall etc", + 'EPL_ADLAN_261' => "Menu item for use in the menu manager.", + 'EPL_ADLAN_262' => "Template to allow layout customization by themes.", + 'EPL_ADLAN_263' => "Shortcodes for the template.", + 'EPL_ADLAN_264' => "Add form elements to existing core admin areas.", + 'EPL_ADLAN_265' => "Include your plugin's cron in the 'Scheduled Tasks' admin area.", + 'EPL_ADLAN_266' => "Include your plugin's notification to the Notify admin area.", + 'EPL_ADLAN_267' => "Add link generation into the sitelinks area.", + 'EPL_ADLAN_268' => "Add your plugin as a frontpage option.", + 'EPL_ADLAN_269' => "Gives your plugin's menu(s) configuration options in the Menu Manager.", + 'EPL_ADLAN_270' => "Allow your plugin to generate content for the featurebox plugin.", + 'EPL_ADLAN_271' => "Add your plugin to the search page.", + 'EPL_ADLAN_272' => "Add a global shortcode which can be used site-wide. (use sparingly)", + 'EPL_ADLAN_273' => "Include a file within class2.php (every page of the site).", + 'EPL_ADLAN_274' => "Hook into core events and process them with custom functions.", + 'EPL_ADLAN_275' => "Override the core commenting system.", + 'EPL_ADLAN_276' => "Add something to the default admin dashboard panel.", + 'EPL_ADLAN_277' => "Have your plugin include code in the head of every page of the site. eg. css", + 'EPL_ADLAN_278' => "Have your plugin include code in the foot of every page of the site. eg. javascript", + 'EPL_ADLAN_279' => "Give your plugin search-engine-friendly URLs", + 'EPL_ADLAN_280' => "Allow the mailing engine to use data from your plugin's database tables.", + 'EPL_ADLAN_281' => "Create dynamic navigation links for your plugin.", + 'EPL_ADLAN_282' => "Allow your plugin to be included in the 'related' links.", + 'EPL_ADLAN_283' => "Give your plugin an rss feed.", + 'EPL_ADLAN_284' => "Use data from your plugin in the user upload form.", + 'EPL_ADLAN_285' => "Have your plugin include data on the user-profile page.", + 'EPL_ADLAN_286' => "Include a third-party library", + 'EPL_ADLAN_287' => "Hook into e107's text/html parser", + 'EPL_ADLAN_288' => "Hook into all pages at the end (after closing )", + 'EPL_ADLAN_289' => "Customize the [Print] function for your plugin's content.", ]; diff --git a/e107_languages/English/lan_print.php b/e107_languages/English/lan_print.php index e64c2c37f9..dca5669fa4 100644 --- a/e107_languages/English/lan_print.php +++ b/e107_languages/English/lan_print.php @@ -11,7 +11,7 @@ */ return [ - 'PAGE_NAME' => "Printer Friendly", + 'LAN_PRINT_PAGE_NAME' => "Printer Friendly", 'LAN_PRINT_303' => "This news item is from", 'LAN_PRINT_307' => "Print this page", 'LAN_PRINT_1' => "printer friendly", diff --git a/e107_tests/tests/unit/e107pluginTest.php b/e107_tests/tests/unit/e107pluginTest.php index 9a8fa302ec..55f8472023 100644 --- a/e107_tests/tests/unit/e107pluginTest.php +++ b/e107_tests/tests/unit/e107pluginTest.php @@ -44,6 +44,22 @@ public function testGetPluginRecord() } + /** + * Ensure every addon type declared in $_addon_types has a description + * returned by getAddonsDiz(). Regression guard for e_print (added in v2.3.1) + * which was missing from the description map and rendered an empty tooltip + * in the Plugin Builder wizard. + */ + public function testGetAddonsDizCoversEPrint() + { + $result = $this->ep->getAddonsDiz('e_print'); + + $this->assertNotNull($result, "getAddonsDiz('e_print') must return a description, not null."); + $this->assertIsString($result); + $this->assertNotEmpty(trim($result)); + } + + /* public function testDisplayArray() diff --git a/e107_tests/tests/unit/lanPrintTest.php b/e107_tests/tests/unit/lanPrintTest.php new file mode 100644 index 0000000000..7e59441743 --- /dev/null +++ b/e107_tests/tests/unit/lanPrintTest.php @@ -0,0 +1,40 @@ + + * of any unrelated page that loads emailprint_class.php transitively + * (e.g. via {PRINTICON} on a news widget) when the page itself has not + * defined PAGE_NAME first. + */ + + +class lanPrintTest extends \Codeception\Test\Unit +{ + + public function testLanPrintDoesNotCarryPAGE_NAME() + { + $path = e_LANGUAGEDIR . 'English/lan_print.php'; + $this->assertFileExists($path); + + $terms = include $path; + + $this->assertIsArray( + $terms, + 'lan_print.php must return an array (v2 language pack form)' + ); + $this->assertArrayNotHasKey( + 'PAGE_NAME', + $terms, + 'lan_print.php must not define PAGE_NAME as a side effect; ' + . 'see issue #5606. The print page should set its own title via ' + . 'e107::title() instead.' + ); + } + +} diff --git a/print.php b/print.php index f4ea24dbbe..68841d45ce 100644 --- a/print.php +++ b/print.php @@ -14,6 +14,7 @@ //include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); e107::coreLan('print'); +e107::title(LAN_PRINT_PAGE_NAME); $qs = explode(".", e_QUERY,2);