Skip to main content
Topic: Couple Admin stuffz (Read 11129 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Couple Admin stuffz

Ok so after working for an hour or so here on getting a basic modification started in elkarte I have a few questions and/or suggestions.

1. Package xml file looks like it supports all the new CONST variables that have been added in the index.php file. But it left me wondering, why is there not a THEMEDIR, so instead it's the only line with $themedir... Right now this is how my xml file looks:
Code: [Select]
	<install for="1.0-1.0.99">
<require-dir name="sources" destination="BOARDDIR" />
<require-dir name="themes" destination="BOARDDIR" />
<hook hook="integrate_frontpage" file="SUBSDIR/IntegrationHandler.class.php" function="IntegrationHandler::integrateHomePage" />
</install>

<uninstall for="1.0-1.0.99">
<remove-file name="SUBSDIR/IntegrationHandler.class.php" />
<remove-file name="CONTROLLERDIR/Home.controller.php" />
<remove-file name="$themedir/Home.template.php" />
<remove-file name="LANGUAGEDIR/english/Home.english.php" />
<hook reverse="true" hook="integrate_frontpage" file="SUBSDIR/IntegrationHandler.class.php" function="IntegrationHandler::integrateHomePage" />
</uninstall>

My other suggestions are, it seems like we have some duplicate stuff going on for packman pages. Both the links to the Browser Packages and Installed Packages show pretty much duplicate data (minus a few minor things) displayed on the pages. Is this on purpose, or something that nobody realized yet? Seems like a waste.

Seems like a long way to go into Admin > Packages, only to have to click on Main > Package Servers > Upload Package to get to the upload page. Having upload package in there seems like the wrong place to me too. Maybe it's just me. But uploading a mod seems like it should be in the package manager section.

Just some thoughts for now. :)
Success is not the result of spontaneous combustion, you must set yourself on fire!

Re: Couple Admin stuffz

Reply #1

Also based on this:
Code: [Select]
		$adminActions = array('admin', 'jsoption', 'theme', 'viewadminfile', 'viewquery');

// Allow to extend or change $actionArray through a hook
call_integration_hook('integrate_actions', array(&$actionArray));

Any reason we can't pass $adminAction into that integration hook if someone wants to add an admin section for their own mod? That way, admin controllers can all be organized in the same places etc.


Shouldn't this from Subs.php:
Code: [Select]
// Allow editing menu buttons easily.
call_integration_hook('integrate_menu_buttons', array(&$menu_count));

Be this?
Code: [Select]
// Allow editing menu buttons easily.
call_integration_hook('integrate_menu_buttons', array(&$menu));

$menu_count seems to be the number for mentions and unread pms, so I don't think it should be passed into the hook. Unless I'm not understanding all of this. OOP stuff is still new to me in PHP...
Pull request for fix:
https://github.com/elkarte/Elkarte/pull/1115
Last Edit: November 29, 2013, 10:49:24 pm by IchBin
Success is not the result of spontaneous combustion, you must set yourself on fire!

Re: Couple Admin stuffz

Reply #2

Not necessarily.
All the menus are in a static class, so you can access them from anywhere calling the static class, "getting" the menu you want to change and then manipulating it.

The menu count, instead, is not "yet" part of the menu itself, so it has to be passed through the hook.
Have it "directly" into the data of the menu class should be something to think about...
Bugs creator.
Features destroyer.
Template killer.

Re: Couple Admin stuffz

Reply #3

Quote from: IchBin – 1. Package xml file looks like it supports all the new CONST variables that have been added in the index.php file. But it left me wondering, why is there not a THEMEDIR, so instead it's the only line with $themedir
This is the current set of dirs replaced:
Code: [Select]
		'BOARDDIR' => BOARDDIR,
