예제 #1
0
 public static function add_enqueues()
 {
     $plugin_url = ITUtility::get_url_from_file(dirname(__FILE__));
     wp_enqueue_style('it-dialog-outside-dialog-style', "{$plugin_url}/css/it-dialog-outside-dialog.css");
     wp_enqueue_script('it-dialog-outside-dialog-script', "{$plugin_url}/js/it-dialog-outside-dialog.js", array('jquery'), false, true);
     $vars = array('no_iframes_message' => __('This feature requires inline frames. You have iframes disabled or your browser does not support them.', 'it-l10n-Builder-Paige'), 'loading_image' => ITDialog::get_loading_image_url(), 'close_message' => __('Close', 'it-l10n-Builder-Paige'), 'close_image' => "{$plugin_url}/images/it-dialog-close.png");
     wp_localize_script('it-dialog-outside-dialog-script', 'it_dialog_vars', $vars);
 }
예제 #2
0
파일: editor.php 프로젝트: jimrucinski/Vine
        function _modify_views()
        {
            $available_views = apply_filters('builder_get_available_views', array());
            $views = array();
            foreach (array_keys((array) $this->_options['views']) as $view_id) {
                $view = $this->_get_view_data($view_id);
                if (empty($view)) {
                    continue;
                }
                $views[$view_id] = $view;
            }
            $views = ITUtility::sort_array($views, 'name');
            if (builder_theme_supports('builder-extensions')) {
                $extensions = apply_filters('builder_get_extensions_with_names', array());
            }
            $layout_rules = array('//INHERIT//' => __('Use this View\'s Active Layout', 'it-l10n-Builder-Paige'), '' => __('Use the site\'s Default Layout', 'it-l10n-Builder-Paige'));
            $extension_rules = array('' => __('Use the Active Extension', 'it-l10n-Builder-Paige'), '//DISABLE_EXTENSION//' => __('Disable the Active Extension', 'it-l10n-Builder-Paige'));
            $form = new ITForm();
            $add_link = ITDialog::get_link("{$this->_self_link}&modify_view_screen=1", "modal=true");
            ?>
	<div class="wrap">
		<?php 
            $form->start_form();
            ?>
			<?php 
            ITUtility::screen_icon();
            ?>
			<?php 
            $this->_print_tabs();
            ?>
			
			<p><?php 
            _e('Views allow you to apply specific Layouts to specific parts of your site. For details, click the "Help" button at the top-right.', 'it-l10n-Builder-Paige');
            ?>
</p>
			
			<div id="no-views-container">
				<br />
				<p><?php 
            _e('Your site currently does not have any Views configured. Please click the "Add View" button below to apply a specific Layout to a site View.', 'it-l10n-Builder-Paige');
            ?>
</p>
				<a href="<?php 
            echo $add_link;
            ?>
" class="it-dialog button-secondary link-secondary"><?php 
            _e('Add View', 'it-l10n-Builder-Paige');
            ?>
</a>
			</div>
			
			<div id="views-container">
				<div class="tablenav">
					<div class="alignleft actions">
						<a href="<?php 
            echo $add_link;
            ?>
" class="it-dialog button-secondary link-secondary"><?php 
            _e('Add View', 'it-l10n-Builder-Paige');
            ?>
</a>
					</div>
					
					<br class="clear" />
				</div>
				
				<br class="clear" />
				
				<table id="views-table" class="widefat fixed">
					<thead>
						<tr class="thead">
							<th><?php 
            _e('Site View', 'it-l10n-Builder-Paige');
            ?>
</th>
							<th><?php 
            _e('Site View Description', 'it-l10n-Builder-Paige');
            ?>
</th>
							<th title=""><?php 
            _e('Layout', 'it-l10n-Builder-Paige');
            ?>
</th>
							<?php 
            if (builder_theme_supports('builder-extensions')) {
                ?>
								<th><?php 
                _e('Extension', 'it-l10n-Builder-Paige');
                ?>
</th>
							<?php 
            }
            ?>
						</tr>
					</thead>
					<tfoot>
						<tr class="thead">
							<th><?php 
            _e('Site View', 'it-l10n-Builder-Paige');
            ?>
</th>
							<th><?php 
            _e('Site View Description', 'it-l10n-Builder-Paige');
            ?>
</th>
							<th title=""><?php 
            _e('Layout', 'it-l10n-Builder-Paige');
            ?>
</th>
							<?php 
            if (builder_theme_supports('builder-extensions')) {
                ?>
								<th><?php 
                _e('Extension', 'it-l10n-Builder-Paige');
                ?>
</th>
							<?php 
            }
            ?>
						</tr>
					</tfoot>
					<tbody>
						<?php 
            $class = ' alternate';
            ?>
						<?php 
            foreach ((array) $views as $view_id => $view) {
                ?>
							<tr class="view-entry" id="view-<?php 
                echo $this->_parse_view_id($view_id);
                ?>
"<?php 
                echo $class;
                ?>
>
								<td>
									<strong><a class="view-name it-dialog" href="<?php 
                echo ITDialog::get_link("{$this->_self_link}&modify_view_screen=1&original_view={$view_id}", "modal=true&max-width=400");
                ?>
" title="<?php 
                _e('Modify View', 'it-l10n-Builder-Paige');
                ?>
"><?php 
                echo $view['name'];
                ?>
</a></strong><br />
									<div class="row-actions">
										<span class="edit"><a href="<?php 
                echo ITDialog::get_link("{$this->_self_link}&modify_view_screen=1&original_view={$view_id}", "modal=true&max-width=400");
                ?>
" class="it-dialog" title="Modify View"><?php 
                _e('Edit', 'it-l10n-Builder-Paige');
                ?>
</a> | </span>
										<span class="delete"><a href="<?php 
                echo ITDialog::get_link("{$this->_self_link}&delete_view_screen={$view_id}");
                ?>
" class="it-dialog" title="Remove View Customization"><?php 
                _e('Remove', 'it-l10n-Builder-Paige');
                ?>
</a></span>
									</div>
								</td>
								<td><?php 
                echo $view['description'];
                ?>
</td>
								<td class="view-layout">
									<?php 
                if (isset($this->_options['layouts'][$view['layout']])) {
                    ?>
										<a href="<?php 
                    echo $this->_tabless_self_link;
                    ?>
&editor_tab=layouts&layout=<?php 
                    echo $view['layout'];
                    ?>
" title="<?php 
                    _e('Modify Layout', 'it-l10n-Builder-Paige');
                    ?>
">
											<?php 
                    echo $this->_options['layouts'][$view['layout']]['description'];
                    ?>
										</a>
									<?php 
                } elseif (isset($layout_rules[$view['layout']])) {
                    ?>
										<?php 
                    echo $layout_rules[$view['layout']];
                    ?>
									<?php 
                }
                ?>
								</td>
								<?php 
                if (builder_theme_supports('builder-extensions')) {
                    ?>
									<td>
										<?php 
                    if (isset($view['extension']) && isset($extensions[$view['extension']])) {
                        ?>
											<?php 
                        echo $extensions[$view['extension']];
                        ?>
										<?php 
                    } elseif (isset($extension_rules[$view['extension']])) {
                        ?>
											<?php 
                        echo $extension_rules[$view['extension']];
                        ?>
										<?php 
                    }
                    ?>
									</td>
								<?php 
                }
                ?>
							</tr>
							<?php 
                $class = $class == '' ? ' alternate' : '';
                ?>
						<?php 
            }
            ?>
					</tbody>
				</table>
				
				<br class="clear" />
				
				<div class="tablenav">
					<div class="alignleft actions">
						<a href="<?php 
            echo $add_link;
            ?>
" class="button-secondary link-secondary it-dialog"><?php 
            _e('Add View', 'it-l10n-Builder-Paige');
            ?>
</a>
					</div>
					
					<br class="clear" />
				</div>
			</div>
			
			<div id="new-view-container" style="display:none;">
				<table>
					<tr class="view-entry" id="view-%parsed_view_id%" style="display:none;">
						<td>
							<strong><a class="view-name it-dialog" href="<?php 
            echo ITDialog::get_link("{$this->_self_link}&modify_view_screen=1&original_view=%view_id%", "modal=true");
            ?>
" title="<?php 
            _e('Modify View', 'it-l10n-Builder-Paige');
            ?>
">%view_name%</a></strong><br />
							<div class="row-actions">
								<span class="edit"><a href="<?php 
            echo ITDialog::get_link("{$this->_self_link}&modify_view_screen=1&original_view=%view_id%", "modal=true");
            ?>
" class="it-dialog" title="Modify View"><?php 
            _e('Edit', 'it-l10n-Builder-Paige');
            ?>
</a> | </span>
								<span class="delete"><a href="<?php 
            echo ITDialog::get_link("{$this->_self_link}&delete_view_screen=%view_id%");
            ?>
" class="it-dialog" title="Remove View Customization"><?php 
            _e('Remove', 'it-l10n-Builder-Paige');
            ?>
</a></span>
							</div>
						</td>
						<td>%view_description%</td>
						<td class="" title="">
							<a href="<?php 
            echo $this->_self_link;
            ?>
&layout=%layout%" title="<?php 
            _e('Modify Layout', 'it-l10n-Builder-Paige');
            ?>
">
								%layout_description%
							</a>
						</td>
						<?php 
            if (builder_theme_supports('builder-extensions')) {
                ?>
							<td>%extension%</td>
						<?php 
            }
            ?>
					</tr>
				</table>
			</div>
			
			<div id="js-vars" style="display:none;">
				<?php 
            foreach ((array) $available_views as $view => $data) {
                ?>
					<div id="view-name-<?php 
                echo $this->_parse_view_id($view);
                ?>
"><?php 
                echo $data['name'];
                ?>
</div>
					<div id="view-description-<?php 
                echo $this->_parse_view_id($view);
                ?>
"><?php 
                echo $data['description'];
                ?>
</div>
				<?php 
            }
            ?>
				
				<?php 
            foreach ((array) $this->_options['layouts'] as $layout => $data) {
                ?>
					<div id="layout-description-<?php 
                echo $layout;
                ?>
"><?php 
                echo $data['description'];
                ?>
</div>
					<div id="layout-link-href-<?php 
                echo $layout;
                ?>
"><?php 
                echo $this->_self_link;
                ?>
&layout=<?php 
                echo $layout;
                ?>
</div>
				<?php 
            }
            ?>
			</div>
		<?php 
            $form->end_form();
            ?>
	</div>
	
	<script type="text/javascript">
		init_modify_views();
	</script>
<?php 
        }
