Hi!
relevant_admin_panel can already be found via some magic trick that
Jonny did in the admin panel search.
When you search a pref, it tells you all the relevant panels it can be
found in. And this requires no maintenance.
How about just a search for the exact pref name, and thus, we would
get the link to relevant admin panel "magically"?
Thanks!
M ;-)
On Sun, Feb 7, 2010 at 1:54 AM, <pkdille@...> wrote:
> Revision: 24906
> http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24906&view=rev
> Author: pkdille
> Date: 2010-02-07 06:54:28 +0000 (Sun, 07 Feb 2010)
>
> Log Message:
> -----------
> [MOD] accesslib: all admin panels are reachable through tiki-admin.php. The name of the panels is enough to build the url. Also some minor cleanups
>
> Modified Paths:
> --------------
> trunk/lib/tikiaccesslib.php
>
> Modified: trunk/lib/tikiaccesslib.php
> ===================================================================
> --- trunk/lib/tikiaccesslib.php 2010-02-07 06:31:00 UTC (rev 24905)
> +++ trunk/lib/tikiaccesslib.php 2010-02-07 06:54:28 UTC (rev 24906)
> @@ -47,7 +47,16 @@
> }
> }
>
> - function check_feature($features, $feature_name="", $url_to_relevant_admin_panel="tiki-admin.php?page=features") {
> + /**
> + * check_feature: Checks if a feature or a list of features are activated
> + *
> + * @param string or array $features If just a string, this method will only test that one. If an array, all features will be tested
> + * @param string $feature_name Name that will be printed on the error screen
> + * @param string $relevant_admin_panel Admin panel where the feature can be set to 'Y'. This link is provided on the error screen
> + * @access public
> + * @return void
> + */
> + function check_feature($features, $feature_name='', $relevant_admin_panel='features') {
> global $prefs;
> require_once ('tiki-setup.php');
>
> @@ -61,16 +70,22 @@
> if ( ! is_array($features) ) { $features = array($features); }
> foreach ($features as $feature) {
> if ($prefs[$feature] != 'y') {
> - if ($feature_name != '') { $feature = $feature_name; }
> + if ($feature_name != '') {
> + $feature = $feature_name;
> + }
> +
> global $smarty;
> if( $perms->admin ) {
> $smarty->assign('required_preferences', $features);
> }
> - $msg = tra("This feature is disabled").": <b>". $feature."</b>\n<P>\n".
> - tra('To enable this feature, go to:').
> - " <a href=\"$url_to_relevant_admin_panel\">".tra('Admin Feature').'</a>. '."\n<P>\n".
> - tra('If you do not have privileges to activate this feature, ask the site admin to do it.').'</a>';
>
> + $msg = tra('This feature is disabled') . ': <b>' . $feature . "</b>\n<P>\n"
> + . tra('To enable this feature, go to:')
> + . " <a href=\"tiki-admin.php?page=$relevant_admin_panel\">" . tra('Admin Feature') . '</a>. '
> + . "\n<P>\n"
> + . tra('If you do not have privileges to activate this feature, ask the site admin to do it.')
> + ;
> +
> $this->display_error('', $msg, '503' );
> }
> }
>
>
> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Tikiwiki-cvs mailing list
> Tikiwiki-cvs@...
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
>
--
Marc Laporte
http://MarcLaporte.com
http://TikiWiki.org/MarcLaporte
http://AvanTech.net
http://OurWiki.net
|