' . __('Your navigation settings have been successfully updated') . '
';
return true;
}
/**
* @access public
* @return void
*
*/
static function save_tab_2() {
ia3_helpers::set_option('Colours-1', $_POST['Colours-1']);
ia3_helpers::set_option('Colours-2', $_POST['Colours-2']);
ia3_helpers::set_option('Logo', $_POST['Logo']);
// Display an error/success message here?
echo '' . __('Your miscellaneous settings have been successfully updated') . '
';
return true;
}
}
if (function_exists('add_action')) {
add_action('admin_menu', array('ia3_back', 'do_setup'));
}
/**
*
* iA³ (Helpers) contains several helpers that allow the theme to perform
* as it should, as well as adding a few extra pieces of functionality when needed.
*
* @author Ben Sekulowicz-Barclay (iA).
*
**/
class ia3_helpers {
/**
* @param string
* @return string
* @author Ben Sekulowicz-Barclay
*
* Returns the page based on the ID, (key) passed to it.
*
**/
static function get_category($key = '') {
$cs = get_categories();
foreach($cs as $c) {
if ($c->cat_ID == $key) return $c;
}
return $cs[0];
}
/**
* @param string
* @return string
* @author Ben Sekulowicz-Barclay
*
* Returns the page based on the ID, (key) passed to it.
*
**/
static function get_page($key = '') {
$ps = get_pages();
foreach($ps as $p) {
if ($p->ID == $key) return $p;
}
return $ps[0];
}
/**
* @access static
* @param string
* @param string
* @return string
*
*/
static function get_option($key, $default = '') {
$array = get_option('ia3_options');
return (is_array($array) && isset($array[$key]))? $array[$key]: $default;
}
/**
* @access static
* @param string
* @return string
*
*/
static function set_option($key, $value) {
$array = get_option('ia3_options');
if (!is_array($array)) $array = array();
$array[$key] = $value;
update_option('ia3_options', $array);
}
/**
* @access static
* @param string
* @return string
*
*/
static function get_nav_cell($key = '', $default = '') {
$array = array();
$value = ia3_helpers::get_option($key);
if ($value == '') return $default;
if (preg_match("/^c\-(.*)/", $value, $array)) {
$item = ia3_helpers::get_category($array[1]);
$item_i = isset($item->cat_ID)? $item->cat_ID: 0;
$item_n = isset($item->name)? $item->name: __('Unknown');
$item_l = get_category_link($item_i);
if (strpos($item_l . '***', $_SERVER['REQUEST_URI'] . '***')) {
return '' . $item_n . '';
} else {
return '' . $item_n . '';
}
} else if (preg_match("/^p\-(.*)/", $value, $array)) {
$item = ia3_helpers::get_page($array[1]);
$item_i = isset($item->ID)? $item->ID: 0;
$item_n = isset($item->post_title)? $item->post_title: __('Unknown');
$item_l = get_page_link($item_i);
if (strpos($item_l . '***', $_SERVER['REQUEST_URI'] . '***')) {
return '' . $item_n . '';
} else {
return '' . $item_n . '';
}
} else {
$item_l = stripslashes($value);
$item_u = array();
if (preg_match("/^$/", $item_l, $item_u)) {
if (isset($item_u[2]) && strpos($item_u[2] . '***', $_SERVER['REQUEST_URI'] . '***')) {
return '' . $item_l . '';
} else {
return $item_l;
}
}
return $item_l;
}
}
/**
* @access static
* @param string
* @return void
*
*/
static function put_nav_cell($key = '') {
$cs = get_categories();
$ps = get_pages();
$selected = FALSE;
?>
' . __('Page Name') . ''))); ?>" />
'', 'after_widget' => '', 'before_title' => '', 'after_title' => '
'));
}
if (function_exists('add_theme_support')) {
add_theme_support('post-thumbnails');
}
?>