Welcome to Geeklog, Anonymous Tuesday, November 26 2024 @ 04:38 pm EST

Geeklog Forums

Adding to admin templates


Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
Is it possible to add to admin templates?
with something similar?
Text 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
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The current list (from 1.6.1's lib-custom.php) is:
Text 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
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
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:
    Text 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:
    Text 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

FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: suprsidr

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.


Are you on the geeklog-devel mailing list? I think technical issues like that are better discussed there.

bye, Dirk
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
I am now Smile

Any insight on my localization issue?
http://www.geeklog.net/forum/viewtopic.php?showtopic=89802

-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
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
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
But the ability to add a new tab to the user settings would be a nice feature.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

All times are EST. The time is now 04:38 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content