Non-core contributed modules

Content Pages for Moodle

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.4, 2.0
  • Fix Version/s: None
  • Component/s: Patch: Page block
  • Labels:
    None
  • Environment:
    Should integrate with any Moodle version 1.9 and higher.
    Tested on Fedora Linux and Mac OSX with Moodle 1.9.X.

Description

Moodle works well for a course management system, but is not easily used as an informative website. The current method is often creating courses with only a summary, acting as general content pages.

This patch gives Moodle its own page system, which is separate from the course system and can be used to provide a general-style website, while still keeping the Moodle back-end for courses.

Attached is the "page" folder, which includes a pagelib, display page, and editing pages using formslib. It relies on role capabilities that are not standard in Moodle (such as page:create; and page:delete), which can be attached as a patch. I have also written a patch to add the page management to the Administration Sidebar.
Also attached is the XMLDB outline for the pages table.

Activity

Hide
Anthony Borrow added a comment -

Darryl - Sorry for the delay in responding to this request. I got caught up in finishing off a demanding semester of studies. Now I am trying to play a little catch up before taking off for the holidays. I've downloaded the files and will be taking a look at them to see if this is a patch/plugin or what you have in the code. Thanks for sharing your creativity with the larger Moodle community. I'm not sure why this was tagged as a possible security issue. Do you have any insights on that? Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - Sorry for the delay in responding to this request. I got caught up in finishing off a demanding semester of studies. Now I am trying to play a little catch up before taking off for the holidays. I've downloaded the files and will be taking a look at them to see if this is a patch/plugin or what you have in the code. Thanks for sharing your creativity with the larger Moodle community. I'm not sure why this was tagged as a possible security issue. Do you have any insights on that? Peace - Anthony
Hide
Anthony Borrow added a comment -

Darryl - I've taken a quick look at the code and wondered if this might not be better in the local folder. In particular, you may want to take a look at:
http://docs.moodle.org/en/Development:Local_customisation#local.2Fdb.2Finstall.xml which would address how you could use /local/upgrade.php to automatically handle the install. My goal with this would be to make this a pretty simple plugin and instead of putting it in the root directory of the Moodle installation. Also, did you include the language files? I saw a reference to a page.php (for example, get_string('pages', 'page')) but did not see where that file was. If it were in local I believe we could just put the lang file there without having to modify anything in the core code. The local folder could also handle creating the new capabilities. Let me know what you think and how I can be supportive of your efforts. Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - I've taken a quick look at the code and wondered if this might not be better in the local folder. In particular, you may want to take a look at: http://docs.moodle.org/en/Development:Local_customisation#local.2Fdb.2Finstall.xml which would address how you could use /local/upgrade.php to automatically handle the install. My goal with this would be to make this a pretty simple plugin and instead of putting it in the root directory of the Moodle installation. Also, did you include the language files? I saw a reference to a page.php (for example, get_string('pages', 'page')) but did not see where that file was. If it were in local I believe we could just put the lang file there without having to modify anything in the core code. The local folder could also handle creating the new capabilities. Let me know what you think and how I can be supportive of your efforts. Peace - Anthony
Hide
Darryl Pogue added a comment -

Woah! That local customization stuff looks like it's exactly what I need!

I'll see if I can get it all set up using the /local dir, and then repackage it up for people

Show
Darryl Pogue added a comment - Woah! That local customization stuff looks like it's exactly what I need! I'll see if I can get it all set up using the /local dir, and then repackage it up for people
Hide
Anthony Borrow added a comment -

Awesome, thanks. Once you get it repackaged, just upload it here and I'll give it a quick review and trial run and see if we can't get it added into CVS. Peace - Anthony

Show
Anthony Borrow added a comment - Awesome, thanks. Once you get it repackaged, just upload it here and I'll give it a quick review and trial run and see if we can't get it added into CVS. Peace - Anthony
Hide
Martin Dougiamas added a comment -

Sorry Anthony, but I don't think "local" is the way to go here ...

