Search This Blog

Wednesday, December 19, 2012

Stop the navigation block from expanding


If you want to stop the navigation from automatically expanding everything you click a course, this is the code you need to change:

1) Go to:  blocks\navigation in your root moddle directory
2)  open renderer.php file
and change this line
if ($item->has_children() && (!$item->forceopen || $item->collapse)) {
to this
if ($item->has_children() && ($depth > 1)) {


Thursday, December 13, 2012

Only show block to certain user

I wanted to hide my "Settings" block from all other users, except the admin role.

1)  I went into the file called:  mymoodleroot/blocks/settings/block_settings.php
2)  Inside two functions, I simply placed a role check at the beginning:

 function get_content() 
 {
    // only shows the settings block to admins
    global $USER, $CFG, $DB;
    if(!is_siteadmin($USER)) {return;}
        ...
}


function init() 
    {
    global $USER, $CFG, $DB;
    if(!is_siteadmin($USER)) {return;}

      ...
}



I'm sure that code could be modified to display to different roles and possibilities. This is just a simple example and it works!

Monday, July 23, 2012

Make a custom login page

Inside your theme folder, you need to change a couple files:

1) Inside the main theme folder, open the config.php file. Scroll down to where you see "login" and you can change that to read your own custom page. In my case, I made this change:
       From:
       ...
        ),
       'login' => array(
        'file' => 'general.php',
        'regions' => array(),
    ),
    ...

    To:
     ...
     ),
    'login' => array(
        'file' => 'login.php',
        'regions' => array(),
    ),
    ....

2) Next, I copied the general.php file, so I can use the same theme settings for my login.php page. However, I took out all the unnecessary sections: langmenu, custom menu, and side blocks. So basically I just show my logo, the main content, and the footer.

3) Lastly, I added some custom CSS to my core.php page to make the login elements look the way I wanted to. I centered all the elements on screen with a nice background like this:

Here is the CSS I used to make this:

/* ////////////////////////////////////////////////////  LOGIN PANEL //////////////////////////////////////////// */
.twocolumns div.loginpanel 
{
     border-right: 1px dashed #dadada !important; 
}
.onecolumn div.loginpanel
{
    position:relative;
    width:35%;
    margin: 0 auto;
    
    background:#ececec;
    background: -webkit-gradient(linear, 0 100, 0 bottom, from(#ececec), to(#bfbfbf)); 
    background: -moz-linear-gradient(#ececec, #bfbfbf);
    background: -ms-linear-gradient(#ececec, #bfbfbf);
    background: -o-linear-gradient(#ececec, #bfbfbf);
    background: linear-gradient(#ececec, #bfbfbf);
    -pie-background: linear-gradient(#ececec, #bfbfbf);
    
    border: 1px solid #a2a2a2;
    -webkit-border-radius:10px;
    -moz-border-radius:10px;
    border-radius:10px;
    behavior: url(PIE.htc);
}
div.loginpanel h2
{
    text-align:center;
    text-transform:none;
}

.loginbox .loginform
{
   width: 100%;
   height:20em;
   vertical-align:middle;
}
.loginbox .loginform .form-input
{
     vertical-align:middle;
     text-align:center;
     float:none;
     clear:both;
     width:100%;
     padding-bottom:1em;
}
.loginbox .loginform .form-label
{
    padding: 0em 0em 0.3em 2em;
    text-align:center;
}
.loginbox .loginform .form-input #username, 
.loginbox .loginform .form-input #password 
{
    position:relative;
    min-height:1.7em;
    width:60%;
    border-size:1px inset #d9d9d9;
    
    -webkit-border-radius:10px;
    -moz-border-radius:10px;
    border-radius:10px;
    behavior: url(PIE.htc);
}
.loginbox .loginform .form-input #loginbtn
{
    vertical-align:middle;
    display:block;
    padding:1em;
    width:10em;
    border:1px solid #bfbfbf;
    
    position:relative;
    -webkit-border-radius:5px;
    -moz-border-radius:5px;
    border-radius:5px;
    behavior: url(PIE.htc);
}
.loginbox .loginform .form-input #loginbtn:hover
{
    color:white;
    background:#5b2d7e;
}

div.forgetpass, 
div.centeredcookies 
{
   text-align:center;
}

/* ////////////////////////////////////////////////////  END OF LOGIN PANEL //////////////////////////////////////////// */


Adding search bar in top menu bar

Using the new Aardvark theme (2.2 blackbird version), I was able to insert a search bar in the top menu by making some modifications:

1) In styles/general.php, I added the header information I needed between the <head> tags
2) In layout/profileblock.php, I added my own code around line 62:

....

<?php
echo '</div>'; // end of headerwrap
?>
<!--/////////// This is the search bar  ////////////-->
<div id="mysearchbar"  >
<input type="text" class="autosuggest_search" />
</div>

</div>
<div class="profilebar" id="profilebar" style="display: none;">
...

Now my searchbar is inline with the custom menu and other elements. Yippee!

Wednesday, May 16, 2012

Easily finding an entry in your database activity

Here is a nice sql query to find an entry in your database activity, while searching for a specific text string:


$query = "SELECT * FROM {data_content} c JOIN {data_records} r ON r.id = c.recordid WHERE r.dataid=? AND c.content=?";
if($results = $DB->get_records_sql($query, array($data->id, 'my search string')))
{
    // do something here with results
}

It's a nice snippet!

Wednesday, April 25, 2012

Create an empty page for Moodle

I came across this code in the forum today and I thought it's a nice snippet to keep. This shows how to create a new, blank page within the moodle system.


<?php


// The number of lines in front of config file determine the // hierarchy of files.
require_once(dirname(dirname(__FILE__)).'/../config.php');


$PAGE->set_context(get_system_context());
$PAGE->set_pagelayout('admin');
$PAGE->set_title("Your title");
$PAGE->set_heading("Blank page");
$PAGE->set_url($CFG->wwwroot.'/blank_page.php');


echo $OUTPUT->header();


// Actual content goes here
echo "Hello World";


echo $OUTPUT->footer();
?>

Simple as that!

Adding custom message for users with "nologin" status

I have to share this because it's an awesome addition to the Moodle system. In my particular case, I want to suspend a particular user from entering the site, and also give them a specific reason why.


  1. Go to their profile, as admin, and set their authentication as "No Login." Make sure this option is also enabled in the admin panel -> plugins ->authentication.
  2. Now we need to modify some code. Thanks to the patch from " tiagojn", it's easy to create specific messages on the login panel. 
  3. Create a new file inside root/auth/nologin  called "config.html" This allows us to create some form elements on the settings panel of "nologin" from the admin -> plugins -> authentication section.
  4. Here is the code for config.html:
<?php
    // set to defaults if undefined
    if (!isset($config->enable_specific_message)) {
        $config->enable_specific_message = false;
    }

    if( !isset($config->specific_message_text)){
        $config->specific_message_text = get_string('invalidlogin');
    }
?>

<table cellspacing="0" cellpadding="5" border="0">
<tr>
    <td align="right">
        <label for=checkbox_enable_specific_message"><?php print_string('auth_nologin_specificmessage_select_key', 'auth_nologin'); ?></label>
    </td>
    <td><?php
        global $OUTPUT;
        echo html_writer::checkbox('enable_specific_message', 1, $config->enable_specific_message,'',array(id => checkbox_enable_specific_message));
        ?></td>
    <td><?php print_string('auth_nologin_specificmessage_description', 'auth_nologin'); ?></td>
</tr>
<tr>
    <td align="right">
        <label for="specific_message_text"><?php print_string('auth_nologin_specificmessage_text_key', 'auth_nologin'); ?></label>
    </td>
    <td>
        <input id="specific_message_text" name="specific_message_text" type="text" size="100" value="<?php echo $config->specific_message_text; ?>" />
    </td>
    <td><?php print_string('auth_nologin_specificmessage_text_description', 'auth_nologin'); ?></td>
</tr>
</table>
  1. Next we are going to modify an existing file called "auth.php"  - should be in the same folder that you are currently in.
  2. We are going to add two functions to this class. So right before the ending bracket, place this code:
 /**
     * Prints a form for configuring this authentication plugin.
     *
     * This function is called from admin/auth.php, and outputs a full page with
     * a form for configuring this plugin.
     */
    function config_form($config, $err, $user_fields) 
    {
        include "config.html";
    }

    /**
     * Processes and stores configuration data for this authentication plugin.
     */
    function process_config($config) {
        // set to defaults if undefined
        if (!isset($config->enable_specific_message)) 
        {
            $config->enable_specific_message = false;
        }
        if (!isset($config->specific_message_text)) 
        {
            $config->specific_message_text = get_string('invalidlogin');
        }

        // save settings
        set_config('enable_specific_message',   $config->enable_specific_message,   'auth/nologin');
        set_config('specific_message_text',     $config->specific_message_text,     'auth/nologin');

        return true;
    }

  1. Next we go inside the lang folder -> en -> and we'll open up "auth_nologin.php" to modify it. 
  2. We are going to add the following strings to the file:
$string['auth_nologin_specificmessage_select_key'] = 'Enable specific "invalid login" message';
$string['auth_nologin_specificmessage_description'] = 'Presents a specific message to users marked as "nologin" when they try to authenticate. <strong>Security Warning: The message is displayed even if the password is wrong, allowing attackers to find out existing usernames.</strong>';
$string['auth_nologin_specificmessage_text_key'] = 'Message to be presented';
$string['auth_nologin_specificmessage_text_description'] = 'Only considered when the above option is selected.';

  1. There is only one file left to modify. Go to root/login/index.php
  2. Around line 239, you should see the beginning of an "if" statment:  if (empty($errormsg)) {
  3. We are going to replace all content between the brackets of the "if" statement like this:
if (empty($errormsg)) 
{
            // check if user is set as 'nologin' and if a specific message is desired
            $user_auth = $DB->get_field('user', 'auth', array('username' => $frm->username), IGNORE_MISSING);
            $nologin_cfgs = get_config('auth/nologin');

            if (!empty($user_auth) && $user_auth == 'nologin' && !empty($nologin_cfgs->enable_specific_message)) {
                $errormsg = $nologin_cfgs->specific_message_text;
            } else {
                $errormsg = get_string("invalidlogin");
            }
            $errorcode = 3;
 }

Now all your specific messages will show up on the login panel! There is one warning to this patch though:
Security Warning: The message is displayed even if the password is wrong, allowing attackers to find out existing usernames.

Monday, April 16, 2012

Change the default tab of the Kaltura uploader

To change the default, opening tab of the Kaltura uploader, go to: local/kaltura/js/kaltura-edit.js and change this line from:

// Default opening is the "My Video" tab

$this.renderables.videotabs.selectChild($this.renderables.videotabs._items.length-1);


to

// This puts the default opening tab to "Upload" 

$this.renderables.videotabs.selectChild($this.renderables.videotabs._items[0]);

Wednesday, February 22, 2012

Create an empty page for Moodle

I came across this code in the forum today and I thought it's a nice snippet to keep. This shows how to create a new, blank page within the moodle system.


<?php


// The number of lines in front of config file determine the // hierarchy of files.
require_once(dirname(dirname(__FILE__)).'/../config.php');


$PAGE->set_context(get_system_context());
$PAGE->set_pagelayout('admin');
$PAGE->set_title("Your title");
$PAGE->set_heading("Blank page");
$PAGE->set_url($CFG->wwwroot.'/blank_page.php');


echo $OUTPUT->header();


// Actual content goes here
echo "Hello World";


echo $OUTPUT->footer();
?>

Simple as that!
================================
Update: April 16, 2012

Here is an example of creating a custom file in Moodle:


<?php


require_once(dirname(dirname(__FILE__)).'/../../../config.php');


$PAGE->set_context(get_system_context());
$PAGE->set_pagelayout('admin');
$PAGE->set_title("Your title");
$PAGE->set_heading("Blank page");
$PAGE->set_url($CFG->wwwroot.'/theme/themename/layout/ foldername/moodlepage.php');


$PAGE->requires->js('/theme/themename/layout/ foldername/prettyphoto/js/jquery-1.6.1.min.js', true);
$PAGE->requires->js('/theme/ themename/layout/foldername/Jquery/carouFredSel-5.2.3/jquery.carouFredSel-5.2.3-packed.js', true);
$PAGE->requires->js('/theme/themename/layout/foldername/prettyphoto/js/jquery.prettyPhoto.js', true);
$PAGE->requires->css('/theme/themename/layout/foldername/prettyphoto/css/prettyPhoto.css', true);
$PAGE->requires->css('/theme/themename/layout/foldername/style.css', true);


echo $OUTPUT->header();


include('index.php'); 


echo $OUTPUT->footer();
?>

Sunday, February 12, 2012

Adding Javascript to "page" resource

Well this has been bugging me for a while - every time I tried to insert Javascript into the moodle html editor it never worked. You could embed content with <object> or <iframe> tags....but I'm against that because of display issues on different browsers.

Well I've finally found the simple solution - you need an extra identifier in your javascript.


<script type="text/javascript" language="javascript">
//<![CDATA[
               your code here....
               //]]>
</script>

All you need to do is add the code marked in yellow above, purge your moodle cache and voila! Your javascript now works inside the moodle html editor!

Important Note:  You need to try this using "standard web forms". This option can be changed from your profile settings.

Tuesday, January 31, 2012

How to center blocks inside moodle

I found the answer to this question by googling the Moodle.org forums and tracker, but thought I'd repost this specifically for Moodle 2.1

Original answer can be found here: http://tracker.moodle.org/browse/MDL-6748


1) Go to:  lib/blocklib.php
2) Around line 46, define a new block position:

define('BLOCK_POS_RIGHT', 'side-post');
define('BLOCK_POS_CENTER', 'center');

2) Go to:  theme/[your_theme]/layout/general.php
3) Around line 7, add a new line of code:

$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
$hascenter = $PAGE->blocks->region_has_content('center', $OUTPUT);

4) In the same file, around line 90-96, add a new block of code:

<?php echo core_renderer::MAIN_CONTENT_TOKEN ?>
<?php if ($hascenter) { ?>
   <div class="block-region">
       <div> <?php echo $OUTPUT->blocks_for_region('center') ?></div>
    </div>
<?php } ?>
</div>

5) Go to:    theme/[your_theme]/config.php
6) In whichever page you want to have center blocks, add  'center' to the regions array

