/**
 * Calculates the width of the primary or secondary nav elements, or the child
 * UL elements, based on the border settings choices.
 * 
 * @author Gary Jones
 * @param string $nav 'primary' or 'secondary'
 * @param boolean $ul True for getting width of child UL, false (default) for the (grand)parent element.
 * @return string 
 * @since 1.0
 */
function prose_calculate_nav_width($nav, $ul = false)
{
    $border = prose_get_fresh_design_option($nav . '_nav_border');
    $border_style = prose_get_fresh_design_option($nav . '_nav_border_style');
    if ('none' == $border_style) {
        $border = 0;
    }
    $width = 940 - 2 * $border;
    if ($ul) {
        $border = prose_get_fresh_design_option($nav . '_nav_inner_border');
        $border_style = prose_get_fresh_design_option($nav . '_nav_inner_border_style');
        if ('none' == $border_style) {
            $border = 0;
        }
        $width = $width - 2 * $border;
    }
    return ' ' . $width . 'px';
}
/**
 * Adds a textarea setting - label and textarea.
 *
 * @author Gary Jones
 * @param string $id ID of the element
 * @param string $label Displayed label
 * @param integer cols Value for the cols attribute (default = 25)
 * @param integer rows Value for the rows attribute (default = 10)
 * @since 0.9.5
 * @return string HTML markup
 */
function prose_add_textarea_setting($id, $label, $cols = 25, $rows = 10)
{
    return prose_add_label($id, $label) . '<br /><textarea id="' . $id . '" name="' . PROSE_SETTINGS_FIELD . '[' . $id . ']" cols="39" rows="10">' . prose_get_fresh_design_option($id) . '</textarea>';
}
예제 #3
0
파일: update.php 프로젝트: hscale/webento
/**
 * Update Prose to the latest version.
 *
 * This iterative update function will take a Prose installation, no matter
 * how old, and update its options to the latest version.
 *
 * @since 1.5.0
 *
 * @uses CHILD_DB_VERSION
 * @uses PROSE_SETTINGS_FIELD
 *
 * @return null Returns early if we're already on the latest version.
 */
function prose_update()
{
    /** Don't do anything if we're on the latest version */
    if (prose_get_fresh_design_option('db_version') >= CHILD_DB_VERSION) {
        return;
    }
    ###########################
    # UPDATE DB TO VERSION 1500
    ###########################
    if (prose_get_fresh_design_option('db_version') < '1500') {
        prose_update_1500();
    }
    do_action('prose_update');
}