'SOURCEDIR' => SOURCEDIR,
'SUBSDIR' => SUBSDIR,
'ADMINDIR' => ADMINDIR,
'CONTROLLERDIR' => CONTROLLERDIR,
'$avatardir' => $modSettings['avatar_directory'],
'$avatars_dir' => $modSettings['avatar_directory'],
'$themedir' => $settings['default_theme_dir'],
'$imagesdir' => $settings['default_theme_dir'] . '/' . basename($settings['default_images_url']),
'$themes_dir' => BOARDDIR . '/themes',
'LANGUAGEDIR' => $settings['default_theme_dir'] . '/languages',
'$languages_dir' => $settings['default_theme_dir'] . '/languages',
'$smileysdir' => $modSettings['smileys_dir'],
'$smileys_dir' => $modSettings['smileys_dir'],
It's a bit of a mixture and I'd even be tempted to just always use a variable-like scheme (e.g $boarddir, $sourcedir, etc.) or something that is evidently a replacement like '{BOARDDIR}'.

Quote from: IchBin – My other suggestions are, it seems like we have some duplicate stuff going on for packman pages. Both the links to the Browser Packages and Installed Packages show pretty much duplicate data (minus a few minor things) displayed on the pages. Is this on purpose, or something that nobody realized yet? Seems like a waste.
The first page is supposed to show any mod you have on the server, while the second just those that are installed.
But yes, the two pages use exactly the same code (AFAIR).
Of course we could add a droppy somewhere or some other kind of link to show only the installed ones without having to go to another page...

Quote from: IchBin – Seems like a long way to go into Admin > Packages, only to have to click on Main > Package Servers > Upload Package to get to the upload page. Having upload package in there seems like the wrong place to me too. Maybe it's just me. But uploading a mod seems like it should be in the package manager section.
I tend to agree.
I think the subdivision comes from Norv's reorganization of the admin area. I think the idea is/was to give more prominence to the "package server" section and promote it as the main place from which retrieve packages.
Though I see it a bit problematic me too: an entire section doesn't mean make it more prominent, to me it means make it more difficult to use.
In package manager, do we really need the "settings" page? There is only the ftp details and IIRC we do not store that settings anywhere in the db, s it's pretty much useless.
File permissions looks more as a maintenance page rather than a "package manager" one.
Package server can be a section of package manager, maybe with some tabs or anything to handle the different options.
Bugs creator.
Features destroyer.
Template killer.

Re: Couple Admin stuffz

Reply #4

Quote from: emanuele – Not necessarily.
All the menus are in a static class, so you can access them from anywhere calling the static class, "getting" the menu you want to change and then manipulating it..
https://bitbucket.org/spuds_/elk_simpleportal/src/d2c569555053f46c0df9768bd52517c0f54ec03f/Sources/PortalIntegration.subs.php?at=master#cl-40 don't know if that helps or not but its how I used the static menu class to add in the simpleportal menu items etc ... now I can't say that's the best way  either, its emanuele's baby  :)

QuoteThis is the current set of dirs replaced:
Is that really how that looks now  :'( we really have all those duplicates?
Code: [Select]
'$avatardir' => $modSettings['avatar_directory'],
'$avatars_dir' => $modSettings['avatar_directory'],
'$smileysdir' => $modSettings['smileys_dir'],
'$smileys_dir' => $modSettings['smileys_dir'],
                'LANGUAGEDIR' => $settings['default_theme_dir'] . '/languages',
'$languages_dir' => $settings['default_theme_dir'] . '/languages',

QuoteMy other suggestions are, it seems like we have some duplicate stuff going on for packman pages. Both the links to the Browser Packages and Installed Packages show pretty much duplicate data (minus a few minor things) displayed on the pages. Is this on purpose, or something that nobody realized yet? Seems like a waste.
I've been struggling ever since we separated out those two areas,  months later I'm still not used to downloading a package being moved to package servers and not in packages. Sure some of that is because I was used to it another way, but now its been that way long enough for use to ask does it make sense to have that level of separation.  I tend to think not.
Last Edit: November 30, 2013, 01:07:27 pm by Spuds

Re: Couple Admin stuffz

Reply #5

hmmm... seems I am revisiting things I guess. Thanks for the explanations guys. And it looks like I don't understand some things like I thought.  :-[

Oh, and thanks for making the menu as complicated as possible ema... lol
Success is not the result of spontaneous combustion, you must set yourself on fire!