Пример #1
0
 public static function generate_style($style, $auto_width = TRUE)
 {
     $buffer = '';
     if ($style === NULL) {
         $style = array();
     }
     if (isset($style['auto_width'])) {
         $auto_width = $style['auto_width'];
     }
     if ($auto_width && !isset($style['width'])) {
         $style['width'] = '200px';
     }
     if (isset($style['width'])) {
         self::$last_width = intval($style['width']);
     } else {
         self::$last_width = 0;
     }
     foreach ($style as $var => $val) {
         if ($buffer != '') {
             $buffer .= ' ';
         }
         $buffer .= $var . ': ' . $val . ';';
     }
     if ($buffer != '') {
         return ' style="' . $buffer . '"';
     }
     return '';
 }
Пример #2
0
    function generate_index()
    {
        $this->generate_header();
        $url = $this->main_object->admin_url;
        $name = $this->main_object->plugin_name;
        $new_url = $url . '&action=new';
        echo '<h2 class="all_around_status">' . $name . '<a href="' . $new_url . '">Create new</a></h2> <span class="all_around_small_buton" id="all_around_update_notification" style="display: none;"></span>';
        echo $this->main_object->mvc->get_index_table();
        echo all_around_visual_elements::generate_button('all_around_new', 'Create new', 'blue', NULL, array('width' => '150px', 'float' => 'right'), TRUE, $new_url);
        if (!isset($this->main_object->settings_in_db['use_separated_jquery'])) {
            $this->main_object->settings_in_db['use_separated_jquery'] = 0;
        }
        $use_separated_jquery = $this->main_object->settings_in_db['use_separated_jquery'];
        $separated = all_around_visual_elements::generate_checkbox('Use separated jQuery only for this plugin in order to skip possible conflicts (activate this option only if slider fails to open)', 'use_separated_jquery', $use_separated_jquery, array('empty_wrapper' => 1), array('auto_width' => FALSE));
        $skip_head_section = $this->main_object->settings['skip_head_section'];
        $skipheadsection = all_around_visual_elements::generate_checkbox('Put CSS &amp; JS near HTML block, not in &lt;head&gt; section (this can help if your template or some other plugin screws up &lt;head&gt; section)', 'skip_head_section', $skip_head_section, array('empty_wrapper' => 1), array('auto_width' => FALSE));
        //$settings=print_r(, TRUE);
        //<div style="background-color: white;"><pre>$settings</pre></div>
        //echo '<span style="color: #E0E0E0;">prefix='.$this->wrapper->get_db_prefix().'<br />table='.$this->main_object->get_plugin_table_name().'</span><br />';
        echo <<<eof
\t\t<script>
\t\t(function(\$){
\t\t\tall_around_add_event('use_separated_jquery', function(name, value) {
\t\t\t\tall_around_send_ajax('all_around_set_settings_1val', 'var1=use_separated_jquery&val1='+value, function(response) {
\t\t\t\t\t\$('#all_around_save_status').fadeIn('slow', function(){
\t\t\t\t\t\t\$(this).fadeOut('slow');
\t\t\t\t\t});

\t\t\t\t});
\t\t\t});
\t\t\tall_around_add_event('skip_head_section', function(name, value) {
\t\t\t\tall_around_send_ajax('all_around_set_settings_1val', 'var1=skip_head_section&val1='+value, function(response) {
\t\t\t\t\t\$('#all_around_save_status').fadeIn('slow', function(){
\t\t\t\t\t\t\$(this).fadeOut('slow');
\t\t\t\t\t});

\t\t\t\t});
\t\t\t});
\t\t})(jQuery);
\t\t</script>
\t\t<br /><span style="padding: 2px 0 0 0; font-size: 12px; display: block; float: left; font-weight: bold; position: relative; color: #E0E0E0;">Troubleshooting?</span>&nbsp;&nbsp;&nbsp;<a class="all_around_small_buton" style="top: 3px; display: none;" id="all_around_save_status">Saved</a><br /><br />
\t\t{$separated}
\t\t{$skipheadsection}
\t\t<br /><br /><br />
\t\t<h2 class="all_around_status">Step by step:</h2>
<ol class="all_around_steps">
\t<li>
\t\t<h3>Click on "Create New" button</h3>
\t</li>
\t<li>
\t\t<h3>Setup your slider, save it, and come back here</h3>
\t</li>
\t<li>
\t\t<h3>Copy "shortcode" from the table above and paste it in your post or page.<br />(for adding slider into .php parts of template use it like this "&lt;?php echo do_shortcode('[all_around id="X"]'); ?&gt;" where X is id of your slider)</h3>
\t</li>
</ol>
eof;
        $this->close_header();
    }