local is really means for local hacks that don't need to get redistributed. It doesn't support plugins (so you couldn't install "pages" as well as anything else).

I think the best place might actually be as a block:

  • supports full upgrade capability, languages, admin menu settings etc
  • can put a block-based management interface for itself on the front page for admins.

The only downside is that the URLs are not quite as nice:

http://mysite.com/blocks/page/43

But I can live with that I think .

There will still need to be a small hack in /index.php to include the menu at the top of the page.

I'd love to include something like this in Moodle 2.0!

Show
Martin Dougiamas added a comment - Sorry Anthony, but I don't think "local" is the way to go here ... local is really means for local hacks that don't need to get redistributed. It doesn't support plugins (so you couldn't install "pages" as well as anything else). I think the best place might actually be as a block:
  • supports full upgrade capability, languages, admin menu settings etc
  • can put a block-based management interface for itself on the front page for admins.
The only downside is that the URLs are not quite as nice: http://mysite.com/blocks/page/43 But I can live with that I think . There will still need to be a small hack in /index.php to include the menu at the top of the page. I'd love to include something like this in Moodle 2.0!
Hide
Anthony Borrow added a comment -

Thanks Martin - I was aware that the local idea had some limitations and agree that block is probably the best way to go. I'll continue working with Darryl to get this developed in CONTRIB and then when it is ready we can create an issue to consider adding it 2.0. Peace - Anthony

Show
Anthony Borrow added a comment - Thanks Martin - I was aware that the local idea had some limitations and agree that block is probably the best way to go. I'll continue working with Darryl to get this developed in CONTRIB and then when it is ready we can create an issue to consider adding it 2.0. Peace - Anthony
Hide
Anthony Borrow added a comment -

Darryl - Just wanted to follow up and say that it looks like it might be better to treat this as a patch rather than a plugin so go ahead and add the file creation stuff to the normal core files. Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - Just wanted to follow up and say that it looks like it might be better to treat this as a patch rather than a plugin so go ahead and add the file creation stuff to the normal core files. Peace - Anthony
Hide
Darryl Pogue added a comment -

Is there a preferred version against which to patch? 1.9.x? 2.0?

Thanks,
~Darryl

Show
Darryl Pogue added a comment - Is there a preferred version against which to patch? 1.9.x? 2.0? Thanks, ~Darryl
Hide
Anthony Borrow added a comment -

Darryl - Sort of both. I would prepare a patch for 1.9 since that is what most folks are using and you are more likely to get folks to do some testing but also have a 2.0 patch that can be considered for including in Moodle 2.0 (HEAD). Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - Sort of both. I would prepare a patch for 1.9 since that is what most folks are using and you are more likely to get folks to do some testing but also have a 2.0 patch that can be considered for including in Moodle 2.0 (HEAD). Peace - Anthony
Hide
Darryl Pogue added a comment -

Okay, ignoring the files already posted, here is the first of a series of patches against Moodle 2.0 CVS HEAD.

This patch adds the necessary roles, capabilities, and database table to Moodle. Please let me know if you see any problems.

I'm a bit curious as to how one would add new capabilities to an existing Moodle installation. In the past, I've done it by hand-modifying the database, but many people shy away from doing that. Is there any documentation about how I would go about patch the new capabilities into 1.9?

Thanks,
~Darryl

Show
Darryl Pogue added a comment - Okay, ignoring the files already posted, here is the first of a series of patches against Moodle 2.0 CVS HEAD. This patch adds the necessary roles, capabilities, and database table to Moodle. Please let me know if you see any problems. I'm a bit curious as to how one would add new capabilities to an existing Moodle installation. In the past, I've done it by hand-modifying the database, but many people shy away from doing that. Is there any documentation about how I would go about patch the new capabilities into 1.9? Thanks, ~Darryl
Hide
Anthony Borrow added a comment -

Darryl - Just getting back to your question. I am pretty sure you can just add them to the access.php and bump the version number. I'd have to test it but am basing it off of what I have seen in the comments of one access.php file (see below).

