Beispiel #1
0
        function _end_table_edit($form, $results = true)
        {
            ?>
	<tr><td><label for="enable_eval"><?php 
            _e('Enable PHP', 'it-l10n-Builder-Cohen');
            ?>
</label></td>
		<td>
			<?php 
            $form->add_drop_down('enable_eval', array('no' => __('No', 'it-l10n-Builder-Cohen'), 'yes' => __('Yes', 'it-l10n-Builder-Cohen')));
            ?>
 <?php 
            ITUtility::add_tooltip(__('Enabling this option allows for processing of PHP code inside the module. <strong>Always review the PHP code if taken from a third party as it could pose a serious security threat.</strong>', 'it-l10n-Builder-Cohen'));
            ?>
		</td>
	</tr>
<?php 
        }
Beispiel #2
0
        function _start_table_edit($form, $results = true)
        {
            $title_types = array('default' => __('Show Site Title (default)', 'it-l10n-Builder-Madison'), 'custom' => __('Use custom Site Title text', 'it-l10n-Builder-Madison'), 'disabled' => __('Do not show Site Title', 'it-l10n-Builder-Madison'));
            $tagline_types = array('default' => __('Show Tagline (default)', 'it-l10n-Builder-Madison'), 'custom' => __('Use custom Tagline text', 'it-l10n-Builder-Madison'), 'disabled' => __('Do not show Tagline', 'it-l10n-Builder-Madison'));
            $seo_types = array('default' => __('Recommended Settings (default)', 'it-l10n-Builder-Madison'), 'custom' => __('Custom', 'it-l10n-Builder-Madison'));
            $tag_options = array('div' => __('div (default)', 'it-l10n-Builder-Madison'), 'h1' => 'h1', 'h2' => 'h2', 'h3' => 'h3', 'h4' => 'h4', 'h5' => 'h5', 'h6' => 'h6');
            $title_home_tag_options = array('div' => 'div', 'h1' => __('h1 (default)', 'it-l10n-Builder-Madison'), 'h2' => 'h2', 'h3' => 'h3', 'h4' => 'h4', 'h5' => 'h5', 'h6' => 'h6');
            ?>
	<tr><td><label for="title_type"><?php 
            _e('Site Title', 'it-l10n-Builder-Madison');
            ?>
</label></td>
		<td>
			<?php 
            $form->add_drop_down('title_type', $title_types);
            ?>
			<?php 
            ITUtility::add_tooltip(__('By default, this is the Site Title as configured in WordPress\' General Settings.', 'it-l10n-Builder-Madison'));
            ?>
			
			<div id="title_type_custom_options">
				<p><label for="title_custom"><?php 
            _e('Custom Site Title', 'it-l10n-Builder-Madison');
            ?>
</label> <?php 
            $form->add_text_box('title_custom');
            ?>
</p>
				<br />
			</div>
		</td>
	</tr>
	<tr><td><label for="tagline_type"><?php 
            _e('Tagline', 'it-l10n-Builder-Madison');
            ?>
</label></td>
		<td>
			<?php 
            $form->add_drop_down('tagline_type', $tagline_types);
            ?>
			<?php 
            ITUtility::add_tooltip(__('By default, this is the Tagline as configured in WordPress\' General Settings.', 'it-l10n-Builder-Madison'));
            ?>
			
			<div id="tagline_type_custom_options">
				<p><label for="tagline_custom"><?php 
            _e('Custom Tagline', 'it-l10n-Builder-Madison');
            ?>
</label> <?php 
            $form->add_text_box('tagline_custom');
            ?>
</p>
				<br />
			</div>
		</td>
	</tr>
	<tr><td><label for="seo_type"><?php 
            _e('SEO', 'it-l10n-Builder-Madison');
            ?>
</label></td>
		<td>
			<?php 
            $form->add_drop_down('seo_type', $seo_types);
            ?>
			<?php 
            ITUtility::add_tooltip(__('By default, the Header Module uses the recommended settings of an <code>h1</code> tag on the Site Title only on the home page view and a <code>div</code> tag all other times.', 'it-l10n-Builder-Madison'));
            ?>
			
			<table id="seo_type_custom_options">
				<tr><th style="text-align:left;" colspan="2"><p><?php 
            _e('Home Page View', 'it-l10n-Builder-Madison');
            ?>
</p></th></tr>
				<tr><td><label for="seo_title_home"><?php 
            _e('Tag for Site Title', 'it-l10n-Builder-Madison');
            ?>
</label></td>
					<td><?php 
            $form->add_drop_down('seo_title_home', $title_home_tag_options);
            ?>
</td>
				</tr>
				<tr><td><label for="seo_tagline_home"><?php 
            _e('Tag for Tagline', 'it-l10n-Builder-Madison');
            ?>
</label></td>
					<td><?php 
            $form->add_drop_down('seo_tagline_home', $tag_options);
            ?>
</td>
				</tr>
				<tr><th style="text-align:left;" colspan="2"><p><?php 
            _e('Other Views', 'it-l10n-Builder-Madison');
            ?>
</p></th></tr>
				<tr><td><label for="seo_title_other"><?php 
            _e('Tag for Site Title', 'it-l10n-Builder-Madison');
            ?>
</label></td>
					<td><?php 
            $form->add_drop_down('seo_title_other', $tag_options);
            ?>
</td>
				</tr>
				<tr><td><label for="seo_tagline_other"><?php 
            _e('Tag for Tagline', 'it-l10n-Builder-Madison');
            ?>
</label></td>
					<td><?php 
            $form->add_drop_down('seo_tagline_other', $tag_options);
            ?>
</td>
				</tr>
			</table>
			<br />
		</td>
	</tr>
	<tr><td colspan="2">&nbsp;</td></tr>
<?php 
        }
Beispiel #3
0
    function _show_child_theme_options()
    {
        $options = array('child_theme_type' => 'parent', 'child_theme_option' => 'activate', 'theme_activation' => !empty($_REQUEST['theme_activation']) ? 1 : '', 'fresh_install' => !empty($_REQUEST['fresh_install']) ? 1 : '', 'step' => 'layouts_and_views');
        if (get_transient('builder_fresh_install')) {
            $options['step'] = 'finish';
            delete_transient('builder_fresh_install');
        }
        $themes = wp_get_themes();
        $names = array();
        foreach ($themes as $theme) {
            $names[] = $theme->get('Name');
        }
        $options['child_theme_name'] = sprintf(__('%s - Custom', 'it-l10n-Builder-Paige'), $themes[basename(get_template_directory())]->get('Name'));
        if (in_array($options['child_theme_name'], $names)) {
            $count = 2;
            while (in_array("{$options['child_theme_name']} {$count}", $names)) {
                $count++;
            }
            $options['child_theme_name'] = "{$options['child_theme_name']} {$count}";
        }
        $logo_url = ITUtility::get_url_from_file(dirname(__FILE__) . '/images/builder-logo.png');
        $child = wp_get_theme(get_stylesheet());
        if (get_template() == get_stylesheet()) {
            $child_theme_objects = builder_get_child_themes();
            $child_themes = array();
            foreach ($child_theme_objects as $theme) {
                $child_themes[$theme->get_stylesheet()] = $theme->get('Name');
            }
            if (empty($child_themes)) {
                $type = 'create_child';
            } else {
                $type = 'select_or_create_child';
            }
            $parent = $child;
        } else {
            $type = 'child_info';
            $parent = wp_get_theme(get_template());
        }
        $form = new ITForm($options);
        $this->_form =& $form;
        ?>
	<div class="wrap">
		<?php 
        $form->start_form();
        ?>
			<?php 
        if (empty($_REQUEST['theme_activation'])) {
            ?>
				<?php 
            ITUtility::screen_icon();
            ?>
				
				<?php 
            $this->_print_editor_tabs();
            ?>
			<?php 
        }
        ?>
			
			<div class="it-brochure-box">
				<img class="it-logo" src="<?php 
        echo $logo_url;
        ?>
" alt="Builder Logo" />
				
				<h1>Builder Setup</h1>
				
				<?php 
        if ('child_info' == $type) {
            ?>
					<div class="it-notice"><?php 
            printf(__('You are currently running a custom Builder child theme called <strong>%1$s</strong> created for the <strong>%2$s</strong> theme. All customizations should be made to this custom theme.', 'it-l10n-Builder-Paige'), $child->get('Name'), $parent->get('Name'));
            ?>
</div>
					<br />
					
					<div class="it-input-set">
						<?php 
            if ('finish' == $options['step']) {
                ?>
							<?php 
                $form->add_submit('ignore', array('value' => __('Continue', 'it-l10n-Builder-Paige')));
                ?>
						<?php 
            } else {
                ?>
							<?php 
                $form->add_submit('ignore', array('value' => __('Continue to Layouts and Views Setup', 'it-l10n-Builder-Paige')));
                ?>
						<?php 
            }
            ?>
					</div>
				<?php 
        } elseif ('create_child' == $type) {
            ?>
					<p><?php 
            printf(__('To create a <a href="%1$s">child theme</a> that you can customize, choose a name below and click the <em>Create My Child Theme</em> button.', 'it-l10n-Builder-Paige'), 'http://codex.wordpress.org/Child_Themes');
            ?>
</p>
					
					<div class="it-input-set">
						<label for="child_theme_name"><?php 
            _e('Your child theme name', 'it-l10n-Builder-Paige');
            ?>
</label>
						<?php 
            ITUtility::add_tooltip(__('Use a descriptive name that will help you identify your theme\'s name.', 'it-l10n-Builder-Paige'));
            ?>
						<br />
						
						<?php 
            $form->add_text_box('child_theme_name', array('class' => 'regular-text'));
            ?>
					</div>
					
					<div class="it-input-set">
						<?php 
            $form->add_submit('create_child_theme', array('value' => __('Create My Child Theme', 'it-l10n-Builder-Paige')));
            ?>
						
						<?php 
            if (empty($GLOBALS['builder_fresh_install'])) {
                ?>
							<p><a class="it-skip" href="<?php 
                echo admin_url('admin.php?page=theme-settings&editor_tab=setup&step=layouts_and_views');
                ?>
"><?php 
                _e('Skip to next step', 'it-l10n-Builder-Paige');
                ?>
</a></p>
						<?php 
            } else {
                ?>
							<p><a class="it-skip" href="<?php 
                echo admin_url('admin.php?page=ithemes-builder-theme');
                ?>
"><?php 
                _e('Skip', 'it-l10n-Builder-Paige');
                ?>
</a></p>
						<?php 
            }
            ?>
					</div>
				<?php 
        } else {
            ?>
					<p><?php 
            printf(_n('Your site has a <a href="%1$s">child theme</a> for the %2$s theme available. As it is recommended to always run a child theme rather than the parent theme, please either activate the existing child theme or create a new one using the options below.', 'Your site has <a href="%1$s">child themes</a> for the %2$s theme available. As it is recommended to always run a child theme rather than the parent theme, please either activate an existing child theme or create a new one using the options below.', count($child_themes), 'it-l10n-Builder-Paige'), 'http://codex.wordpress.org/Child_Themes', $parent->get('Name'));
            ?>
</p>
					
					<div class="it-shrink-wrap-box">
						<label><?php 
            printf(__('%1$s Activate an existing child theme', 'it-l10n-Builder-Paige'), $form->add_radio('child_theme_option', array('value' => 'activate', 'class' => 'show-hide-toggle')));
            ?>
</label>
						<br />
						
						<label><?php 
            printf(__('%1$s Create a new child theme', 'it-l10n-Builder-Paige'), $form->add_radio('child_theme_option', array('value' => 'create', 'class' => 'show-hide-toggle')));
            ?>
</label>
						<br />
						<br />
						
						<div class="it-options-child_theme_option it-options-child_theme_option-activate">
							<p><label for="child_theme"><?php 
            _e('Select the theme to activate:', 'it-l10n-Builder-Paige');
            ?>
</label></p>
							<?php 
            $form->add_drop_down('child_theme', $child_themes);
            ?>
							<br />
							<br />
							<br />
							<?php 
            $form->add_submit('create_child_theme', array('value' => __('Activate My Child Theme', 'it-l10n-Builder-Paige')));
            ?>
						</div>
						
						<div class="it-options-child_theme_option it-options-child_theme_option-create">
							<p>
								<label for="child_theme_name"><?php 
            _e('Your child theme name', 'it-l10n-Builder-Paige');
            ?>
</label>
								<?php 
            ITUtility::add_tooltip(__('Use a descriptive name that will help you identify your theme.', 'it-l10n-Builder-Paige'));
            ?>
							</p>
							
							<?php 
            $form->add_text_box('child_theme_name', array('class' => 'regular-text'));
            ?>
							<br />
							<br />
							<br />
							
							<?php 
            $form->add_submit('create_child_theme', array('value' => __('Create My Child Theme', 'it-l10n-Builder-Paige')));
            ?>
						</div>
						
						<?php 
            if (empty($GLOBALS['builder_fresh_install'])) {
                ?>
							<p><a class="it-skip" href="<?php 
                echo admin_url('admin.php?page=theme-settings&editor_tab=setup&step=layouts_and_views');
                ?>
"><?php 
                _e('Skip to next step', 'it-l10n-Builder-Paige');
                ?>
</a></p>
						<?php 
            } else {
                ?>
							<p><a class="it-skip" href="<?php 
                echo admin_url('admin.php?page=ithemes-builder-theme');
                ?>
"><?php 
                _e('Skip', 'it-l10n-Builder-Paige');
                ?>
</a></p>
						<?php 
            }
            ?>
					</div>
				<?php 
        }
        ?>
			</div>
			
			
			<?php 
        $form->add_hidden('theme_activation');
        ?>
			<?php 
        $form->add_hidden('fresh_install');
        ?>
			<?php 
        $form->add_hidden('step');
        ?>
			<?php 
        $form->add_hidden_no_save('editor_tab', $this->_parent->_active_tab);
        ?>
		<?php 
        $form->end_form();
        ?>
	</div>
<?php 
    }