'frontpage' => array(
'file' => 'general.php',
'regions' => array('side-pre',
'center', 'side-post'),
'defaultregion' => 'side-post',
),
I did the same thing for:
'course' => array(..... 

Which allowed me to have center blocks within the course pages themselves.
Sweet!

Tuesday, January 17, 2012

Customize the navigation block and user permissions

Here I've made two changes to Moodle's navigation block. Both of these changes concern the way user courses are displayed.

  • I like the way that "my courses" displays only the courses you are enrolled in
  • I like how "Courses" displays categories......but it shows courses you aren't even enrolled in.
So the purpose of this blog post is mostly to hide "My Courses" and only show "Courses", while modifying the latter to only show user's courses.

First, you need to enable "Courses" to actually show up on the navigation block.
Inside your Moodle site, you need administrator access.
1)  Admin ->Appearance->Navigation
2)  Show course categories = yes
3)  Show all courses = yes
4)  save preferences
Now we also need access to our core moodle server, because we need to make changes to the code. 
Inside this file:   <yourmoodleroot>/lib/navigationlib.php

1) Go to line 1290 where you see this current code:
foreach ($this->rootnodes as $node) 
{
            // Dont remove the home node
            if ($node->key !== 'home' && !$node->has_children()) {
                $node->remove();
            }
}
2) and change it to:
foreach ($this->rootnodes as $node) 
{
            // Dont remove the home node
            if (($node->key !== 'home' && !$node->has_children()) || $node->key === 'mycourses') {
                $node->remove();
            }
}
3) This will hide the "my courses" link in the navigation block.

