id_base == $block_class) unset($aq_registered_blocks[$block_class]); } } /** Get list of all blocks **/ function aq_get_blocks($template_id) { global $aq_page_builder; $blocks = $aq_page_builder->get_blocks($template_id); return $blocks; } /** * Form Field Helper functions * * Provides some default fields for use in the blocks ********************************************************/ /* Input field - Options: $size = min, small, full */ function aq_field_input($field_id, $block_id, $input, $size = 'full', $type = 'text') { $output = ''; return $output; } /* Textarea field */ function aq_field_textarea($field_id, $block_id, $text, $size = 'full') { $output = ''; return $output; } /* Select field */ function aq_field_select($field_id, $block_id, $options, $selected) { $options = is_array($options) ? $options : array(); $output = ''; return $output; } /* Multiselect field */ function aq_field_multiselect($field_id, $block_id, $options, $selected_keys = array()) { $output = ''; return $output; } /* Color picker field */ function aq_field_color_picker($field_id, $block_id, $color, $default = '') { $output = '
'; $output .= ''; $output .= '
'; return $output; } /* Single Checkbox */ function aq_field_checkbox($field_id, $block_id, $check) { $output = ''; $output .= ''; return $output; } /* Multi Checkbox */ function aq_field_multicheck($field_id, $block_id, $fields = array(), $selected = array()) { } /* Media Uploader */ function aq_field_upload($field_id, $block_id, $media, $media_type = 'image') { $output = ''; $output .= 'Upload

'; return $output; } /** * Misc Helper Functions **************************/ /** Get column width * @parameters - $size (column size), $grid (grid size e.g 940), $margin */ function aq_get_column_width($size, $grid = 940, $margin = 20) { $columns = range(1,12); $widths = array(); foreach($columns as $column) { $width = (( $grid + $margin ) / 12 * $column) - $margin; $width = round($width); $widths[$column] = $width; } $column_id = absint(preg_replace("/[^0-9]/", '', $size)); $column_width = $widths[$column_id]; return $column_width; } /** Recursive sanitize * For those complex multidim arrays * Has impact on server load on template save, so use only where necessary */ function aq_recursive_sanitize($value) { if(is_array($value)) { $value = array_map('aq_recursive_sanitize', $value); } else { $value = htmlspecialchars(stripslashes($value)); } return $value; } }