Пример #1
0
/**
 * Retrieve all theme modifications.
 *
 * @since 4.7.5
 *
 * @return array|null Theme modifications.
 */
function get_theme_navmenu($mode)
{
    $skin = modApiFunc('Look_Feel', 'getCurrentSkin');
    $option_name = "reg_menu_" . $skin;
    $theme_slug = asc_get_option($option_name, true);
    return $theme_slug;
}
Пример #2
0
/**
 * Returns an array of all registered navigation menus in a theme
 *
 * @since 4.7.5
 * @return array
 */
function get_registered_nav_menus()
{
    $skin = modApiFunc('Look_Feel', 'getCurrentSkin');
    $option_name = "theme_mods_" . $skin;
    $location = asc_get_option($option_name, $default = 'true');
    foreach ($location as $location => $discription) {
        if ($location == 'nav_menu_register') {
            $_asc_registered_nav_menus = $discription;
        }
    }
    if (isset($_asc_registered_nav_menus)) {
        return $_asc_registered_nav_menus;
    }
    return array();
}
 function GetThemeRegMenu()
 {
     global $application;
     $locations = get_registered_nav_menus();
     $num_locations = count(array_keys($locations));
     $current_theme = modApiFunc('Look_Feel', 'getCurrentSkin');
     $skin = "reg_menu_" . $current_theme;
     $reg_menu = asc_get_option($skin, true);
     $reg_menu_id = $reg_menu['nav_menu_location'];
     $newArr = array();
     foreach ($reg_menu_id as $key => $value) {
         $key = str_replace("'", '', $key);
         $newArr[$key] = $value;
     }
     $result = '';
     foreach ($locations as $_location => $_name) {
         $menuid = $newArr[$_location];
         $template_contents = array('Name' => $_name, 'FoundMenu' => $this->outputMenu($menuid), 'Location' => $_location, 'MenuId' => $menuid);
         $this->_Template_Contents = $template_contents;
         $application->registerAttributes($this->_Template_Contents);
         $result .= $this->mTmplFiller->fill('cms/cms_nav_menu/theme_location/', 'theme_location.tpl.html', array());
     }
     return $result;
 }
Пример #4
0
/**
 * Print option value after sanitizing for forms.
 *
 * @since 4.7.5
 *
 * @param string $option Option name.
 */
function asc_form_option($option)
{
    $res = asc_get_option($option);
    echo $res[$option];
}