Now we need to modify "Courses" to only show the category/course list that the user is enrolled in.
Inside this file:

1) Go to around line 1523, inside the function called  "add_category(stdClass $category, navigation_node $parent)"   where you see this code:

if (has_capability('moodle/category:viewhiddencategories', get_system_content()))

{
                $categorynode->hidden= true;
            } else {
                $categorynode->display = false;
}

2) and change it to:

if (has_capability('moodle/category:viewhiddencategories', get_context_instance(CONTEXT_COURSECAT, $category->id)))
{
                $categorynode->display = true;
            } else {
                $categorynode->display = false;
}

NOTE: changing the "hidden" variable will make your hidden categories display with normal colored text, instead of that gray color

If you would like your hidden courses to also display with black text (this is for later in the tutorial), 
1) Go to around line 2177 and change this code:
$coursenode->hidden = (!$course->visible);

2) to this code:
$coursenode->hidden = false; 


3) Add this line next:
if(!$course->visible) { $coursenode->display = false; }

====================================================================
Okay so our core changes to the code are done. 
Now we need to have fun with roles and permissions!

An average user on my site is using the role "student", so the following example will be changing the role of student so they can only see the courses/categories they are currently enrolled in.
  1. Go to Admin -> Add/Edit courses
  2. Find the category you want
  3. Click the "eye icon" to make this category hidden
  4. Now click the category. You should see a list of courses or sub-categories......so while you are on this page, go to your settings block. You should see a link called "Assign Roles"
  5. Assign your user to the role "Student"

