← Back to team overview

mahara-contributors team mailing list archive

[Bug 1444463] Re: Allow themepaths method to use get_image_url method

 

Agreed. To match up with the new theme images system in 15.10 that
allows images to be multiple file formats, this should allow multiple
file formats.

To expand on the description, the "themepaths()" method in lib/web.php
returns a hard-coded array of images and CSS files:

function themepaths() {

    static $paths;
    if (empty($paths)) {
        $paths = array(
            'mahara' => array(
                'images/btn_close.png',
                'images/btn_deleteremove.png',
                'images/btn_edit.png',
                'images/failure.png',
                'images/loading.gif',
                'images/success.png',
                'images/warning.png',
                'images/help.png',
                'style/js.css',
            ),
        );
    }
    return $paths;
}

These paths are then sent to $THEME->get_url() in
lib/dwoo/mahara/Dwoo_Mahara.php, where they are JSON-encoded so that
they can be accessed via the Javascript "get_themeurl" method.

There are a couple of tricky things here:

1. When Javascript invokes these, it gets them by their current full
path, e.g. get_themeurl('images/help.png'). So we'd need to update all
the places that currently call this code.

2. themepaths() also returns one Javascript library, which is used in
the smarty() method in lib/web.php We need to make sure that doesn't
break.

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1444463

Title:
  Allow themepaths method to use get_image_url method

Status in Mahara ePortfolio:
  Confirmed

Bug description:
  Currently, the themepaths method located in the lib/web.php file stock a list of theme path.
  Some of this path are image are may be called by the get_image_url_method_instead of the get_url method.

  Adapt the use of this method to detect if the path is an image or
  refactor it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1444463/+subscriptions


References