Changeset 1705 for trunk/admin/include


Ignore:
Timestamp:
Jan 9, 2007, 12:38:54 PM (17 years ago)
Author:
rvelices
Message:

Plugins: new way of adding links and content to administration pages...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_plugins.inc.php

    r1604 r1705  
    22// +-----------------------------------------------------------------------+
    33// | PhpWebGallery - a PHP based picture gallery                           |
    4 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
     4// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
    55// +-----------------------------------------------------------------------+
    66// | branch        : BSF (Best So Far)
     
    6969}
    7070
    71 /*allows plugins to add their content to the administration page*/
    72 function add_plugin_admin_menu($title, $func)
     71/**
     72 * Retrieves an url for a plugin page.
     73 * @param string plugin_id
     74 * @param string page - the php script file name (without .php extension)
     75 */
     76function get_admin_plugin_menu_link($plugin_id, $page)
    7377{
    74   global $page;
    75   if ( is_array( $func) )
    76   {
    77     $s = '';
    78     foreach( $func as $e)
    79     {
    80       if (is_object($e))
    81       {
    82         $s.=get_class($e)."\n";
    83       }
    84       else
    85       {
    86         $s.=$e;
    87       }
    88     }
    89     $uid = md5( $s );
    90   }
    91   else
    92   {
    93     $uid = md5( $func );
    94   }
    95   $page['plugin_admin_menu'][] =
    96     array(
    97       'title' => $title,
    98       'function' => $func,
    99       'uid' => $uid
    100     );
     78  $url = get_root_url().'admin.php?page=plugin&section='
     79    .urlencode($plugin_id .'~'. $page);
     80  return $url;
    10181}
    10282
Note: See TracChangeset for help on using the changeset viewer.