// The capabilities are loaded into the database table when the module is
// installed or updated. Whenever the capability definitions are updated,
// the module version number should be bumped up.

Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - Just getting back to your question. I am pretty sure you can just add them to the access.php and bump the version number. I'd have to test it but am basing it off of what I have seen in the comments of one access.php file (see below). // The capabilities are loaded into the database table when the module is // installed or updated. Whenever the capability definitions are updated, // the module version number should be bumped up. Peace - Anthony
Hide
Anthony Borrow added a comment -

Darryl - Testing the code against HEAD (i.e. 2.0) I found the following error in /lib/db/access.php

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/arborrow/Moodle/code/cvshead/lib/db/access.php on line 1331

it was caused by a missing comma before you add your page related capabilities.

Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - Testing the code against HEAD (i.e. 2.0) I found the following error in /lib/db/access.php Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/arborrow/Moodle/code/cvshead/lib/db/access.php on line 1331 it was caused by a missing comma before you add your page related capabilities. Peace - Anthony
Hide
Darryl Pogue added a comment -

This should fix that issue, and also includes the actual code for the pages themselves. Now, I'm probably forgetting to include some essential file here, so please let me know if you have any issues.

~Darryl

Show
Darryl Pogue added a comment - This should fix that issue, and also includes the actual code for the pages themselves. Now, I'm probably forgetting to include some essential file here, so please let me know if you have any issues. ~Darryl
Hide
Anthony Borrow added a comment -

Darryl - Form what I can tell the 2.0 patch is not a complete patch. Does it include the page files? Have you made them a block as Martin suggested? I think what you meant by ignoring the files already posted is that this patch to 2.0 is in addition to the code in the other. It would be good to have a single diff file for 2.0. Let me know if you need anything. Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - Form what I can tell the 2.0 patch is not a complete patch. Does it include the page files? Have you made them a block as Martin suggested? I think what you meant by ignoring the files already posted is that this patch to 2.0 is in addition to the code in the other. It would be good to have a single diff file for 2.0. Let me know if you need anything. Peace - Anthony
Hide
Darryl Pogue added a comment -

Okay, this patch should include everything, and work against tonight's 2.0 HEAD.

If there are any problems, let me know and I'll see if I can track them down. Thanks for all the help and guidance so far!

~Darryl

Show
Darryl Pogue added a comment - Okay, this patch should include everything, and work against tonight's 2.0 HEAD. If there are any problems, let me know and I'll see if I can track them down. Thanks for all the help and guidance so far! ~Darryl
Hide
Anthony Borrow added a comment -

I've not looked into the cause of it but I did notice when creating a page that I receive a PHP Notice about an undefined index 'site_news' in /lib/blocklib.php on line 989. I installed the patch. The only thing missing seems to be a convenient way to get to the pages. Is there any GUI way of getting there or do you have to know the URL? Peace - Anthony

Show
Anthony Borrow added a comment - I've not looked into the cause of it but I did notice when creating a page that I receive a PHP Notice about an undefined index 'site_news' in /lib/blocklib.php on line 989. I installed the patch. The only thing missing seems to be a convenient way to get to the pages. Is there any GUI way of getting there or do you have to know the URL? Peace - Anthony
Hide
Anthony Borrow added a comment -

Also, I think Martin indicated above that he would prefer to have all of the code in the block. Would it be much trouble to move the code in /page to /blocks/page. I would rename page_admin to page and just put everything there. I think it could behave the same just moving around the files a bit. Thanks for your work at touching things up so that they can more easily fit within Moodle. Peace - Anthony

Show
Anthony Borrow added a comment - Also, I think Martin indicated above that he would prefer to have all of the code in the block. Would it be much trouble to move the code in /page to /blocks/page. I would rename page_admin to page and just put everything there. I think it could behave the same just moving around the files a bit. Thanks for your work at touching things up so that they can more easily fit within Moodle. Peace - Anthony
Hide
Darryl Pogue added a comment -

In general, you need the URL. You could make a series of links in an HTML block on the main page, or through dropdown menus in the header.

I've found the "site_news" issue. It's in /page/pagelib.php line 155 in the default blocks. Forgot to remove that (unrelated) block when I packaged it all up. I'll wait a bit to see if there are any other errors before packaging up a new patch.

~Darryl