Beispiel #4
0
        function _start_table_edit($form, $results = true)
        {
            $height_types = array('auto' => __('Automatic, use a height that preserves the image\'s aspect ratio', 'it-l10n-Builder-Paige'), 'custom' => __('Manual, select a height manually', 'it-l10n-Builder-Paige'));
            if (!isset($form->_options['height_type'])) {
                $form->set_option('height_type', '');
            }
            ?>
	<tr id="image-upload-row" style="display:none;">
		<td><?php 
            _e('Upload Image', 'it-l10n-Builder-Paige');
            ?>
</td>
		<td>
			<?php 
            $form->add_file_upload('image');
            ?>
		</td>
	</tr>
	<tr><td><label for="height_type"><?php 
            _e('Height', 'it-l10n-Builder-Paige');
            ?>
</label></td>
		<td>
			<?php 
            $form->add_drop_down('height_type', $height_types);
            ?>
			<?php 
            ITUtility::add_tooltip(__('If Manual is selected, the image will first be resized to fit the height and then cropped to fit the width.', 'it-l10n-Builder-Paige'), '', 'left');
            ?>
			
			<div id="height_type-options">
				<p><?php 
            _e('Manual height', 'it-l10n-Builder-Paige');
            ?>
 <?php 
            $form->add_text_box('height', array('style' => 'width:50px;'));
            ?>
 px</p>
			</div>
		</td>
	</tr>
	<tr><td valign="top"><label for="image_alt"><?php 
            _e('Image Alt Attribute', 'it-l10n-Builder-Paige');
            ?>
</label></td>
		<td>
			<?php 
            $form->add_text_box('image_alt');
            ?>
			<?php 
            ITUtility::add_tooltip(__('This sets the <code>alt</code> attribute of the <code>img</code> tag. This attribute is typically used to describe the image in case it cannot be viewed. If this is left blank, the Module\'s Name will be used instead.', 'it-l10n-Builder-Paige'));
            ?>
		</td>
	</tr>
	<tr><td valign="top"><label for="url"><?php 
            _e('Link URL', 'it-l10n-Builder-Paige');
            ?>
</label></td>
		<td>
			<?php 
            $form->add_text_box('url');
            ?>
			<?php 
            ITUtility::add_tooltip(__('Make sure that you use complete URLs including the <code>http://</code> portion. If you leave this fied empty, no link URL will be used.', 'it-l10n-Builder-Paige'));
            ?>
		</td>
	</tr>
	<tr><td valign="top"><label for="new_window"><?php 
            _e('Link Opens New Window', 'it-l10n-Builder-Paige');
            ?>
</label></td>
		<td>
			<?php 
            $form->add_check_box('new_window');
            ?>
		</td>
	</tr>
<?php 
        }
Beispiel #5
0
        function _start_table_edit($form, $results = true)
        {
            $types = array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5');
            if (empty($_REQUEST['type'])) {
                $_REQUEST['type'] = '1';
            }
            $default_percents = $this->_get_default_percents();
            if (isset($default_percents[$_REQUEST['type']])) {
                $start_widget_percents = $default_percents[$_REQUEST['type']];
            } else {
                $start_widget_percents = '';
            }
            ?>
	<tr><td><label for="type"><?php 
            _e('Columns', 'it-l10n-Builder-Paige');
            ?>
</label></td>
		<td>
			<?php 
            $form->add_drop_down('type', $types);
            ?>
			<?php 
            ITUtility::add_tooltip(__('Each column becomes a widget area that you can add widgets to.', 'it-l10n-Builder-Paige'));
            ?>
		</td>
	</tr>
	<tr style="vertical-align:top;"><td><?php 
            _e('Column Widths', 'it-l10n-Builder-Paige');
            ?>
</td>
		<td id="widget_percents_row">
			<?php 
            $form->add_drop_down('widget_percents', $start_widget_percents);
            ?>
			<?php 
            ITUtility::add_tooltip(__('You can make the columns wider or narrower by using these options. To get more control over the widths used, select "Custom..." to put in your own widths.', 'it-l10n-Builder-Paige'));
            ?>
			
			<div id="widget-percents-custom" style="display:none;">
				<?php 
            $form->add_text_box('custom_widget_percents', array('size' => '20', 'maxlength' => '30'));
            ?>
<br />
				<?php 
            _e('Specify the percentage width of each widget area.', 'it-l10n-Builder-Paige');
            ?>
<br />
				<?php 
            _e('For example, if you have three widget areas and want to separate them into 20%, 30%, and 50% widths, input <strong><code>20,30,50</code></strong> in the box above.', 'it-l10n-Builder-Paige');
            ?>
			</div>
		</td>
	</tr>
<?php 
        }
Beispiel #6
0
        function _modify_layout()
        {
            $defaults = array('guid' => '', 'description' => '', 'width' => '960', 'hide_widths' => 'no');
            $defaults = apply_filters('builder_filter_layout_editor_default_values', $defaults);
            $layout_widths = array('600' => __('Narrow (600 pixels)', 'it-l10n-Builder-Paige'), '780' => __('Medium (780 pixels)', 'it-l10n-Builder-Paige'), '960' => __('Wide (960 pixels)', 'it-l10n-Builder-Paige'));
            $layout_widths = apply_filters('builder_filter_layout_editor_width_options', $layout_widths);
            foreach ((array) $layout_widths as $width => $description) {
                if ((string) intval($width) != (string) $width) {
                    unset($layout_widths[$width]);
                }
            }
            $layout_widths['custom'] = __('Custom...', 'it-l10n-Builder-Paige');
            if (builder_theme_supports('builder-extensions')) {
                $extensions_data = apply_filters('builder_get_extensions_data', array());
                $extensions = array('' => __('-- No Extension --', 'it-l10n-Builder-Paige'));
                $extension_descriptions = array();
                foreach ((array) $extensions_data as $extension => $extension_data) {
                    $extensions[$extension] = $extension_data['name'];
                    $description = $extension_data['description'];
                    if (!empty($description)) {
                        $description = "<p>{$description}</p>";
                    }
                    if ($extension_data['disable_theme_style']) {
                        $description .= __('<p><strong>Notice:</strong> This Extension replaces theme styling with its own.</p>', 'it-l10n-Builder-Paige');
                    }
                    $extension_descriptions[] = '"' . str_replace('"', '\\"', $extension) . '": "' . str_replace('"', '\\"', $description) . '"';
                }
            }
            /*			$layouts = array();
            			foreach ( (array) $this->_options['layouts'] as $layout_id => $layout_data ) {
            				if ( isset( $_REQUEST['layout'] ) && ( $layout_id == $_REQUEST['layout'] ) )
            					continue;
            				$layouts[$layout_id] = $layout_data['description'];
            			}
            			sort( $layouts );*/
            $layout = array();
            if (isset($this->_cached_layout) && is_array($this->_cached_layout)) {
                $layout = $this->_cached_layout;
            } else {
                if (isset($_REQUEST['layout']) && isset($this->_options['layouts'][$_REQUEST['layout']])) {
                    $layout = $this->_options['layouts'][$_REQUEST['layout']];
                }
            }
            $layout = ITUtility::merge_defaults($layout, $defaults);
            if (isset($layout['width']) && (string) intval($layout['width']) == (string) $layout['width'] && !isset($layout_widths[$layout['width']])) {
                $layout['custom_width'] = $layout['width'];
                $layout['width'] = 'custom';
            }
            if (!empty($layout['extension']) && false !== strpos($layout['extension'], '%WP_CONTENT_DIR%')) {
                $layout['extension'] = basename($layout['extension']);
            }
            $form = new ITForm($layout);
            ?>
	<div class="wrap">
		<?php 
            ITUtility::screen_icon();
            ?>
		
		<?php 
            if (!empty($_REQUEST['layout'])) {
                ?>
			<h2><?php 
                _e('Edit Layout', $this->_var);
                ?>
</h2>
		<?php 
            } else {
                ?>
			<h2><?php 
                _e('Add New Layout', $this->_var);
                ?>
</h2>
		<?php 
            }
            ?>
		
		<?php 
            $form->start_form();
            ?>
			<h3 class="title"><?php 
            _e('Settings', 'it-l10n-Builder-Paige');
            ?>
</h3>
			<table class="form-table">
				<tr><th scope="row"><label for="description"><?php 
            _e('Name', 'it-l10n-Builder-Paige');
            ?>
</label></th>
					<td>
						<?php 
            $form->add_text_box('description', array('size' => '15', 'maxlength' => '15'));
            ?>
						<?php 
            ITUtility::add_tooltip(__('The name helps identify this Layout\'s widget areas. Choose a descriptive, short name.', 'it-l10n-Builder-Paige'));
            ?>
					</td>
				</tr>
				<tr><th scope="row"><label for="width"><?php 
            _e('Width', 'it-l10n-Builder-Paige');
            ?>
</label></th>
					<td>
						<?php 
            $form->add_drop_down('width', $layout_widths);
            ?>
						<?php 
            ITUtility::add_tooltip(__('The width determines how wide the Layout is. Typically, a wider width is better for more complex Layouts that have multiple sidebars while a more narrow width is better for minimalistic Layouts such as one that does not use any sidebars.'));
            ?>
						<div id="layout-width-custom" style="display:none;">
							<label>
								<?php 
            _e('Custom Width', 'it-l10n-Builder-Paige');
            ?>
								<?php 
            $form->add_text_box('custom_width', array('size' => '4', 'maxlength' => '5'));
            ?>
								<?php 
            _e('pixels', 'it-l10n-Builder-Paige');
            ?>
							</label>
						</div>
					</td>
				</tr>
				<?php 
            if (builder_theme_supports('builder-extensions')) {
                ?>
					<tr><th scope="row"><label for="extension"><?php 
                _e('Extension', 'it-l10n-Builder-Paige');
                ?>
</label></th>
						<td>
							<?php 
                $form->add_drop_down('extension', $extensions);
                ?>
							<?php 
                ITUtility::add_tooltip(__('Extensions can provide additional code that changes the content, provides additional features, or modifies the styling of the Layout.<br /><br />You can find Extensions in your theme\'s directory inside a directory named "extensions".', 'it-l10n-Builder-Paige'));
                ?>
							
							<div id="extension-details"></div>
						</td>
					</tr>
				<?php 
            }
            ?>
				<tr><th scope="row"><label for="hide_widgets"><?php 
            _e('Hide Widget Areas', 'it-l10n-Builder-Paige');
            ?>
</label></th>
					<td>
						<?php 
            $form->add_drop_down('hide_widgets', array('no' => __('No', 'it-l10n-Builder-Paige'), 'yes' => __('Yes', 'it-l10n-Builder-Paige')));
            ?>
						<?php 
            ITUtility::add_tooltip(__('Use this option to hide this Layout\'s widget areas from the <strong>Appearance &gt; Widgets</strong> editor. This makes it easier to work with other Layout\'s widget areas.', 'it-l10n-Builder-Paige'));
            ?>
					</td>
				</tr>
				<?php 
            do_action('builder_editor_add_custom_settings', $layout);
            ?>
			</table>
			
			<h3 class="title">Design</h3>
			<table class="form-table layout-modules">
				<tr class="add-module-help"><td colspan="2"><?php 
            _e('In order to start building your layout, please click the Add Module link below.', 'it-l10n-Builder-Paige');
            ?>
</td></tr>
				<?php 
            $position = 1;
            $max_id = 0;
            if (isset($layout['modules'])) {
                foreach ((array) $layout['modules'] as $id => $module) {
                    if (false !== $this->_add_module_fields($module, $id, $position)) {
                        $position++;
                    }
                    if ($id > $max_id) {
                        $max_id = $id;
                    }
                }
            }
            ?>
			</table>
			
			<p class="submit">
				<?php 
            $form->add_submit('save', array('value' => __('Save Layout', 'it-l10n-Builder-Paige'), 'class' => 'button-primary'));
            ?>
				<?php 
            $form->add_submit('save_and_continue', array('value' => __('Save Layout and Continue Editing', 'it-l10n-Builder-Paige'), 'class' => 'button-secondary'));
            ?>
				<?php 
            $form->add_submit('cancel', array('value' => __('Cancel', 'it-l10n-Builder-Paige'), 'class' => 'button-secondary cancel'));
            ?>
			</p>
			
			<input type="hidden" name="next-position" value="<?php 
            echo $position;
            ?>
" />
			<input type="hidden" name="current-position" value="0" />
			<input type="hidden" name="next-id" value="<?php 
            echo $max_id + 1;
            ?>
" />
			<?php 
            $form->add_hidden('self-link', $this->_self_link);
            ?>
			<?php 
            if (isset($_REQUEST['layout'])) {
                $form->add_hidden('layout', $_REQUEST['layout']);
            }
            ?>
			<?php 
            if (isset($_REQUEST['layout'])) {
                $form->add_hidden('layout-guid', $layout['guid']);
            }
            ?>
			<?php 
            if (isset($_REQUEST['add_layout'])) {
                $form->add_hidden('add_layout', $_REQUEST['add_layout']);
            }
            ?>
			<?php 
            $form->add_hidden('base_url', "{$this->_plugin_url}");
            ?>
		<?php 
            $form->end_form();
            ?>
	</div>
<?php 
            foreach ((array) $this->_modules as $var => $module) {
                echo "<table id=\"module-editor-{$var}\" style=\"display:none;\">";
                $this->_add_module_fields(array('module' => $var, 'data' => array()), '%id%', '%position%');
                echo '</table>';
                $form->add_hidden("module-name-{$var}", $module->_name);
                $form->add_hidden("module-editable-{$var}", method_exists($module, 'edit') ? '1' : '0');
                $form->add_hidden("module-max-{$var}", $module->_max);
            }
            $module_image_paths = array();
            if (is_dir("{$this->_plugin_path}/modules") && ($readdir = opendir("{$this->_plugin_path}/modules"))) {
                while (($module = readdir($readdir)) !== false) {
                    if (preg_match('/^\\.{1,2}$/', $module)) {
                        continue;
                    }
                    if (is_dir("{$this->_plugin_path}/modules/{$module}") && is_dir("{$this->_plugin_path}/modules/{$module}/images")) {
                        $module_image_paths[] = "modules/{$module}/images";
                    }
                }
            }
            echo "<div class=\"preload-images\">\n";
            foreach ((array) $module_image_paths as $path) {
                if ($readdir = opendir("{$this->_plugin_path}/{$path}")) {
                    while (($image = readdir($readdir)) !== false) {
                        if (is_file("{$this->_plugin_path}/{$path}/{$image}") && preg_match('/\\.(png|jpg|jpeg|gif)$/i', $image)) {
                            echo "<img src=\"{$this->_plugin_url}/{$path}/{$image}\" alt=\"preload image\" />\n";
                        }
                    }
                }
            }
            echo "</div>\n";
            ?>
	<script type="text/javascript">
		<?php 
            if (isset($extension_descriptions)) {
                ?>
			var builder_extension_details = {<?php 
                echo implode(",\n", $extension_descriptions);
                ?>
};
		<?php 
            }
            ?>
		
		init_layout_editor();
	</script>
<?php 
        }
Beispiel #7
0
        function meta_box_comments($form)
        {
            ?>
	<?php 
            if (!empty($this->_comment_post_types)) {
                ?>
		<p><?php 
                printf(__('Most comments settings for your site are provided by WordPress in the <a href="%s">Settings &gt; Discussion</a> page. The following settings customize options specific to the theme.', 'it-l10n-Builder-Cohen'), admin_url('options-discussion.php'));
                ?>
</p>
		<hr />
		
		<p><?php 
                _e('Displaying comments and the comment entry form can be enabled or disabled for each type of content by checking or unchecking the appropriate checkboxes below. When a content type has comments disabled, neither any comment counts, existing comments, the comment entry form, nor the "comments are closed" message will be shown.', 'it-l10n-Builder-Cohen');
                ?>
</p>
		<p><?php 
                _e('Comments can be disabled on a per-entry basis. If comments are not appearing, modify the specific entry (post, page, etc) that should have comments to ensure that the "Allow comments" checkbox under "Discussion" is checked.', 'it-l10n-Builder-Cohen');
                ?>
</p>
		<p><?php 
                _e('Which content types should display comment counts (in listings), comments, the comment form, and "comments are closed" messages?', 'it-l10n-Builder-Cohen');
                ?>
</p>
		<ul class="no-bullets">
			<?php 
                foreach ((array) $this->_comment_post_types as $post_type => $details) {
                    ?>
				<li>
					<label for="enable_comments_<?php 
                    echo $post_type;
                    ?>
"><?php 
                    $form->add_check_box("enable_comments_{$post_type}");
                    ?>
 <?php 
                    echo $details['name'];
                    ?>
</label>
					<?php 
                    ITUtility::add_tooltip($details['description']);
                    ?>
				</li>
			<?php 
                }
                ?>
		</ul>
		<br />
		
		<p><?php 
                _e('What should be displayed if comments have been disabled for a specific entry? This message will be shown in place of the comment entry form.', 'it-l10n-Builder-Cohen');
                ?>
</p>
		<ul class="no-bullets">
			<li><label for="comments_disabled_message_none"><?php 
                $form->add_radio('comments_disabled_message', array('value' => 'none', 'id' => 'comments_disabled_message_none'));
                ?>
 <?php 
                _e('Do not display any message (default)', 'it-l10n-Builder-Cohen');
                ?>
</label></li>
			<li><label for="comments_disabled_message_standard"><?php 
                $form->add_radio('comments_disabled_message', array('value' => 'standard', 'id' => 'comments_disabled_message_standard'));
                ?>
 <?php 
                _e('Display message provided by theme, default in Builder is "Comments are closed."', 'it-l10n-Builder-Cohen');
                ?>
</label></li>
			<li><label for="comments_disabled_message_custom"><?php 
                $form->add_radio('comments_disabled_message', array('value' => 'custom', 'id' => 'comments_disabled_message_custom'));
                ?>
 <?php 
                _e('Custom message: ', 'it-l10n-Builder-Cohen');
                ?>
</label> <?php 
                $form->add_text_box('comments_disabled_message_custom_message', array('style' => 'width:400px;'));
                ?>
</li>
		</ul>
	<?php 
            } else {
                ?>
		<p><?php 
                _e('It appears that comments are disabled on your site due to a plugin or other configuration. All post types are reporting that they do not support commenting.', 'it-l10n-Builder-Cohen');
                ?>
</p>
	<?php 
            }
        }
        function edit($form, $results = true)
        {
            if (isset($results['errors'])) {
                $this->_print_errors($results['errors']);
            }
            $this->_init_module_styles();
            if (method_exists($this, '_before_table_edit')) {
                $this->_before_table_edit($form, $results);
            }
            echo "<table class='valign-top'>\n";
            ?>
	<tr><td><label for="name"><?php 
            _e('Name', 'it-l10n-Builder-Cohen');
            ?>
</label></td>
		<td>
			<?php 
            $form->add_text_box('name');
            ?>
			<?php 
            ITUtility::add_tooltip(__('The module\'s name helps you identify specific widget locations. Descriptive, short names typically work best.', 'it-l10n-Builder-Cohen'));
            ?>
			<br /><br />
		</td>
	</tr>
<?php 
            if (method_exists($this, '_start_table_edit')) {
                $this->_start_table_edit($form, $results);
            }
            if (true === $this->_has_sidebars) {
                $sidebars = array('none' => __('No Sidebars', 'it-l10n-Builder-Cohen'), '1_left' => __('1 Left', 'it-l10n-Builder-Cohen'), '2_left' => __('2 Left', 'it-l10n-Builder-Cohen'), '1_right' => __('1 Right', 'it-l10n-Builder-Cohen'), '2_right' => __('2 Right', 'it-l10n-Builder-Cohen'), 'split' => __('Split (1 Left & 1 Right)', 'it-l10n-Builder-Cohen'));
                $default_widths = array('none' => array(), '1_left' => array('150' => __('Narrow (150px)', 'it-l10n-Builder-Cohen'), '180' => __('Standard (180px)', 'it-l10n-Builder-Cohen'), '200' => __('Wide (200px)', 'it-l10n-Builder-Cohen'), 'custom' => __('Custom...', 'it-l10n-Builder-Cohen')), '2_left' => array('150,150' => __('Narrow/Narrow (150px/150px)', 'it-l10n-Builder-Cohen'), '150,180' => __('Narrow/Standard (150px/180px)', 'it-l10n-Builder-Cohen'), '150,200' => __('Narrow/Wide (150px/200px)', 'it-l10n-Builder-Cohen'), '180,150' => __('Standard/Narrow (180px/150px)', 'it-l10n-Builder-Cohen'), '180,180' => __('Standard/Standard (180px/180px)', 'it-l10n-Builder-Cohen'), '180,200' => __('Standard/Wide (180px/200px)', 'it-l10n-Builder-Cohen'), '200,150' => __('Wide/Narrow (200px/150px)', 'it-l10n-Builder-Cohen'), '200,180' => __('Wide/Standard (200px/180px)', 'it-l10n-Builder-Cohen'), '200,200' => __('Wide/Wide (200px/200px)', 'it-l10n-Builder-Cohen'), 'custom' => __('Custom...', 'it-l10n-Builder-Cohen')));
                $default_widths['1_right'] = $default_widths['1_left'];
                $default_widths['2_right'] = $default_widths['2_left'];
                $default_widths['split'] = $default_widths['2_left'];
                if (isset($_REQUEST['sidebar']) && isset($default_widths[$_REQUEST['sidebar']])) {
                    $starting_sidebar_widths = $default_widths[$_REQUEST['sidebar']];
                } else {
                    $starting_sidebar_widths = null;
                }
                ?>
	<tr><td><label for="sidebar"><?php 
                _e('Sidebars', 'it-l10n-Builder-Cohen');
                ?>
</label></td>
		<td>
			<?php 
                $form->add_drop_down('sidebar', $sidebars);
                ?>
			<?php 
                ITUtility::add_tooltip(__('Sidebars can be added to this module so that you can have widgets to the left, right, or on both sides of the modules content.', 'it-l10n-Builder-Cohen'));
                ?>
			
			<?php 
                if ('navigation' == $this->_var) {
                    ?>
				<p><strong><?php 
                    _e('Note: The Sidebar feature is still experimental for this module.');
                    ?>
</strong></p>
			<?php 
                }
                ?>
		</td>
	</tr>
	<tr id="sidebar-widths-row">
		<td><?php 
                _e('Sidebar&nbsp;Widths', 'it-l10n-Builder-Cohen');
                ?>
</td>
		<td>
			<?php 
                $form->add_drop_down('sidebar_widths', null);
                ?>
			<?php 
                ITUtility::add_tooltip(__('You can make the widget areas wider or narrower by using these options. To get more control over the widths used, select "Custom..." to put in your own widths.', 'it-l10n-Builder-Cohen'));
                ?>
			
			<div id="sidebar-widths-custom" style="display:none;">
				<?php 
                $form->add_text_box('custom_sidebar_widths', array('size' => '10', 'maxlength' => '20'));
                ?>
<br />
				<?php 
                _e('Specify the width of each sidebar in pixels.', 'it-l10n-Builder-Cohen');
                ?>
<br />
				<?php 
                _e('For example, if you selected to have 2 Right sidebars and want to separate them into 170 pixel and 185 pixel widths, input <strong><code>170,185</code></strong> in the box above.', 'it-l10n-Builder-Cohen');
                ?>
			</div>
		</td>
	</tr>
<?php 
            }
            if (!empty($this->_module_styles)) {
                asort($this->_module_styles);
                $styles = array('' => 'Default');
                $styles = array_merge($styles, $this->_module_styles);
                ?>
	<tr>
		<td colspan="2">
			<br />
			<p>The active child theme (theme design) provides alternate styling options for this module. Use the following option to select an alternate style if desired.</p>
		</td>
	</tr>
	<tr><td><label for="sidebar"><?php 
                _e('Style', 'it-l10n-Builder-Cohen');
                ?>
</label></td>
		<td><?php 
                $form->add_drop_down('style', $styles);
                ?>
</td>
	</tr>
<?php 
            }
            if (method_exists($this, '_end_table_edit')) {
                $this->_end_table_edit($form, $results);
            }
            if (true === $this->_can_remove_wrappers) {
                ?>
	<tr><td><label for="remove_wrappers"><?php 
                _e('Remove&nbsp;Wrapper&nbsp;DIVs', 'it-l10n-Builder-Cohen');
                ?>
</label></td>
		<td>
			<?php 
                $form->add_drop_down('remove_wrappers', array('' => __('No', 'it-l10n-Builder-Cohen'), '1' => __('Yes', 'it-l10n-Builder-Cohen')));
                ITUtility::add_tooltip(__('Enabling this option is only recommended for advanced users as this can cause layout issues if not properly handled.', 'it-l10n-Builder-Cohen'));
                ?>
		</td>
	</tr>
<?php 
            }
            echo "</table>\n";
            if (method_exists($this, '_after_table_edit')) {
                $this->_after_table_edit($form, $results);
            }
            if (true === $this->_has_sidebars) {
                ?>
	<div id="sidebar-widths-container" style="display:none;">
		<?php 
                foreach ((array) $default_widths as $id => $options) {
                    ?>
			<div id="sidebar-widths-container-<?php 
                    echo $id;
                    ?>
">
				<?php 
                    $form->add_drop_down("sidebar-widths-{$id}", $options);
                    ?>
			</div>
		<?php 
                }
                ?>
	</div>
	
	<script type="text/javascript">
		/* <![CDATA[ */
		init_module_sidebar_editor();
		/* ]]> */
	</script>
<?php 
            }
            if (isset($_REQUEST['save'])) {
                $form->add_hidden('had_error', '1');
            }
        }