Giter Site home page Giter Site logo

Comments (12)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
Ok guys, I've started working on this. Have the base system up and running as 
per the 
WP plugin system you sent Chris. Works a treat.. Really impressed, would never 
have 
though of doing it like this... 

Converting my Themetags to a plugin at the moment. 

I'll work on an offline copy for the next day or so and send ye guys the 
updates to 
try. 

Mike. 


Original comment by [email protected] on 4 Jan 2010 at 11:05

from get-simple-cms.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
Including files from the plugins directory like so at the end of index.php: 

// include any plugins 
$pluginfiles = getFiles('admin/plugins/');
 foreach ($pluginfiles as $fi) {
 $path_parts = pathinfo($fi);
 if ($path_parts['extension']=="php"){
  include('admin/plugins/'.$fi);
 }
}


You have any other way of doing this? 


Original comment by [email protected] on 4 Jan 2010 at 1:07

from get-simple-cms.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
This looks like it should work. We should also do this inside of
/admin/inc/functions.php - Hopefully we won't have any file-path issues.

We also need to start thinking about a "hook" naming convention.

Original comment by ccagle8 on 4 Jan 2010 at 1:55

from get-simple-cms.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
what about "filename-function" for the hook names. 

For my Tags plugin I need 3 . 

o - 1 in index.php called "index.shutdown"   (WP uses shutdown for the end of 
files) 
this calls a function to make the new tags available to the theme. 
o - on the backend I need 2 on the edit Page. "edit-save" & "edit-extras" 
one to save the new options and one to print them out, 


Updated the plugin so it's all contained in one file now, no more tags.xml , 
all 
options help in php array. This also means tags are available to all installed 
themes. If you changed themes on the old system you lost the tags. 




Original comment by [email protected] on 4 Jan 2010 at 3:37

from get-simple-cms.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
In order to get the Plugin system working I've had to move chagedata.php down a 
level 
to the admin folder. The relative paths are causing the problem. 

You guys have a problem with this ? 



Original comment by [email protected] on 4 Jan 2010 at 8:06

from get-simple-cms.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
does everything still work fine when you do that? are the backups still 
created? 

I tried to set a define('DOCROOT') variable to get rid of the relative paths, 
but had
trouble because the architecture of the site didn't really work well with 
setting a
defined variable right off the bat. I think I'll have another go at it later on.

For now, if everything still works - move the file - its an even bigger problem 
if we
continue to not have a plugin system.

Original comment by ccagle8 on 4 Jan 2010 at 8:37

from get-simple-cms.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
Ok Guys,  Have the plugin system ready to go. 

what needs to be done. 

o - changedata.php needs to move up a level to /admin
o - new file plugins.php
o - This file need to be included in any file that requires plugin hooks or we 
merge the functions with into 
another file, but I can't see 1 file used by all.
o - Once included we need to setup all the hooks we think we'll require. 
we need to insert the following line wherever we want hooks to be enabled. 

exec_hook('filename-hookname');

Plugins/templates can then setup a hook using: 

add_action('filename-hookname', 'user_function',array());   // array of args... 

I've added 2 functions that allow the creation of Tabs and Menu items. 

So for e.g. if you want your plugin to display an extra menu option say on the 
theme Sidebar 
we would have hook in there called 

exec_hook('sidebar-theme-menu');

sample plugin which just adds new item to menubar could be ;

admin/plugins/myplugin.php
---------------------------

// createSideMenu($url,$text) 
add_action('sidebar-theme-menu','createSideMenu',array('mypage.php','Myplugin'))
; 


I've attached the plugins.php
and my first plugin themetags.php which allows the extra options to be 
automatically added to pages. 

It requires 3 hooks; 

index-shutdown   -   at the end of the main index.php on root which makes all 
extra options available to themes 
in the format $tags[name]['value']

edit-extras      - in edit.php just below the end of the table. This read in 
the new options and creates the new 
form items. 

changedata-save  - in changedata.php just before the XML file is saved. This 
saves the page with the new 
options. 

Options are now setup using the $tags Array. At the moment it supports text 
input and a dropdown box.
This could be expanded for other options if required. 


So what do I do next, should I branch off the main build and upload my updates 
to there and we can merge later?
And you guys could check out the system. 

Mike. 







Original comment by [email protected] on 5 Jan 2010 at 1:59

Attachments:

from get-simple-cms.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
I'm not sure how we merge... do you? 

I like the name plugin_functions.php to keep it similar with other files. 

Since 2.0 is still in it's early stages, it might be best to just change the 
main SVN
repository. I think having a working plugin system is vital for 2.0 and since 
we plan
on putting a security release out soon, 2.0 can take it's good old time to make 
sure
the plugin system is working correctly. 

Great job on this Mike - I am really excited about it all.

Original comment by ccagle8 on 5 Jan 2010 at 2:45

from get-simple-cms.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
Your asking an svn newbie here .. 8) 
Found some good docs here: http://svnbook.red-bean.com/en/1.0/ 

Will change the name of the plugins file. 

Will update my local copy this evening and I'll update the SVN later. 




Original comment by [email protected] on 5 Jan 2010 at 3:23

from get-simple-cms.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
Switched the issue status around a little.

Looking good Mike, I just spotted the files having been updated on the SVN. 
I’ll see
whether I can get the security patches to work on this latest version.

Original comment by [email protected] on 6 Jan 2010 at 10:16

  • Changed state: Started

from get-simple-cms.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
Currently writing documentation on the Plugin system

Original comment by [email protected] on 7 Jan 2010 at 1:19

from get-simple-cms.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 27, 2024
I think this is implemented enough that we can start adding specific problems 
with the 
plugin system to the issue tracker. Great job Mike

Original comment by ccagle8 on 17 Jan 2010 at 11:21

  • Changed state: Fixed

from get-simple-cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.