Show
Darryl Pogue added a comment - In general, you need the URL. You could make a series of links in an HTML block on the main page, or through dropdown menus in the header. I've found the "site_news" issue. It's in /page/pagelib.php line 155 in the default blocks. Forgot to remove that (unrelated) block when I packaged it all up. I'll wait a bit to see if there are any other errors before packaging up a new patch. ~Darryl
Hide
Anthony Borrow added a comment -

While I am thinking about - it seems to me that if this does go into core it would be nice to make the resource type (link to file or URL) also include the ability to link to one of the pages perhaps by generating a little selection box or something.

Show
Anthony Borrow added a comment - While I am thinking about - it seems to me that if this does go into core it would be nice to make the resource type (link to file or URL) also include the ability to link to one of the pages perhaps by generating a little selection box or something.
Hide
Anthony Borrow added a comment -

Darryl - Good work on tracking down the site_news issue. Do you think you will have any trouble moving the files around so that everything is in /blocks/page (i.e. renaming the references from /page to /blocks/page and renaming references to /blocks/page_admin to /blocks/page)? Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - Good work on tracking down the site_news issue. Do you think you will have any trouble moving the files around so that everything is in /blocks/page (i.e. renaming the references from /page to /blocks/page and renaming references to /blocks/page_admin to /blocks/page)? Peace - Anthony
Hide
Darryl Pogue added a comment -

This patch includes everything, and moves everything into the blocks folder. It seems to install and work properly with Moodle 2.0, however assigning permissions per-page does not seem to work. I'll look into what might be the problem, but if you have any ideas please let me know.

Thanks,
~Darryl

Show
Darryl Pogue added a comment - This patch includes everything, and moves everything into the blocks folder. It seems to install and work properly with Moodle 2.0, however assigning permissions per-page does not seem to work. I'll look into what might be the problem, but if you have any ideas please let me know. Thanks, ~Darryl
Hide
Anthony Borrow added a comment -

Darryl - Wow, you made quick work of that. I have changed a few things as I prepare to upload it to CVS. First, since it is a block I have renamed the capabilities to block/page:view instead of moodle/page:view. Also, in the edit.php file I found an old get_record that was not using the array so I fixed that. I also found a few places that were still pointing to /page/ rather than /blocks/page/ (i.e. in view.php and one in lib.php) which I have also fixed.

Here I am just thinking out loud so feel to let me know what you think is best. I'm thinking that if we make this a standard block where the get_content function simply returns a link to the /blocks/page/index.php page just like you are doing with the Add/edit pages link in the Site Administration block then we could avoid any modification of core code and just use it as a block. If the site admin wants to use the block to have easy access then he can add it to the page. If the person has the capability they will see the block otherwise we can hide the block. Similarly, if the site admin wanted to put it within a course they could do that as well. If we do this, then we can add the code to plugins rather than patches. We can provide the changes to the site administration block if Martin wants it as a separate patch file here in the tracker; however, I believe he wanted it as a block so I think the behavior I described makes the most sense.

I was getting an error about there not being a parent so to simplify things I changed:

$ADMIN->add('pages', new admin_externalpage('pagemgmt', get_string('pagemgmt', 'block_page'), "$CFG->wwwroot/blocks/page/index.php", 'block/page:update'));

to:

$ADMIN->add('root', new admin_externalpage('pagemgmt', get_string('pagemgmt', 'block_page'), "$CFG->wwwroot/blocks/page/index.php", 'block/page:update'));

Hmm... I forgot about the CONTEXT_PAGE stuff in /admin/roles/tabs.php but perhaps we could get that to behave like a traditional block. I see no disadvantage to this. So if you could I would get rid of the CONTEXT_PAGE stuff and just treat it like a block. Let me know if you have questions or need help with that. Based on the speed at which you made the previous changes I suspect you'll be able to whiz right through it.

