Subject: Adding to admin templates
Posted on: 22/02/10 09:11pm
By: suprsidr
Is it possible to add to admin templates?
with something similar?
PHP Formatted Code
function plugin_templatesetvars_G2Bridge
($type, &$template) {
if ($type == 'storyeditor_advanced'){
$template->set_var('gallery_upload', $upload_display);
}
}
Sorry, I know very little about gl's templating system.
Thanks,
-s
Re: Adding to admin templates
Posted on: 23/02/10 03:28am
By: Dirk
The current list (from 1.6.1's lib-custom.php) is:
PHP Formatted Code
/**
* Include any code in this function to add custom template variables.
*
* Called from within Geeklog for:
* - 'header' (site header)
* - 'footer' (site footer)
* - 'storytext', 'featuredstorytext', 'archivestorytext' (story templates)
* - 'story' (story submission)
* - 'comment' (comment submission form)
* - 'registration' (user registration form)
* - 'contact' (email user form)
* - 'emailstory' (email story to a friend)
*
* This function is called whenever PLG_templateSetVars is called, i.e. in
* addition to the templates listed here, it may also be called from plugins.
*
* @param string $templatename name of the template, e.g. 'header'
* @param ref &$template reference to the template
* @return void
* @see PLG_templateSetVars
*
*/
So, no admin templates currently. I don't see a reason not to add them, though. Are you missing anything specific?
bye, Dirk
Re: Adding to admin templates
Posted on: 23/02/10 08:29am
By: suprsidr
Are you missing anything specific?
Several actually, but let me suggest a more global approach.
Once we too briefly discussed the need and method of adding additional content/tabs to the user profile.
I believe I've found such a solution and the admin navbar/tabbed content sections could benefit as well.
I'm currently working on a user request to have a tab in the story editor with gallery's upload applet embedded so you don't have to pre-upload images or leave the editor to do so.
My approach so far:
- using javascript (preferrably jQuery) add our extra tab to the nav and hidden content <div> to our options using appendChild:
PHP Formatted Code
jQuery
("#navlist").append
('<li><a onclick="showhideEditorDiv(\'upload\',6);return false;" href="#"><span style="padding-top: 5px;">Upload</span></a></li>');
jQuery
("#se_options").append
('<div id="se_upload" style="width:100%; border:1px dashed grey; padding:0; margin-top:10px; display:none;"><div style="margin:10px;">{gallery_upload}</div></div>');
- Next I had to edit advanced_editor.js and add my item to the divarray:
PHP Formatted Code
var divarray
= new Array('publish','images','archive','perms','options','bottom', 'upload');
- the next logical step would be to add load my content to my container ({gallery_upload}) via plugin_templatesetvars but progress halted there.
The above would also work for the profile editor as previously I wanted to add a subscription management tab for newsletters.
If the site's hard coded javascript was php so it could be more dynamic we could add to the divarray on the fly.
If plugin_templatesetvars worked across more templates...
Maybe a new plugin_attachvars or similar to allow plugin developers to target specific templates or a logical template var and placement of collected plugin code additions. <- still kinda fuzzy here as to the best approach.
This is at least the second time as a plugin developer my progress has halted due to missing methods to add content when/where I want.
Geeklog needs such capabilities.
-s
Re: Adding to admin templates
Posted on: 23/02/10 02:58pm
By: Dirk
Quote by: suprsidrThis is at least the second time as a plugin developer my progress has halted due to missing methods to add content when/where I want.
Geeklog needs such capabilities.
Are you on the geeklog-devel mailing list? I think technical issues like that are better discussed there.
bye, Dirk
Re: Adding to admin templates
Posted on: 23/02/10 03:20pm
By: suprsidr
I am now
Any insight on my localization issue?
http://www.geeklog.net/forum/viewtopic.php?showtopic=89802
-s
Re: Adding to admin templates
Posted on: 23/02/10 04:02pm
By: ::Ben
The above would also work for the profile editor as previously I wanted to add a subscription management tab for newsletters.
To add the user option to control email subscription you can use PLG_profileVariablesEdit
See http://eight.pairlist.net/pipermail/geeklog-modules/2003-June/000113.html
::Ben
Re: Adding to admin templates
Posted on: 23/02/10 04:05pm
By: ::Ben
But the ability to add a new tab to the user settings would be a nice feature.
::Ben
Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=89804