The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add new page: prepopulate fields from http get parameters
#1
For my I18N plugin I needed to call the edit page in a way that some meta data was prefilled.
In order to do this, I needed to patch the admin/edit.php:

Code:
...
if ($id)
{
  ...
}
else
{
  // --- add the following lines
  if (isset($_GET['parent'])) $parent = $_GET['parent'];
  if (isset($_GET['template'])) $template = $_GET['template'];
  if (isset($_GET['metak'])) $metak = $_GET['metak'];
  if (isset($_GET['metad'])) $metad = $_GET['metad'];
  if (isset($_GET['menu-enable'])) $menuStatus = $_GET['menu-enable'];
  if (isset($_GET['menu-order'])) $menuOrder = $_GET['menu-order'];
  if (isset($_GET['private'])) $private = $_GET['private'];
  if (isset($_GET['title'])) $title = $_GET['title'];
  if (isset($_GET['menu'])) $menu = $_GET['menu'];
  if (isset($_GET['newid'])) $url = $_GET['newid'];
  // --- add end
  $buttonname = $i18n['BTN_SAVEPAGE'];
}
...

It would be nice to include this in the next release to allow plugins to prepopulate fields to simplify the use of the CMS.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
Add new page: prepopulate fields from http get parameters - by mvlcek - 2011-01-10, 07:15:51



Users browsing this thread: 1 Guest(s)