Now let's modify the role of  "Student" a little bit
  1. ON THE SAME PAGE (category administration), go to the settings block -> permissions
  2. Choose the role of "student"
  3. "View hidden categories"  should be set to true
So deep breath:  now on the Navigation block, the "Courses" link should only display the categories in which that user has been assigned to. 
==================================================================

Currently a normal "student" user in our case, can go tot the Navigation Block, and click on "Courses" to see a drop-down list of categories they are assigned to. 
That user can also see all the courses within that category, whether they are enrolled or not.

To make a user only see their courses:
  1. First enroll that student in a course via the enrollment method your prefer
  2. Then go the course and click the "eye icon" to make this couses hidden.
  3. On your chosen category administration page, go to settings block -> Permissions
  4. Choose the role of "student"
  5. "View hidden courses"  should be set to true
Second deep breath:  now on the Navigation block, the "Courses" link will show only the CATEGORIES AND COURSES the student is currently enrolled in. 

It was a lot of work, and I feel like I hacked the moodle core a little.......but now I finally have a navigation block I can use properly :)

Saturday, January 14, 2012

Adding CSS3 to Moodle 2.1: Yes even for Internet Explorer

Inside of my custom theme for Moodle, I've create some nice enhancements to my design through the use of gradient backgrounds, rounded corners, shadows for text and other elements. Sounds great right?

Unfortunately, Internet Explorer 6 - 8....maybe even 9......doesn't natively support those features. So while spending some time on google, I found a great solution:  pie.
No, really.
There is a plugin created to enhance the capability of IE6+ with CSS3 features.
It is called 'PIE' : Progressive Internet Explorer.
http://css3pie.com/

It has support for the following features:

  • border-radius

  • box-shadow

  • border-image

  • CSS3 Backgrounds (-pie-background)

  • Gradients

  • RGBA Color Values

  • PIE Custom Properties

  • It's quite simple to use as well. Simply place the script within your project, and add one line of code to your CSS like this:

    #myelement
    {
      border-radius: 10px;
      -moz-border-radius: 10px;
      -webkit-border-radius:10px;
      behavior: url(path/to/PIE.htc);
    }

    One thing that it is lacking right now is support for text-shadows. So here is another script that can be used for that:
    http://fetchak.com/ie-css3/

    Same type of concept. Inside your CSS file, declare your text-shadow like normal. Then simply provide a link to the behavior like so:

    #myelement
    {

           text-shadow: 1px 1px 1px #888888;
           behavior: url(path/to/ie-css3.htc);

    }


    As an extra precaution, I went inside the file and commented the box-shadow and radius functions (lines 281-282) -- I didn't want those to overlap with PIE, which look a little better than this wrapper.
    NOTE: I don't think the above code will work with em sizes, only with px (Haven't tested this yet)

    Hope this was an inspiration to others!

    Sunday, January 8, 2012

    How to add new field to database activity - Part 2

    Okay, now that we have our new field created and working within the database activity, we need to add the functionality so that any file you upload will be automatically embedded.
    NOTE:  Right now I only added video support, since there is already an image field. Perhaps I will add audio support later, but it's not pertinent to my needs right now.


    1) Go to:    /mod/data/field/media/field.class.php   (<-- replace the word "media" with your custom field name)
    2) Around line 125, you'll find a function called:  
    function display_browse_field($recordid, $template)
    Now we are going to add some code to this function which will recognize the incoming file extension and create a video player based on the extension.

    3) Around line 145, you'll see this code:
    $str = '<img src="'.$OUTPUT->pix_url(file_mimetype_icon...
    This is actually displaying a link to download the file, instead of embedding it. Therefore, you can comment this out for now.

    4) On a new line, around line 146 or so, let's add our first new code:

    $path_info = pathinfo($name);
    $myexten = $path_info['extension'];

    This is taking the actual, submitted filename and checking the extension type.

    5) Now all we have to do is take the file extension and load a different video player for each special case. You can do this by creating a 'switch' or 'if / else' statement. I prefer the latter - so here is an example for one video type:

            // *       
          // Load the html5 player - for mp4 videos
          // *
          if($myexten === 'mp4' || $myexten === 'm4v')
          {
          $width = 600;
    $height = 300;

          $str = '<p><span class="mediaplugin mediaplugin_html5video">
    <video controls="true" width="700" preload="metadata" title="'.$name.'">
    <source src="'.$src.'" type="video/mp4"></source>
    <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="'.$width.'" height="'.$height.'">
    <param name="pluginspage" value="http://www.apple.com/quicktime/download/" />
    <param name="src" value="'.$src.'" />
    <param name="controller" value="true" />
    <param name="loop" value="false" />
    <param name="autoplay" value="false" />
    <param name="autostart" value="false" />
    <param name="scale" value="aspect" />
    <!--[if !IE]>-->
     <object data="'.$src.'" type="video/mp4" width="'.$width.'" height="'.$height.'">
      <param name="src" value='.$src.' />
      <param name="pluginurl" value="http://www.apple.com/quicktime/download/" />
      <param name="controller" value="true" />
      <param name="loop" value="false" />
      <param name="autoplay" value="false" />
      <param name="autostart" value="false" />
      <param name="scale" value="aspect" />
     </object>
    <!--<![endif]-->
    </object>
    </video>
    </span></p>';

    return $str;
          }


    The $name and $src variables are already existing in code, and you can see that I declare my own $width and $height variables. Also notice this param inside the player:
    <param name="scale" value="aspect" />
    Even though I set my own width and height, the "aspect" value will clamp the video to it's original aspect ratio. Meaning:  the video will NOT stretch to fit. 
    If you want the video to stretch to your own custom dimensions, replace:
    <param name="scale" value="aspect" />
    with
    <param name="scale" value="tofit" />

    Lastly, please notice the variable that we are returning --> $str.
    We are creating a string that contains the video player and we are returning that string as actual html code. This allows the player to be directly embedded inside the page.

    6) Now notice we only checked for 2 video types, and only loaded an html5 video player. To continue this script, you also need to check for the remaining video types: 
    webm, ogv, flv, f4v, mov, m4a, mpg, wma, avi
    NOTE: wma and avi files will only play with embedded Windows Media Player ON Internet Explorer only.
    _______________________________________________________________________________
    EDIT:  I also want to point out that the quicktime player can handle most video files, including .mp4. This might be the best solution to using an html5 video player.
    ----------------------------------------------------------------------------------------------------------

    It's a wise choice to use .mp4 as your video standard.

    Here is a screenshot of the code at work:

    Saturday, January 7, 2012

    How to add new field to database activity - Part 1

    There are many changes that I'd like to make to the Moodle 2.1 database activity - I would mostly LOVE to embed images and video directly through the html editor.....like you can do on every other page. For some reason, this is disabled on the database activity. Oh well.

    For now I've come up with a temporary solution: add a new field that allows you to upload a media file and it will be embedded in your page. First thing we are going to do is create the new field structure:

    1. On your moodle server, go to /mod/data/field/
    2. Copy the "file" folder and rename this (I chose to rename the folder as "media")
    3. Open up the "field.class.php" file - go to the first line of class definition (line 25). 
      1. Change this:    data_field_file
      2. To this:           data_field_media   (<-- or whatever you named your new folder)
    4. Inside the same file, the very next line (line 26), change this:
      1. Change this:      var $type = 'file';
      2. To this:             var $type = 'media';   (<-- your chosen name)
    5. On your moodle server, go to /mod/data/lang/en/data.php
    6. Here is where we define the name of our new field, so ALL of moodle can find it. If you like to keep things in alphabetical order, go to line 202 and add this:
      1. $string['media'] = 'Media';           (<-- again, replace "media" with whatever name you chose)
    7. In the same file, around line 220, add this:
      1. $string['namemedia'] = 'Media field';           (<-- replace this with your name)

    Hopefully your new field should be added to the database acitvity now.
    To test if it works:   go to your database activity, to the "Fields" tab, and navigate to the drop-down box where you can choose a new field.  If all goes well, you should see your new field appear in the list!

    Sunday, January 1, 2012

    Starting the blog...duhn duhn dahh

    Since this is the first post, I'll explain a little more about the purpose of this blog. I've been learning the Moodle LMS for about 6 months now and I'm particularly familiar with verison 2.1. There have been many changes that I wished to have, so I've set out to create those changes myself. I have a fair understanding of most programming languages involving server and client code, but I'm pretty new to CSS and allllll the techniques possible within.

    What I've done so far on my testing Moodle website:

    • created separate themes
    • changed some code around so I can control my themes per user
    • changed the front page to my own html page
    • created a block simply for the user's profile page (contains image links to personal pages)
    My next entry will be about adding Javascript libraries to moodle, so you can use your own scripts and Jquery whereever you like! Let's make an awesome website with Moodle!