Page 15 of 15 FirstFirst ... 5131415
Results 141 to 149 of 149
  1. #141
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: CSS3 Buttons [support thread]

    You mean this file: /includes/functions/html_output.php?

    I posted my changes above (post #135). I'm guessing you're right. If you take a look at #138, I think I *may* have isolated the problem.

    The code I posted in #135 was taken directly from the installation instructions. Here is the section of code as it was originally (before replacing with the mod supplied code):
    Code:
    /**
     * generate CSS buttons in the current language
     * concept from contributions by Seb Rouleau and paulm, subsequently adapted to Zen Cart
     * note: any hard-coded buttons will not be able to use this function
    **/
      function zenCssButton($image = '', $text, $type, $sec_class = '', $parameters = '') {
       global $css_button_text, $css_button_opts, $template, $current_page_base, $language;
    
       $button_name = basename($image, '.gif');
    
        // if no secondary class is set use the image name for the sec_class
        if (empty($sec_class)) $sec_class = $button_name;
        if(!empty($sec_class)) $sec_class = ' ' . $sec_class;
        if(!empty($parameters))$parameters = ' ' . $parameters;
        $mouse_out_class  = 'cssButton ' . (($type == 'submit') ? 'submit_button button ' : 'normal_button button ') . $sec_class;
        $mouse_over_class = 'cssButtonHover ' . (($type == 'button') ? 'normal_button button ' : '') . $sec_class . $sec_class . 'Hover';
        // javascript to set different classes on mouseover and mouseout: enables hover effect on the buttons
        // (pure css hovers on non link elements do work work in every browser)
        $css_button_js =  'onmouseover="this.className=\''. $mouse_over_class . '\'" onmouseout="this.className=\'' . $mouse_out_class . '\'"';
    
        if (CSS_BUTTON_POPUPS_IS_ARRAY == 'true') {
          $popuptext = (!empty($css_button_text[$button_name])) ? $css_button_text[$button_name] : ($button_name . CSSBUTTONS_CATALOG_POPUPS_SHOW_BUTTON_NAMES_TEXT);
          $tooltip = ' title="' . $popuptext . '"';
        } else {
          $tooltip = '';
        }
        $css_button = '';
    
        if ($type == 'submit'){
          // form input button
          if ($parameters != '') {
            // If the input parameters include a "name" attribute, need to emulate an <input type="image" /> return value by adding a _x to the name parameter (creds to paulm)
            if (preg_match('/name="([a-zA-Z0-9\-_]+)"/', $parameters, $matches)) {
              $parameters = str_replace('name="' . $matches[1], 'name="' . $matches[1] . '_x', $parameters);
            }
            // If the input parameters include a "value" attribute, remove it since that attribute will be set to the input text string.
            if (preg_match('/(value="[a-zA-Z0=9\-_]+")/', $parameters, $matches)) {
              $parameters = str_replace($matches[1], '', $parameters);
            }
          }
    
          $css_button = '<input class="' . $mouse_out_class . '" ' . $css_button_js . ' type="submit" value="' . $text . '"' . $tooltip . $parameters . ' />';
        }
    
        if ($type=='button'){
          // link button
          $css_button = '<span class="' . $mouse_out_class . '" ' . $css_button_js . $tooltip . $parameters . '>&nbsp;' . $text . '&nbsp;</span>';
        }
        return $css_button;
      }
    
    
    /*
     *  Output a separator either through whitespace, or with an image
     */
      function zen_draw_separator($image = 'true', $width = '100%', $height = '1') {
    
        // set default to use from template - zen_image will translate if not found in current template
        if ($image == 'true') {
          $image = DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_BLACK_SEPARATOR;
        } else {
          if (!strstr($image, DIR_WS_TEMPLATE_IMAGES)) {
            $image = DIR_WS_TEMPLATE_IMAGES . $image;
          }
        }
        return zen_image($image, '', $width, $height);
      }
    
    /*
     *  Output a form
     */
      function zen_draw_form($name, $action, $method = 'post', $parameters = '') {
        $form = '<form name="' . zen_output_string($name) . '" action="' . zen_output_string($action) . '" method="' . zen_output_string($method) . '"';
    
        if (zen_not_null($parameters)) $form .= ' ' . $parameters;
    
        $form .= '>';
        if (strtolower($method) == 'post') $form .= '<input type="hidden" name="securityToken" value="' . $_SESSION['securityToken'] . '" />';
        return $form;
      }
    
    /*
     *  Output a form input field
     */
      function zen_draw_input_field($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true) {
        $field = '<input type="' . zen_output_string($type) . '" name="' . zen_sanitize_string(zen_output_string($name)) . '"';
        if ( (isset($GLOBALS[$name]) && is_string($GLOBALS[$name])) && ($reinsert_value == true) ) {
          $field .= ' value="' . zen_output_string(stripslashes($GLOBALS[$name])) . '"';
        } elseif (zen_not_null($value)) {
          $field .= ' value="' . zen_output_string($value) . '"';
        }
    
        if (zen_not_null($parameters)) $field .= ' ' . $parameters;
    
        $field .= ' />';
    
        return $field;
      }
    
    /*
     *  Output a form password field
     */
      function zen_draw_password_field($name, $value = '', $parameters = 'maxlength="40"') {
        return zen_draw_input_field($name, $value, $parameters, 'password', false);
      }
    
    /*
     *  Output a selection field - alias function for zen_draw_checkbox_field() and zen_draw_radio_field()
     */
      function zen_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '') {
        $selection = '<input type="' . zen_output_string($type) . '" name="' . zen_output_string($name) . '"';
    
        if (zen_not_null($value)) $selection .= ' value="' . zen_output_string($value) . '"';
    
        if ( ($checked == true) || ( isset($GLOBALS[$name]) && is_string($GLOBALS[$name]) && ( ($GLOBALS[$name] == 'on') || (isset($value) && (stripslashes($GLOBALS[$name]) == $value)) ) ) ) {
          $selection .= ' checked="checked"';
        }
    
        if (zen_not_null($parameters)) $selection .= ' ' . $parameters;
    
        $selection .= ' />';
    
        return $selection;
      }
    
    /*
     *  Output a form checkbox field
     */
      function zen_draw_checkbox_field($name, $value = '', $checked = false, $parameters = '') {
        return zen_draw_selection_field($name, 'checkbox', $value, $checked, $parameters);
      }
    
    /*
     * Output a form radio field
     */
      function zen_draw_radio_field($name, $value = '', $checked = false, $parameters = '') {
        return zen_draw_selection_field($name, 'radio', $value, $checked, $parameters);
      }
    
    /*
     *  Output a form textarea field
     */
      function zen_draw_textarea_field($name, $width, $height, $text = '~*~*#', $parameters = '', $reinsert_value = true) {
        $field = '<textarea name="' . zen_output_string($name) . '" cols="' . zen_output_string($width) . '" rows="' . zen_output_string($height) . '"';
    
        if (zen_not_null($parameters)) $field .= ' ' . $parameters;
    
        $field .= '>';
    
        if ($text == '~*~*#' && (isset($GLOBALS[$name]) && is_string($GLOBALS[$name])) && ($reinsert_value == true) ) {
          $field .= stripslashes($GLOBALS[$name]);
        } elseif ($text != '~*~*#' && zen_not_null($text)) {
          $field .= $text;
        }
    
        $field .= '</textarea>';
    
        return $field;
      }
    
    /*
     *  Output a form hidden field
     */
      function zen_draw_hidden_field($name, $value = '~*~*#', $parameters = '') {
        $field = '<input type="hidden" name="' . zen_sanitize_string(zen_output_string($name)) . '"';
    
        if (zen_not_null($value) && $value != '~*~*#') {
          $field .= ' value="' . zen_output_string($value) . '"';
        } elseif (isset($GLOBALS[$name]) && is_string($GLOBALS[$name])) {
          $field .= ' value="' . zen_output_string(stripslashes($GLOBALS[$name])) . '"';
        }
    
        if (zen_not_null($parameters)) $field .= ' ' . $parameters;
    
        $field .= ' />';
    
        return $field;
      }
    
    /*
     * Output a form file-field
     */
      function zen_draw_file_field($name, $required = false) {
        $field = zen_draw_input_field($name, '', ' size="50" ', 'file');
    
        return $field;
      }
    
    
    /*
     *  Hide form elements while including session id info
     *  IMPORTANT: This should be used in every FORM that has an OnSubmit() function tied to it, to prevent unexpected logouts
     */
      function zen_hide_session_id() {
        global $session_started;
    
        if ( ($session_started == true) && defined('SID') && zen_not_null(SID) ) {
          return zen_draw_hidden_field(zen_session_name(), zen_session_id());
        }
      }
    
    /*
     *  Output a form pull down menu
     *  Pulls values from a passed array, with the indicated option pre-selected
     */
      function zen_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
        $field = '<select';
    
        if (!strstr($parameters, 'id=')) $field .= ' id="select-'.zen_output_string($name).'"';
    
        $field .= ' name="' . zen_output_string($name) . '"';
    
        if (zen_not_null($parameters)) $field .= ' ' . $parameters;
    
        $field .= '>' . "\n";
    
        if (empty($default) && isset($GLOBALS[$name]) && is_string($GLOBALS[$name]) ) $default = stripslashes($GLOBALS[$name]);
    
        for ($i=0, $n=sizeof($values); $i<$n; $i++) {
          $field .= '  <option value="' . zen_output_string($values[$i]['id']) . '"';
          if ($default == $values[$i]['id']) {
            $field .= ' selected="selected"';
          }
    
          $field .= '>' . zen_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => ''', '<' => '&lt;', '>' => '&gt;')) . '</option>' . "\n";
        }
        $field .= '</select>' . "\n";
    
        if ($required == true) $field .= TEXT_FIELD_REQUIRED;
    
        return $field;
      }
    
    /*
     * Creates a pull-down list of countries
     */
      function zen_get_country_list($name, $selected = '', $parameters = '') {
        $countriesAtTopOfList = array();
        $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
        $countries = zen_get_countries();
    
        // Set some default entries at top of list:
        if (STORE_COUNTRY != SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY) $countriesAtTopOfList[] = SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY;
        $countriesAtTopOfList[] = STORE_COUNTRY;
        // IF YOU WANT TO ADD MORE DEFAULTS TO THE TOP OF THIS LIST, SIMPLY ENTER THEIR NUMBERS HERE.
        // Duplicate more lines as needed
        // Example: Canada is 108, so use 108 as shown:
        //$countriesAtTopOfList[] = 108;
    
        //process array of top-of-list entries:
        foreach ($countriesAtTopOfList as $key=>$val) {
          $countries_array[] = array('id' => $val, 'text' => zen_get_country_name($val));
        }
        // now add anything not in the defaults list:
        for ($i=0, $n=sizeof($countries); $i<$n; $i++) {
          $alreadyInList = FALSE;
          foreach($countriesAtTopOfList as $key=>$val) {
            if ($countries[$i]['countries_id'] == $val)
            {
              // If you don't want to exclude entries already at the top of the list, comment out this next line:
              $alreadyInList = TRUE;
              continue;
            }
          }
          if (!$alreadyInList) $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
        }
    
        return zen_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
      }
    /*
     * Assesses suitability for additional parameters such as rel=nofollow etc
     */
      function zen_href_params($page = '', $parameters = '') {
        global $current_page_base;
        $addparms = '';
        // if nofollow has already been set, ignore this function
        if (stristr($parameters, 'nofollow')) return $parameters;
        // if list of skippable pages has been set in meta_tags.php lang file (is by default), use that to add rel=nofollow params
        if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($page, explode(",", constant('ROBOTS_PAGES_TO_SKIP')))
            || $current_page_base=='down_for_maintenance') $addparms = 'rel="nofollow"';
        return ($parameters == '' ? $addparms : $parameters . ' ' . $addparms);
      }
    ////
    // output label for input fields
      function zen_draw_label($text, $for, $parameters = ''){
        $label = '<label for="' . $for . '" ' . $parameters . '>' . $text . '</label>';
        return $label;
      }

  2. #142
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,879
    Plugin Contributions
    96

    Default Re: CSS3 Buttons [support thread]

    Ah, I see it now. In the code you posted, there are some stray characters that are giving you the problem:
    Code:
    /**
     * generate CSS buttons in the current language
     * concept from contributions by Seb Rouleau and paulm, subsequently adapted to Zen Cart
     * note: any hard-coded buttons will not be able to use this function
    **/
      function zenCssButton($image = '', $text, $type, $sec_class = '', $parameters = '') {
       global $css_button_text, $css_button_opts, $template, $current_page_base, $language;
    
       $button_name = basename($image, '.gif');
       
    //-bof-20141016-lat9-css3_buttons-Add font-awesome glyph support  *** 1 of 3 ***
       global $cssButtonGlyphs;  //-Defined in /includes/extra_datafiles/css_button_glyphs.php
       $button_glyph = (isset ($cssButtonGlyphs) && is_array ($cssButtonGlyphs) && isset ($cssButtonGlyphs[$button_name])) ? ($cssButtonGlyphs[$button_name] . '####') : '';
       
    //-eof-20141016-lat9-css3_buttons-Add font-awesome glyph support  *** 1 of 3 ***
    
        // if no secondary class is set use the image name for the sec_class
        if (empty($sec_class)) $sec_class = $button_name;
        if(!empty($sec_class)) $sec_class = ' ' . $sec_class;
        if(!empty($parameters))$parameters = ' ' . $parameters;
        $mouse_out_class  = 'cssButton ' . (($type == 'submit') ? 'submit_button button ' : 'normal_button button ') . $sec_class;
        $mouse_over_class = 'cssButtonHover ' . (($type == 'button') ? 'normal_button button ' : '') . $sec_class . $sec_class . 'Hover';
        // javascript to set different classes on mouseover and mouseout: enables hover effect on the buttons
        // (pure css hovers on non link elements do work work in every browser)
        $css_button_js =  'onmouseover="this.className=\''. $mouse_over_class . '\'" onmouseout="this.className=\'' . $mouse_out_class . '\'"';
    
        if (CSS_BUTTON_POPUPS_IS_ARRAY == 'true') {
          $popuptext = (!empty($css_button_text[$button_name])) ? $css_button_text[$button_name] : ($button_name . CSSBUTTONS_CATALOG_POPUPS_SHOW_BUTTON_NAMES_TEXT);
          $tooltip = ' title="' . $popuptext . '"';
        } else {
          $tooltip = '';
        }
        $css_button = '';
    
        if ($type == 'submit'){
          // form input button
          if ($parameters != '') {
            // If the input parameters include a "name" attribute, need to emulate an <input type="image" /> return value by adding a _x to the name parameter (creds to paulm)
            if (preg_match('/name="([a-zA-Z0-9\-_]+)"/', $parameters, $matches)) {
              $parameters = str_replace('name="' . $matches[1], 'name="' . $matches[1] . '_x', $parameters);
            }
            // If the input parameters include a "value" attribute, remove it since that attribute will be set to the input text string.
            if (preg_match('/(value="[a-zA-Z0=9\-_]+")/', $parameters, $matches)) {
              $parameters = str_replace($matches[1], '', $parameters);
            }
          }
    //-bof-20141016-lat9-css3_buttons-Add font-awesome glyphs  *** 2 of 3 ***
          if (CSS3_BUTTONS_SUBMIT_TYPE == 'button') {
            $css_button = '<button class="' . $mouse_out_class . '" ' . $css_button_js . ' type="submit" value="' . $text . '"' . $tooltip . $parameters . '>' . $button_glyph . $text . '</button>';
            
          } else {
            $css_button = '<input class="' . $mouse_out_class . '" ' . $css_button_js . ' type="submit" value="' . $text . '"' . $tooltip . $parameters . ' />';
            
          }
    //-eof-20141016-lat9-css3_buttons-Add font-awesome glyphs  *** 2 of 3 ***
        }
    
        if ($type=='button'){
          // link button
          $css_button = '<span class="' . $mouse_out_class . '" ' . $css_button_js . $tooltip . $parameters . '>##' . $button_glyph . $text . '##</span>';  //-20141016-lat9-css3_buttons-Add font-awesome glyphs *** 3 of 3 ***
        }
        return $css_button;
      }
    If you remove those, you should be better!

  3. #143
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: CSS3 Buttons [support thread]

    Sorry, forgot to mention... I already replaced those with "&nbsp;".

    I just went back and deleted those anyway. Same problem!

    Good catch though.

    What did you think about the *** 3 of 3 *** bit as a possible issue? The first two were so cleanly noted, seamed like maybe something got clipped on the 3rd?

  4. #144
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,879
    Plugin Contributions
    96

    Default Re: CSS3 Buttons [support thread]

    Quote Originally Posted by Feznizzle View Post
    Sorry, forgot to mention... I already replaced those with "&nbsp;".

    I just went back and deleted those anyway. Same problem!

    Good catch though.

    What did you think about the *** 3 of 3 *** bit as a possible issue? The first two were so cleanly noted, seamed like maybe something got clipped on the 3rd?
    Nope, it's just 'shorthand' notation. What editor are you using? Like I said previously, it looks like you're saving that file as ASCII when your site is using UTF-8.

  5. #145
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: CSS3 Buttons [support thread]

    I'm using TextWrangler on a Mac.

    As far as I'm aware, when I open a file for editing, it gets saved in the same format as it was opened.

    I'll go double check to be sure though...

  6. #146
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: CSS3 Buttons [support thread]

    Crazy! I tried to reopen as UTF-8, says I cannot because file is incorrectly formatted or damaged.

    I'm going to rebuild the file as UTF-8.

  7. #147
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,686
    Plugin Contributions
    11

    Default Re: CSS3 Buttons [support thread]

    If you are using the latest version, you may need to change the options of the save/save as command from the file menu. I believe you would want line breaks at Unix and encoding at unicode.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  8. #148
    Join Date
    Apr 2010
    Posts
    900
    Plugin Contributions
    0

    Default Re: CSS3 Buttons [support thread]

    Yahoo! Validation problems have been cured!

    I'm going to push thru this, see if I can't get it working all the way. Thank you so much!!!

  9. #149
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,879
    Plugin Contributions
    96

    Default Re: CSS3 Buttons [support thread]

    Quote Originally Posted by Feznizzle View Post
    Yahoo! Validation problems have been cured!

    I'm going to push thru this, see if I can't get it working all the way. Thank you so much!!!
    Woo-hoo! If I'd paid more attention to your original posting, I'd have seen the issue sooner.

 

 
Page 15 of 15 FirstFirst ... 5131415

Similar Threads

  1. Hebrew Support - latest release [Support Thread]
    By eranariel in forum Addon Language Packs
    Replies: 22
    Last Post: 26 Jan 2026, 06:47 AM
  2. SysCheck [support thread]
    By swguy in forum All Other Contributions/Addons
    Replies: 36
    Last Post: 24 Oct 2020, 05:28 AM
  3. v150 CSS Buttons for Admin [Support Thread]
    By lat9 in forum All Other Contributions/Addons
    Replies: 19
    Last Post: 24 Dec 2015, 09:13 PM
  4. goMobile Support Thread
    By steveyork136 in forum Addon Templates
    Replies: 29
    Last Post: 26 Aug 2015, 11:56 AM
  5. Wordpress On ZC [Support Thread]
    By hira in forum All Other Contributions/Addons
    Replies: 1858
    Last Post: 17 Jan 2014, 01:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg