Exemplo n.º 1
0
 public static function gallery($id, $field)
 {
     $shult = shortcodes_ultimate();
     // Prepare galleries list
     $galleries = $shult->get_option('galleries');
     $created = is_array($galleries) && count($galleries) ? true : false;
     $return = '<select name="' . $id . '" id="su-generator-attr-' . $id . '" class="su-generator-attr" data-loading="' . __('Please wait', 'shortcodes-ultimate') . '">';
     // Check that galleries is set
     if ($created) {
         // Create options
         foreach ($galleries as $g_id => $gallery) {
             // Is this option selected
             $selected = $g_id == 0 ? ' selected="selected"' : '';
             // Prepare title
             $gallery['name'] = $gallery['name'] == '' ? __('Untitled gallery', 'shortcodes-ultimate') : stripslashes($gallery['name']);
             // Create option
             $return .= '<option value="' . ($g_id + 1) . '"' . $selected . '>' . $gallery['name'] . '</option>';
         }
     } else {
         $return .= '<option value="0" selected>' . __('Galleries not found', 'shortcodes-ultimate') . '</option>';
     }
     $return .= '</select><small class="description"><a href="' . $shult->admin_url . '#tab-3" target="_blank">' . __('Manage galleries', 'shortcodes-ultimate') . '</a>&nbsp;&nbsp;&nbsp;<a href="javascript:;" class="su-generator-reload-galleries">' . __('Reload galleries', 'shortcodes-ultimate') . '</a></small>';
     return $return;
 }
Exemplo n.º 2
0
 /**
  * Helper to get full URL of a skin file
  */
 public static function skin_url($file = '')
 {
     $shult = shortcodes_ultimate();
     $skin = get_option('su_option_skin');
     $uploads = wp_upload_dir();
     $uploads = $uploads['baseurl'];
     // Prepare url to skin directory
     $url = !$skin || $skin === 'default' ? plugins_url('assets/css/', SU_PLUGIN_FILE) : $uploads . '/shortcodes-ultimate-skins/' . $skin;
     return trailingslashit(apply_filters('su/assets/skin', $url)) . $file;
 }
Exemplo n.º 3
0
 /**
  * Helper to get full URL of a skin file
  */
 public static function skin_url($file = '')
 {
     $shult = shortcodes_ultimate();
     $skin = get_option('su_option_skin');
     $uploads = wp_upload_dir();
     $uploads = $uploads['baseurl'];
     // Prepare url to skin directory
     $url = !$skin || $skin === 'default' ? get_template_directory_uri() . '/functions/sc_generator/assets/css/' : $uploads . '/shortcodes-ultimate-skins/' . $skin;
     return trailingslashit(apply_filters('su/assets/skin', $url)) . $file;
 }
Exemplo n.º 4
0
 public static function gallery($id, $field)
 {
     $shult = shortcodes_ultimate();
     // Prepare galleries list
     $galleries = $shult->su_get_option('galleries');
     $created = is_array($galleries) && count($galleries) ? true : false;
     $return = '<select name="' . $id . '" id="su-generator-attr-' . $id . '" class="su-generator-attr" data-loading="' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_PLEASE_WAIT') . '">';
     // Check that galleries is set
     if ($created) {
         // Create options
         foreach ($galleries as $g_id => $gallery) {
             // Is this option selected
             $selected = $g_id == 0 ? ' selected="selected"' : '';
             // Prepare title
             $gallery['name'] = $gallery['name'] == '' ? JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_UNTITLED_GALLERY') : stripslashes($gallery['name']);
             // Create option
             $return .= '<option value="' . ($g_id + 1) . '"' . $selected . '>' . $gallery['name'] . '</option>';
         }
     } else {
         $return .= '<option value="0" selected>' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_GALLERIES_NOT_FOUND') . '</option>';
     }
     $return .= '</select><small class="description"><a href="' . $shult->admin_url . '#tab-3" target="_blank">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_MANAGE_GALLERIES') . '</a>&nbsp;&nbsp;&nbsp;<a href="javascript:;" class="su-generator-reload-galleries">' . JText::_('PLG_SYSTEM_BDTHEMES_SHORTCODES_RELOAD_GALLERIES') . '</a></small>';
     return $return;
 }