All of this said, before I commit it as a plugin, I want to make sure that all of it sounds OK with you. I think this will give Martin what he is hoping for (namely I block that provides some nice page functionality). Hopefully none of this is deviating too much from what you originally hoped to be able to accomplish. If it does, please do not be shy about speaking up. I'm going to attach my own diff file so you can see what all I did.

Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - Wow, you made quick work of that. I have changed a few things as I prepare to upload it to CVS. First, since it is a block I have renamed the capabilities to block/page:view instead of moodle/page:view. Also, in the edit.php file I found an old get_record that was not using the array so I fixed that. I also found a few places that were still pointing to /page/ rather than /blocks/page/ (i.e. in view.php and one in lib.php) which I have also fixed. Here I am just thinking out loud so feel to let me know what you think is best. I'm thinking that if we make this a standard block where the get_content function simply returns a link to the /blocks/page/index.php page just like you are doing with the Add/edit pages link in the Site Administration block then we could avoid any modification of core code and just use it as a block. If the site admin wants to use the block to have easy access then he can add it to the page. If the person has the capability they will see the block otherwise we can hide the block. Similarly, if the site admin wanted to put it within a course they could do that as well. If we do this, then we can add the code to plugins rather than patches. We can provide the changes to the site administration block if Martin wants it as a separate patch file here in the tracker; however, I believe he wanted it as a block so I think the behavior I described makes the most sense. I was getting an error about there not being a parent so to simplify things I changed: $ADMIN->add('pages', new admin_externalpage('pagemgmt', get_string('pagemgmt', 'block_page'), "$CFG->wwwroot/blocks/page/index.php", 'block/page:update')); to: $ADMIN->add('root', new admin_externalpage('pagemgmt', get_string('pagemgmt', 'block_page'), "$CFG->wwwroot/blocks/page/index.php", 'block/page:update')); Hmm... I forgot about the CONTEXT_PAGE stuff in /admin/roles/tabs.php but perhaps we could get that to behave like a traditional block. I see no disadvantage to this. So if you could I would get rid of the CONTEXT_PAGE stuff and just treat it like a block. Let me know if you have questions or need help with that. Based on the speed at which you made the previous changes I suspect you'll be able to whiz right through it. All of this said, before I commit it as a plugin, I want to make sure that all of it sounds OK with you. I think this will give Martin what he is hoping for (namely I block that provides some nice page functionality). Hopefully none of this is deviating too much from what you originally hoped to be able to accomplish. If it does, please do not be shy about speaking up. I'm going to attach my own diff file so you can see what all I did. Peace - Anthony
Hide
Anthony Borrow added a comment -

Here is what I have after making the changes mentioned above.

Show
Anthony Borrow added a comment - Here is what I have after making the changes mentioned above.
Hide
Darryl Pogue added a comment -

That sounds great Anthony! Thanks for everything.

What you propose makes a good deal of sense, and still keeps the goal of easy to use content pages.

~Darryl

Show
Darryl Pogue added a comment - That sounds great Anthony! Thanks for everything. What you propose makes a good deal of sense, and still keeps the goal of easy to use content pages. ~Darryl
Hide
Anthony Borrow added a comment -

Darryl - One thing I do not like about what I proposed is that if you intend to maintain control on the individual pages then we will need a CONTEXT_PAGE. Otherwise, we will only be able to control who does what from where which would mean that a user could have edit capabilities in one course but not another but it would be to the same (actually all of the pages). The way that the context code is written it does not allow you to simply define a context within the block since it checks to make sure that the context is a valid one. I could propose that we override that by making a modification to core. Otherwise we will get nothing but context errors trying to use 90 as the page context level. So it looks like it will need to be a patch. I'll sleep on it and see if you or MD have any creative ideas. Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - One thing I do not like about what I proposed is that if you intend to maintain control on the individual pages then we will need a CONTEXT_PAGE. Otherwise, we will only be able to control who does what from where which would mean that a user could have edit capabilities in one course but not another but it would be to the same (actually all of the pages). The way that the context code is written it does not allow you to simply define a context within the block since it checks to make sure that the context is a valid one. I could propose that we override that by making a modification to core. Otherwise we will get nothing but context errors trying to use 90 as the page context level. So it looks like it will need to be a patch. I'll sleep on it and see if you or MD have any creative ideas. Peace - Anthony
Hide
Anthony Borrow added a comment -

