Check my customisation php, please

This forum post has been removed

Number of replies: 16
The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Check my customisation php, please

by Guillaume Gautreau -

Hi !
First of all, transform your code in :

<?php global $resourceinstance, $category; 
if (!isset($course) && isset($resourceinstance)) {
$course = $resourceinstance->course;
$catclass= 'category-none';
/*} To remove*/
}
if (isset($course->category)) {
$catclass = 'category-' . $course->category;
} else if (isset($category->id)) {
$catclass = 'category-' . $category->id;
$pageclass = ' class="' . $groupclass . '"';
}
?>

What happen when you try to use this code ? We need the error displayed !

In reply to Guillaume Gautreau

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Check my customisation php, please

by Timothy Takemoto -
Dear Cathy
Don't you need to escape those quotes (which you intend to appear around $groupclass) like this \" ?
Tim
In reply to Deleted user

Re: Check my customisation php, please

by Guillaume Gautreau -
Where is the 14th line in this code ?
(Also sorry for the delay)
Could you send us the entire file ? it could help.
In reply to Guillaume Gautreau

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Check my customisation php, please

by Guillaume Gautreau -
Not problems with the quotes because it's a double inside simple-quotes.
I think it was a good idea to ask you the code....
I did some syntax corrections, but I can't test it on my own, so i give the file to you and you'll tell me if there is problems.

In reply to Guillaume Gautreau

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Check my customisation php, please

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Just out of interest, what program are you using to edit your PHP code? Some editors will point out syntax errors as you edit, which lets you find and fix them quickly, without having to copy the files to the server and find a way to test it yourself. I find that makes life a lot easier.

There are two editors I know that do this:

JEdit - http://www.jedit.org/ - with the PhpParserPlugin installed. (To do anything in Jedit, you need an extension, but its not a big deal because there is a good plugin manager installed.)

Eclipse - http://www.eclipse.org/ - with the PHP development tools installed. This is what I use because I have done a lot of Java development, and it is what I am used to.

I'm sure there are more out there.

Eclipse has a very steep learning curve, but it's worth it if you have the time to get to the top. It is a very powerful IDE, and things like its CVS integration are a dream. However, in the first instance I recommend you try Jedit. Much easier to get started with.

Tim.

In reply to Tim Hunt

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Check my customisation php, please

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That sounds like a very good set up that makes it easy to test.

But I still think you are missing a trick. Your computer should be like your personal slave. It should do as much routine stuff for you as possible so you can concentrate on important things. You should not have to manually test every page after you edit just to check for syntax errors. In an ideal world, your computer would do this for you and tell you if you had slipped up, and the rest of the time you could forget about it.

I am slightly surprised that an editor as good as Deamweaver does not do this already. Perhaps in the next version.

Tim.

In reply to Deleted user

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Check my customisation php, please

by Guillaume Gautreau -
This file works
In reply to Guillaume Gautreau

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Guillaume Gautreau

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Guillaume Gautreau

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.