2010-01-21, 10:18:07
Especially for plugins? A list of the hooks available would be cool.
Any documentation?
|
2010-01-21, 10:18:07
Especially for plugins? A list of the hooks available would be cool.
2010-01-21, 10:54:01
(This post was last modified: 2010-01-21, 11:03:55 by martynas.barzda.)
I've found some
Hooks: nav-tab - top of admin panel will be beside [backup] Quote: plugin-tab - inside of admin panel plugin page below other plugin tabs Code: add_action('plugin-sidebar','createSideMenu', array('folderthatyourpluginpageisin','pagename','Title of page'));
http://nijikokun.com
random stuff. idk.
2010-01-21, 10:57:43
Documentation is coming for the plugins soon... We are still trying to finalize where the hooks should be: http://get-simple.info/forum/viewtopic.php?id=325
Almost everything else is here
2010-01-21, 11:12:41
What about the include paths? I'm having trouble creating a plugin b/c it's in the plugins/myplugin folder, and I can't include the functions.php file because it's 3 directories up. Since there is no bootstrap file or constants I'm finding it difficult to just create a file in my plugin folder, and including all the necessary inc/core files.
2010-01-21, 11:16:29
We know about this. It is a failure on my part when I originally created GS. Without a complete rewrite of the code, I do not know how I am going to do this.
NY suggested using common.php for this, and it might work, but I am not familiar with finding document root enough to write something that is cross-platform to include there. Feel free to contribute code that would help us all... BTW: Any variable in common.php will be available to any plugin page/page within the admin panel.
2010-01-21, 11:41:53
This right here should always return the full path to the admin folder, so long as the admin folder isn't renamed.
Code: function get_admin_path()
2010-01-21, 12:06:24
litzinger - Thanks! Doesn't look so hard there... I think I am going to add this into the common.php file as a defined variable. I just tested and it shows the same path no matter where I am in the admin panel.
Any idea how to get the root of the whole installation? (where index.php and .htaccess is located)
2010-01-21, 12:23:55
Ok, I have a feeling this could work, or I could be onto something. It would involve setting the include path if someone defines either PATH_ADMIN or PATH_ROOT before trying to load those files, then from there on out those files will set the include path if either one of those constants are defined.
The following is in admin/plugins/channels/index.php Code: /**************************************************** admin/plugins/channels/config.php Code: <?php admin/inc/functions.php Code: <?php
2010-01-21, 12:27:54
(This post was last modified: 2010-01-21, 12:47:22 by martynas.barzda.)
I think I'm going to rewrite a lot of get simple to revolve around a common file, this would solve about 80% of problems.
I see where you main problem is, you already have basically a common file just you named it terribly. Your file system: Code: - functions.php [ not really functions but inclusions ] This is where its wrong. It should be like this: Code: - variables for common So that way: Code: <?php Inside of common.php Code: /**************************************************** No need for multiple files, multiple code repetitions, ect. It `simplifies` things.
http://nijikokun.com
random stuff. idk.
2010-01-21, 12:51:47
(This post was last modified: 2010-01-21, 13:00:10 by katalonian.)
Here is what my functions.php file looks like now. Right now I'm getting a "Unable to open plugins/" error, but it's further along than before.
I like Nijikokun's approach, but that means you're going to have to use globals because there is no bootstrap. Defined constants are only available in files that include the creation of the defined variables (I think). So if admin/index.php loads common.php, then you could use the get_path method below, or something similar then create a single global var for people to use in their plugins to load files.... e.g. Code: global $PATH_ROOT; That may be a way around the set_include_path method I tried below, but I don't know what other implications that may have because I'm very unfamiliar with the code base. I noticed the site doesn't really use constants, so I changed it to capitalized variables. Code: <?php Code: <?php
2010-01-21, 13:01:07
(This post was last modified: 2010-01-21, 13:02:10 by martynas.barzda.)
^- you are wrong. Variables that are set inside of a file are instantly available in included files that are inside that file after variables are set. I've gotten it already setup.
Chris you also repeat a lot of code, programming is so you don't have to do that.. There are a lot of repeated language setups. Like in login, you don't need it.
http://nijikokun.com
random stuff. idk.
2010-01-21, 13:24:08
Nijikokun Wrote:Chris you also repeat a lot of code, programming is so you don't have to do that.. There are a lot of repeated language setups. Like in login, you don't need it. I know I did... I originally created GS as a quick project then kept adding to it. I didn't sit down and draw up a design document because I wasnt releasing it as a publicly supported app... it just sort of grew into that. Maybe these changes need to be thought out a little more so we can sit down and draw it up correctly. I agree with many points here, but i don't think that so close to the 2.0 launch we need to change things around so drastically... It works now, maybe not completely efficient, but that is something we can fix once 2.0 is out and mature. 2.0 should give people a stable great little CMS. I am hoping that maybe at 3.0 we can start introducing a new and improved (read: efficient) infrastructure. If we just get the constants right in 2.0, then no plugins will need to change after the infrastructure change. Does this make sense? If we try and rewrite a ton of code now, 2.0 will not get out for quite some time.
2010-01-21, 13:31:57
I'm over 60% done with the rewrite of 2.0b surrounding a common file~
http://nijikokun.com
random stuff. idk.
2010-01-21, 13:35:36
Thanks. I'm open to implementing any changes that test out OK. Send me the whole code via email so the team and I can take a look at it as well and test.
2010-01-21, 13:37:45
Alright, I'll do it once I'm sure Its done, and honestly, it makes me a lot happier the way I have it.
http://nijikokun.com
random stuff. idk.
2010-01-21, 23:07:29
2010-01-22, 01:08:07
How come we can't define the folders like some other scripts?
IE $admin_folder = http://domain.com/admin/ $admin_inc_folder = http://domain.com/admin/inc/ $site_folder = http://domain.com/ All that can be dynamically written and put in the common.php file. Then if you call a script, reference the folder it is in. IE, the uploadify script uploads to the data/uploads/ folder so you could reference something like this... $uploading = $data_upload.'__FILE__'; // you get the point.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.
Have you ever coded in your underwear before?
2010-01-25, 05:32:15
internet54 Wrote:How come we can't define the folders like some other scripts? This has been added into 2.0 beta3, here is what I have so far: Code: define('GSROOTPATH', get_root_path()); |
« Next Oldest | Next Newest »
|