Darryl - I have posted http://moodle.org/mod/forum/discuss.php?d=118793 to help get some clarity on how best to add this code to CVS. My inclination is to put the plugin part of the code (namely, everything that is in /blocks/pages in the plugins part of contrib and then create a small patch file for the code that needs to be modified in core to make the plugin work and then packaging the two together. We would need to be clear in the README.txt or any installation instructions that it is required for the patch to applied in order for the block to work. Sorry for the delay but feel free to let me kow what you think. Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - I have posted http://moodle.org/mod/forum/discuss.php?d=118793 to help get some clarity on how best to add this code to CVS. My inclination is to put the plugin part of the code (namely, everything that is in /blocks/pages in the plugins part of contrib and then create a small patch file for the code that needs to be modified in core to make the plugin work and then packaging the two together. We would need to be clear in the README.txt or any installation instructions that it is required for the patch to applied in order for the block to work. Sorry for the delay but feel free to let me kow what you think. Peace - Anthony
Hide
Anthony Borrow added a comment -

Martin - I'm changing security level to none so that others can review this issue. Peace - Anthony

Show
Anthony Borrow added a comment - Martin - I'm changing security level to none so that others can review this issue. Peace - Anthony
Hide
Anthony Borrow added a comment -

Here is a quick attempt at providing a patch for Moodle 1.9. I changed the database calls but I know some of them are not the cleanest of fixes but it appears to be functional. Please feel free to test it and provide feedback. Peace - Anthony

Show
Anthony Borrow added a comment - Here is a quick attempt at providing a patch for Moodle 1.9. I changed the database calls but I know some of them are not the cleanest of fixes but it appears to be functional. Please feel free to test it and provide feedback. Peace - Anthony
Hide
Anthony Borrow added a comment -

OK - so here is what I am thinking of doing:

1) Copy the blocks/page directory to contrib/plugins/blocks/page
2) Create a patch called block_page that will be stored in contrib/patches/block_page/block_page.patch
3) Create an README.txt file that contains installation instruction at contrib/patches/block_page/README.txt
4) Create page_package that includes both contrib/plugins/blocks/page and contrib/patches/block_page

Installation instructions will be to:

1) Download page_package
2) Copy the files from the package to the site's dirroot
3) Apply the patch (block_page.patch)
4) Login as site admin and go to notifications page.

I have moved the lang files underneath the block. I've sent a Moodle message to Koen as I think storing a block's language files should always be underneath the block in its own lang folder rather than the core /lang/folder. IMO this will help facilitate moving code from CONTRIB to Core or vice versa as it will maintain the same file structure. I think I have a functional version for Moodle 1.9 so we can maintain two branches.

Let me know any comments, concerns, questions you may have about this approach. I'm keen on getting this into CONTRIB so that Darryl can work on maintaining it there and also so Martin can begin working on assigning someone to move it to core.

Peace - Anthony

Show
Anthony Borrow added a comment - OK - so here is what I am thinking of doing: 1) Copy the blocks/page directory to contrib/plugins/blocks/page 2) Create a patch called block_page that will be stored in contrib/patches/block_page/block_page.patch 3) Create an README.txt file that contains installation instruction at contrib/patches/block_page/README.txt 4) Create page_package that includes both contrib/plugins/blocks/page and contrib/patches/block_page Installation instructions will be to: 1) Download page_package 2) Copy the files from the package to the site's dirroot 3) Apply the patch (block_page.patch) 4) Login as site admin and go to notifications page. I have moved the lang files underneath the block. I've sent a Moodle message to Koen as I think storing a block's language files should always be underneath the block in its own lang folder rather than the core /lang/folder. IMO this will help facilitate moving code from CONTRIB to Core or vice versa as it will maintain the same file structure. I think I have a functional version for Moodle 1.9 so we can maintain two branches. Let me know any comments, concerns, questions you may have about this approach. I'm keen on getting this into CONTRIB so that Darryl can work on maintaining it there and also so Martin can begin working on assigning someone to move it to core. Peace - Anthony
Hide
Anthony Borrow added a comment -

