Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions e107_handlers/e_pluginbuilder_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,13 @@ private function step2()

$text = $frm->open('buildTab', 'get', e_REQUEST_SELF);

$lanSelectTable = e107::getParser()->lanVars(EPL_ADLAN_258, "<em>".$this->pluginName."_sql.php</em>");

$text .= "<table class='table adminform'>
<tr><td colspan='2'><h4>".ucfirst(LAN_OPTIONAL)."</h4></td></tr>

<tr>
<td class='col-label'>To generate your <em>".$this->pluginName."_sql.php</em> table creation file, please select your sql table then click 'Refresh'</td>
<td class='col-label'>".$lanSelectTable."</td>
<td class='form-inline'>";

$text .= $frm->select('build', $tables, null, array('useValues'=>1), "(".LAN_OPTIONAL.")");
Expand Down Expand Up @@ -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');
Expand Down
60 changes: 33 additions & 27 deletions e107_handlers/plugin_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 </html>)"
);
private $plugin_addons_diz = array(); // i18n via getAddonsDiz()


var $disAllowed = array(
Expand Down Expand Up @@ -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 </html>).
'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];
Expand Down
32 changes: 32 additions & 0 deletions e107_languages/English/admin/lan_plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 </html>)",
'EPL_ADLAN_289' => "Customize the [Print] function for your plugin's content.",
];
2 changes: 1 addition & 1 deletion e107_languages/English/lan_print.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 16 additions & 0 deletions e107_tests/tests/unit/e107pluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
40 changes: 40 additions & 0 deletions e107_tests/tests/unit/lanPrintTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2026 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* Regression test for issue #5606: lan_print.php must not define PAGE_NAME
* as a side effect. Doing so would leak "Printer Friendly" into the <title>
* 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.'
);
}

}
1 change: 1 addition & 0 deletions print.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading