pyrocms/pyrocms — pull request #3223 by syosoft (2014-03-14 02:03:22+00:00)
Title: Update admin_themes.php

A simple explode doesn't allow for an option value to contain an equal sign. With this change, that cares about equal signs a little more, theme options can contain HTML. Consider the following theme:

class Theme_Xyz extends Theme
{
...

public function __construct()
{
$files = glob(FCPATH.SHARED_ADDONPATH.'themes/xyz/img/option-images/*');
$image_options = array('=None');

foreach($files as $file) :
$clean_path = str_replace(FCPATH, '/', $file);
$image_options[] = $clean_path.'=';
endforeach;

$this->options = array(
...,
'image' => array(
'title' => 'Image:',
'description' => '',
'type' => 'radio',
'default' => '',
'options' => implode('|', $image_options),
'is_required' => false,
),
...,
);
}
...
}