Darryl - Until I hear back from Eloy regarding the possibility of creating the package and pulling out the plugin like code (namely the /blocks/page files) I am going to post this patch file which include everything. Then later we can update things to use the package should we decide to go down that path. The HEAD branch will be the patch for Moodle 2.0 and the 1.9 branch for Moodle 1.9. Let me know if you have any questions. Let's just be sure to maintain a single patch file. I have gone ahead and approved your CVS write request. I'll also create a Patch: Page block in the tracker and bump your privileges so that you can manage issues related to it. Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - Until I hear back from Eloy regarding the possibility of creating the package and pulling out the plugin like code (namely the /blocks/page files) I am going to post this patch file which include everything. Then later we can update things to use the package should we decide to go down that path. The HEAD branch will be the patch for Moodle 2.0 and the 1.9 branch for Moodle 1.9. Let me know if you have any questions. Let's just be sure to maintain a single patch file. I have gone ahead and approved your CVS write request. I'll also create a Patch: Page block in the tracker and bump your privileges so that you can manage issues related to it. Peace - Anthony
Hide
Anthony Borrow added a comment -

Darryl - For now let's go ahead and treat this as a patch. If you have not done so already, please create an entry in the Modules and Plugins database and some documentation with installation instructions in Moodle Docs. It is good to make a quick review of [[Development:Guidelines_for_contributed_code]] to make sure we have not overlooked anything. Thanks again for your work on this and for contributing the code. Peace - Anthony

Show
Anthony Borrow added a comment - Darryl - For now let's go ahead and treat this as a patch. If you have not done so already, please create an entry in the Modules and Plugins database and some documentation with installation instructions in Moodle Docs. It is good to make a quick review of [[Development:Guidelines_for_contributed_code]] to make sure we have not overlooked anything. Thanks again for your work on this and for contributing the code. Peace - Anthony
Hide
Anthony Borrow added a comment -

moving to newly created Patch: Page block component - any issues created for this component will automatically be assigned to Darryl

Show
Anthony Borrow added a comment - moving to newly created Patch: Page block component - any issues created for this component will automatically be assigned to Darryl
Hide
Anthony Borrow added a comment -

both a 1.9 and 2.0 full patch have been uploaded, the Patch: Page block component has been created in the tracker, and CVS write access has been granted - resolving as fixed. Let me know if you need anything else. Peace - Anthony

Show
Anthony Borrow added a comment - both a 1.9 and 2.0 full patch have been uploaded, the Patch: Page block component has been created in the tracker, and CVS write access has been granted - resolving as fixed. Let me know if you need anything else. Peace - Anthony
Hide
david rath added a comment - - edited

Dear Anthony and Darryl,
This patch is exactly what I need for my school. I wonder if you could supply directions on how to plug this in? I'm not much of a coder, much less a Moodle coder. But somehow, using helpfiles, I have setup Moodle 1.9 on Ubuntu 8.04 for our school. So far, so good.

Thanks for any help you can provide.
David (EFL teacher)

Show
david rath added a comment - - edited Dear Anthony and Darryl, This patch is exactly what I need for my school. I wonder if you could supply directions on how to plug this in? I'm not much of a coder, much less a Moodle coder. But somehow, using helpfiles, I have setup Moodle 1.9 on Ubuntu 8.04 for our school. So far, so good. Thanks for any help you can provide. David (EFL teacher)
Hide
Darryl Pogue added a comment -

I believe you should be able to download the patch for 1.9 from http://cvs.moodle.org/contrib/patches/block_page/block_page.patch?revision=1.1.2.2&pathrev=MOODLE_19_STABLE and save it in the root of your Moodle installation (probably /var/www/moodle).

Open a terminal and navigate to the root of your Moodle installation (again, probably /var/www/moodle) and run the command "patch -p1 < block_page.patch"

That should merge all of the necessary changes with the existing Moodle installation.

Show
Darryl Pogue added a comment - I believe you should be able to download the patch for 1.9 from http://cvs.moodle.org/contrib/patches/block_page/block_page.patch?revision=1.1.2.2&pathrev=MOODLE_19_STABLE and save it in the root of your Moodle installation (probably /var/www/moodle). Open a terminal and navigate to the root of your Moodle installation (again, probably /var/www/moodle) and run the command "patch -p1 < block_page.patch" That should merge all of the necessary changes with the existing Moodle installation.
Hide
Anthony Borrow added a comment -