Пример #3
0
 function generate_html_form_part($for, $id = 0, $closed = 0)
 {
     $html = '';
     $form = array();
     $current_item_title = '';
     $this->pre_generate_html_form_part($for, $id);
     if ($for == 'item' || $for == 'empty_item') {
         $form =& $this->model->loaded_items[$id];
         if (isset($form['title']['value'])) {
             $current_item_title = $form['title']['value'];
         }
     }
     if ($for == 'settings') {
         $form =& $this->model->loaded_settings;
     }
     // main task
     $html = $this->generate_html_fields($form);
     // finalizing
     if ($for == 'item') {
         $current_item_title .= '&nbsp;&nbsp;&nbsp;<a class="all_around_delete_subitem">[Delete]</a>&nbsp;&nbsp;&nbsp;<a class="all_around_duplicate_subitem">[Duplicate]</a>';
         if (isset($form['group']['value']) && intval($form['group']['value']) > -1) {
             $current_item_title .= '&nbsp;&nbsp;&nbsp;<a class="all_around_group_move_out_subitem" style="display: none;">[Move out from group]</a><a class="all_around_group_move_in_subitem" style="display: none;">[Move in group]</a>';
         } else {
             $current_item_title .= '&nbsp;&nbsp;&nbsp;<a class="all_around_group_move_out_subitem" style="display: none;">[Move out from group]</a><a class="all_around_group_move_in_subitem" style="display: none;">[Move in group]</a>';
         }
         $open = FALSE;
         $display = '';
         $additional_classes = '';
         if ($this->main_object->ajax_call == 1) {
             if ($closed == 0) {
                 $open = TRUE;
                 $display = ' display: none;';
                 $additional_classes = 'all_around_new_subitem';
             }
         }
         $html .= $this->generate_backend_javascript(1);
         $this->javascript_events = array();
         $html = all_around_visual_elements::generate_collapsible($current_item_title, $html, NULL, $open, all_around_visual_elements::$style_collapsible_content_style . $display, $additional_classes);
     }
     if ($for == 'settings') {
         $style_collapsible = array('width' => '280px');
         $html = all_around_visual_elements::generate_collapsible('Settings', $html, $style_collapsible, TRUE, all_around_visual_elements::$style_settings_collapsible_content_style);
     }
     return $html;
 }
 function backend_init()
 {
     $this->admin_url = $this->wrapper->get_admin_url();
     $this->load_additional_scripts();
     $this->settings['use_separated_jquery'] = 0;
     require_once $this->path . '/includes/visual_elements.php';
     all_around_visual_elements::init($this, $this->wrapper, $this->backend_style);
     require_once $this->path . '/includes/viewer.php';
     $this->check_for_upgrade();
     $this->init_google_fonts();
 }
Пример #5
0
 function generate_html_form_part($for, $id = 0)
 {
     $html = '';
     $form = array();
     $current_item_title = '';
     $this->pre_generate_html_form_part($for, $id);
     if ($for == 'item' || $for == 'empty_item') {
         $form = $this->model->loaded_items[$id];
         foreach ($form as $aid => $arr) {
             if ($arr['base_name'] == 'title') {
                 $current_item_title = $arr['value'];
             }
         }
     }
     if ($for == 'settings') {
         $form = $this->model->loaded_settings;
     }
     // main task
     $html = $this->generate_html_fields($form);
     // finalizing
     if ($for == 'item') {
         $current_item_title .= '&nbsp;&nbsp;&nbsp;<a class="all_around_delete_subitem">[Delete]</a>';
         $open = FALSE;
         if ($this->main_object->ajax_call == 1) {
             $open = TRUE;
             $html .= $this->generate_backend_javascript(1);
             $this->javascript_events = array();
         }
         $html = all_around_visual_elements::generate_collapsible($current_item_title, $html, NULL, $open, 'padding-left: 0px; padding-right: 15px;');
     }
     if ($for == 'settings') {
         $style_collapsible = array('width' => '280px');
         $html = all_around_visual_elements::generate_collapsible('Settings', $html, $style_collapsible, TRUE);
     }
     return $html;
 }