예제 #3
0
        function meta_box_analytics($form)
        {
            ?>
	<p><?php 
            printf(__('<a href="%1$s">Web analytics software</a> tracks what content visitors to your site are interested in and how they get to your site. Builder offers an easy way to integrate analytics tracking for <a href="%2$s">Google Analytics</a>, <a href="%3$s">Woopra</a>, and <a href="%4$s">GoSquared</a>. Use the settings below to easily add the desired tracking code to your site.', 'it-l10n-Builder-Cohen'), 'http://en.wikipedia.org/wiki/Web_analytics', 'http://www.google.com/analytics/', 'http://www.woopra.com/', 'https://www.gosquared.com/join/ithemes?ref=11928');
            ?>
</p>
	
	<p><?php 
            _e('Before activating Builder\'s built-in support for any of these services, first disable any plugins offering the same feature. Failure to do so can result in each visitor being counted multiple times, which will badly skew your data.', 'it-l10n-Builder-Cohen');
            ?>
</p>
	
	<p><?php 
            _e('Beyond web analytics, some web tools or applications require adding JavaScript code either inside the head tag or in the site\'s footer. Use the text area inputs below to manually add code where it is needed.', 'it-l10n-Builder-Cohen');
            ?>
</p>
	
	<hr />
	
	
	<p><label><?php 
            $form->add_check_box('google_analytics_enable', array('class' => 'show-hide-toggle'));
            ?>
 <?php 
            _e('Enable Google Analytics', 'it-l10n-Builder-Cohen');
            ?>
</label></li>
	
	<div class="google_analytics_enable-option">
		<p><?php 
            printf(__('Your site is uniquely identified in Google Analytics by an Account ID. An example Account ID is UA-12345-6. For help on finding your Account ID, watch <a href="%s" class="it-dialog">this video</a>.', 'it-l10n-Builder-Cohen'), ITDialog::get_link("{$this->_parent->_self_link}&show_video=LhZ-Zwy06Ik&video_width=848&video_height=504"));
            ?>
</p>
		<p><label><?php 
            _e('Google Analytics Account ID', 'it-l10n-Builder-Cohen');
            ?>
 <?php 
            $form->add_text_box('google_analytics_account_id');
            ?>
 <?php 
            _e('(required)', 'it-l10n-Builder-Cohen');
            ?>
</label></p>
		
		<br />
	</div>
	
	
	<p><label><?php 
            $form->add_check_box('woopra_enable', array('class' => 'show-hide-toggle'));
            ?>
 <?php 
            _e('Enable Woopra', 'it-l10n-Builder-Cohen');
            ?>
</label></p>
	
	<div class="woopra_enable-option">
		<p><?php 
            printf(__('By default (when the Woopra Domain input below is empty), Woopra will use the domain of the "Site address (URL)" configured in <a href="%s">Settings &gt; General</a>. This can be changed by supplying a new domain below.', 'it-l10n-Builder-Cohen'), admin_url('options-general.php'));
            ?>
</p>
		<p><label><?php 
            _e('Woopra Domain', 'it-l10n-Builder-Cohen');
            ?>
 <?php 
            $form->add_text_box('woopra_domain');
            ?>
 <?php 
            _e('(optional)', 'it-l10n-Builder-Cohen');
            ?>
</label></p>
		
		<br />
	</div>
	
	
	<p><label><?php 
            $form->add_check_box('gosquared_enable', array('class' => 'show-hide-toggle'));
            ?>
 <?php 
            _e('Enable GoSquared', 'it-l10n-Builder-Cohen');
            ?>
</label></p>
	
	<div class="gosquared_enable-option">
		<p><?php 
            printf(__('GoSquared identifies your site using a Site Token. The Site Token for your site can be found on the Tracking Code page in your <a href="%1$s">GoSquared Settings</a>. You can find more information about the Site Token and how to find it on the <a href="%2$s">GoSquared FAQ</a>.', 'it-l10n-Builder-Cohen'), 'https://www.gosquared.com/settings/', 'http://www.gosquared.com/support/wiki/faqs#faq-site-token');
            ?>
</p>
		<p><label><?php 
            _e('Site Token', 'it-l10n-Builder-Cohen');
            ?>
 <?php 
            $form->add_text_box('gosquared_site_token');
            ?>
 <?php 
            _e('(required)', 'it-l10n-Builder-Cohen');
            ?>
</label></p>
	</div>
	
	
	<br />
	
	<p><?php 
            _e('List any JavaScript or other code to be manually inserted inside the site\'s <code>&lt;head&gt;</code> tag in the input below.', 'it-l10n-Builder-Cohen');
            ?>
</p>
	<p><?php 
            $form->add_text_area('javascript_code_header', array('style' => 'width:600px;height:150px;'));
            ?>
</p>
	<br />
	
	<p><?php 
            _e('List any JavaScript or other code to be manually inserted in the site\'s footer just above the <code>&lt;/body&gt;</code> tag in the input below.', 'it-l10n-Builder-Cohen');
            ?>
</p>
	<p><?php 
            $form->add_text_area('javascript_code_footer', array('style' => 'width:600px;height:150px;'));
            ?>
</p>
<?php 
        }
예제 #4
0
 function render_clean()
 {
     $this->add_admin_scripts();
     $this->add_admin_styles();
     if ('dialog' == $_REQUEST['render_clean']) {
         ITDialog::render(array(&$this, 'index'));
     } else {
         require_once dirname(__FILE__) . '/it-thickbox.php';
         ITThickbox::render_thickbox(array(&$this, 'index'));
     }
     exit;
 }