David - Based off of the latest version of 1.9, here is a zip file of all the changed and new files in their entirety. Generally speaking, it is preferred to work with patch files so that you do not run into any versioning issues (I'll not explain here but things can get complicated pretty quickly). In any case, if you have the latest version of Moodle 1.9 you should be able to copy these files over top of it so that the files replace what is there and have the page functionality. Of course you should make sure you have a back up of the original files just in case there are bugs. Let us know if you have problems or any further questions. Peace - Anthony

Show
Anthony Borrow added a comment - David - Based off of the latest version of 1.9, here is a zip file of all the changed and new files in their entirety. Generally speaking, it is preferred to work with patch files so that you do not run into any versioning issues (I'll not explain here but things can get complicated pretty quickly). In any case, if you have the latest version of Moodle 1.9 you should be able to copy these files over top of it so that the files replace what is there and have the page functionality. Of course you should make sure you have a back up of the original files just in case there are bugs. Let us know if you have problems or any further questions. Peace - Anthony
Hide
david rath added a comment -

Dear Anthony and Darryl,
Thanks for getting back with me so quickly

Let's see if I got this straight:
a. Download the nine "file attachments" above AND download the text from the link Darryl just gave me. This text is a script which I'll run in the terminal at "/var/www/moodle"
b. Those file attachments should also be in "/var/www/moodle" , right?
c. Then I reboot the server?
d. I'll automatically have a regular webpage of some type (for starters) from which I can link to the school's Moodle. And in this same location, I can add more regular webpages.
e. Any suggestions on an easy webpage/website editor for dummies?

Thanks again,
David

Show
david rath added a comment - Dear Anthony and Darryl, Thanks for getting back with me so quickly Let's see if I got this straight: a. Download the nine "file attachments" above AND download the text from the link Darryl just gave me. This text is a script which I'll run in the terminal at "/var/www/moodle" b. Those file attachments should also be in "/var/www/moodle" , right? c. Then I reboot the server? d. I'll automatically have a regular webpage of some type (for starters) from which I can link to the school's Moodle. And in this same location, I can add more regular webpages. e. Any suggestions on an easy webpage/website editor for dummies? Thanks again, David
Hide
Jason Hollowell added a comment -

David,

Please see the information at the link below for information about Pages and how to install (one low tech way) the package provided by Anthony.

http://moodle.org/mod/forum/discuss.php?d=93382#p524160

Jason

Show
Jason Hollowell added a comment - David, Please see the information at the link below for information about Pages and how to install (one low tech way) the package provided by Anthony. http://moodle.org/mod/forum/discuss.php?d=93382#p524160 Jason
Hide
Anthony Borrow added a comment -

David - No need to download all nine of the file attachments above. Just download the block_page_19.zip file and unzip its contents. As Jason says, just follow the instructions he gave in the forum. He has done this and can help guide you through it. Also, there is no need to reboot the server. The most you might want to do if you have some type of PHP caching in place is to restart the webserver with something like:

sudo /etc/init.d/apache2 restart

You may also want to look into a Content Management System along the lines of Drupal or something similar if the pages block does not meet your needs.

Peace - Anthony

Show
Anthony Borrow added a comment - David - No need to download all nine of the file attachments above. Just download the block_page_19.zip file and unzip its contents. As Jason says, just follow the instructions he gave in the forum. He has done this and can help guide you through it. Also, there is no need to reboot the server. The most you might want to do if you have some type of PHP caching in place is to restart the webserver with something like: sudo /etc/init.d/apache2 restart You may also want to look into a Content Management System along the lines of Drupal or something similar if the pages block does not meet your needs. Peace - Anthony
Hide
Anthony Borrow added a comment -

Closing all of my resolved issues. Peace - Anthony

Show
Anthony Borrow added a comment - Closing all of my resolved issues. Peace - Anthony

People

Vote (1)
Watch (5)

Dates

  • Created:
    Updated:
    Resolved: