• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP optionsframework_mlu_get_silentpost函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中optionsframework_mlu_get_silentpost函数的典型用法代码示例。如果您正苦于以下问题:PHP optionsframework_mlu_get_silentpost函数的具体用法?PHP optionsframework_mlu_get_silentpost怎么用?PHP optionsframework_mlu_get_silentpost使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了optionsframework_mlu_get_silentpost函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: optionsframework_medialibrary_uploader

 function optionsframework_medialibrary_uploader($_id, $_value, $_mode = 'full', $_desc = '', $_postid = 0, $_name = '')
 {
     $optionsframework_settings = get_option('optionsframework');
     // Gets the unique option id
     $option_name = $optionsframework_settings['id'];
     $output = '';
     $id = '';
     $class = '';
     $int = '';
     $value = '';
     $name = '';
     $id = strip_tags(strtolower($_id));
     // Change for each field, using a "silent" post. If no post is present, one will be created.
     $int = optionsframework_mlu_get_silentpost($id);
     // If a value is passed and we don't have a stored value, use the value that's passed through.
     if ($_value != '' && $value == '') {
         $value = $_value;
     }
     if ($_name != '') {
         $name = $option_name . '[' . $id . '][' . $_name . ']';
     } else {
         $name = $option_name . '[' . $id . ']';
     }
     if ($value) {
         $class = ' has-file';
     }
     $output .= '<input id="' . $id . '" class="upload' . $class . '" type="text" name="' . $name . '" value="' . $value . '" />' . "\n";
     if (function_exists('wp_enqueue_media')) {
         if ($value == '') {
             $output .= '<input id="upload-' . $id . '" class="upload-button button" type="button" value="' . __('Upload', 'textdomain') . '" />' . "\n";
         } else {
             $output .= '<input id="remove-' . $id . '" class="remove-file button" type="button" value="' . __('Remove', 'textdomain') . '" />' . "\n";
         }
     } else {
         $output .= '<p><i>' . __('Upgrade your version of WordPress for full media support.', 'textdomain') . '</i></p>';
     }
     if ($_desc != '') {
         $output .= '<span class="of_metabox_desc">' . $_desc . '</span>' . "\n";
     }
     $output .= '<div class="screenshot" id="' . $id . '_image">' . "\n";
     if ($value != '') {
         //$remove = '<a href="javascript:(void);" class="mlu_remove button">Remove</a>';
         $image = preg_match('/(^.*\\.jpg|jpeg|png|gif|ico*)/i', $value);
         if ($image) {
             $output .= '<img src="' . $value . '" alt="" />';
         } else {
             $parts = explode("/", $value);
             for ($i = 0; $i < sizeof($parts); ++$i) {
                 $title = $parts[$i];
             }
             // No output preview if it's not an image.
             $output .= '';
             // Standard generic output if it's not an image.
             $title = theme_locals("view_file");
             $output .= '<div class="no_image"><span class="file_link"><a href="' . $value . '" target="_blank" rel="external">' . $title . '</a></span>' . $remove . '</div>';
         }
     }
     $output .= '</div>' . "\n";
     return $output;
 }
开发者ID:hoangluanlee,项目名称:dlbh,代码行数:60,代码来源:options-medialibrary-uploader.php


示例2: optionsframework_medialibrary_uploader

 function optionsframework_medialibrary_uploader($_id, $_value, $_mode = 'full', $_desc = '', $_postid = 0, $_name = '')
 {
     $optionsframework_settings = get_option('optionsframework');
     // Obtiene un id único de opciones
     $option_name = $optionsframework_settings['id'];
     $output = '';
     $id = '';
     $class = '';
     $int = '';
     $value = '';
     $name = '';
     $id = strip_tags(strtolower($_id));
     // Cambia para cada campo, usando una entrada "silenciosa". Si no hay una entrada presente, una será creada.
     $int = optionsframework_mlu_get_silentpost($id);
     // Si un valor el proporcionado y no tenemos un valor guardado, usa el valor que ha sido proporcionado.
     if ($_value != '' && $value == '') {
         $value = $_value;
     }
     if ($_name != '') {
         $name = $option_name . '[' . $id . '][' . $_name . ']';
     } else {
         $name = $option_name . '[' . $id . ']';
     }
     if ($value) {
         $class = ' has-file';
     }
     $output .= '<input id="' . $id . '" class="upload' . $class . '" type="text" name="' . $name . '" value="' . $value . '" />' . "\n";
     $output .= '<input id="upload_' . $id . '" class="upload_button button" type="button" value="' . __('Subir', 'optionsframework') . '" rel="' . $int . '" />' . "\n";
     if ($_desc != '') {
         $output .= '<span class="of_metabox_desc">' . $_desc . '</span>' . "\n";
     }
     $output .= '<div class="screenshot" id="' . $id . '_image">' . "\n";
     if ($value != '') {
         $remove = '<a href="javascript:(void);" class="mlu_remove button">Eliminar</a>';
         $image = preg_match('/(^.*\\.jpg|jpeg|png|gif|ico*)/i', $value);
         if ($image) {
             $output .= '<img src="' . $value . '" alt="" />' . $remove . '';
         } else {
             $parts = explode("/", $value);
             for ($i = 0; $i < sizeof($parts); ++$i) {
                 $title = $parts[$i];
             }
             // No hay previsualización si no existe una imagen.
             $output .= '';
             // Salida estándar si no es una imagen.
             $title = __('Ver archivo', 'optionsframework');
             $output .= '<div class="no_image"><span class="file_link"><a href="' . $value . '" target="_blank" rel="external">' . $title . '</a></span>' . $remove . '</div>';
         }
     }
     $output .= '</div>' . "\n";
     return $output;
 }
开发者ID:ncoelho,项目名称:wordpress-bootstrap-spanish,代码行数:52,代码来源:options-medialibrary-uploader.php


示例3: optionsframework_machine


//.........这里部分代码省略.........
                 }
                 $fold = '';
                 if (array_key_exists("folds", $value)) {
                     $fold = "fld ";
                 }
                 $output .= '<input type="hidden" class="' . $fold . 'checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="0"/>';
                 $output .= '<input type="checkbox" class="' . $fold . 'checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="1" ' . checked($smof_data[$value['id']], 1, false) . ' />';
                 break;
                 //multiple checkbox option
             //multiple checkbox option
             case 'multicheck':
                 isset($smof_data[$value['id']]) ? $multi_stored = $smof_data[$value['id']] : ($multi_stored = "");
                 foreach ($value['options'] as $key => $option) {
                     if (!isset($multi_stored[$key])) {
                         $multi_stored[$key] = '';
                     }
                     $of_key_string = $value['id'] . '_' . $key;
                     $output .= '<input type="checkbox" class="checkbox of-input" name="' . $value['id'] . '[' . $key . ']' . '" id="' . $of_key_string . '" value="1" ' . checked($multi_stored[$key], 1, false) . ' /><label class="multicheck" for="' . $of_key_string . '">' . $option . '</label><br />';
                 }
                 break;
                 //ajax image upload option
             //ajax image upload option
             case 'upload':
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 $output .= Options_Machine::optionsframework_uploader_function($value['id'], $value['std'], $value['mod']);
                 break;
                 // native media library uploader - @uses optionsframework_media_uploader_function()
             // native media library uploader - @uses optionsframework_media_uploader_function()
             case 'media':
                 $_id = strip_tags(strtolower($value['id']));
                 $int = '';
                 $int = optionsframework_mlu_get_silentpost($_id);
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 $output .= Options_Machine::optionsframework_media_uploader_function($value['id'], $value['std'], $int, $value['mod']);
                 // New AJAX Uploader using Media Library
                 break;
                 //colorpicker option
             //colorpicker option
             case 'color':
                 $output .= '<div id="' . $value['id'] . '_picker" class="colorSelector"><div style="background-color: ' . $smof_data[$value['id']] . '"></div></div>';
                 $output .= '<input class="of-color" name="' . $value['id'] . '" id="' . $value['id'] . '" type="text" value="' . $smof_data[$value['id']] . '" />';
                 break;
                 //typography option
             //typography option
             case 'typography':
                 $typography_stored = isset($smof_data[$value['id']]) ? $smof_data[$value['id']] : $value['std'];
                 /* Font Size */
                 if (isset($typography_stored['size'])) {
                     $output .= '<div class="select_wrapper typography-size" original-title="Font size">';
                     $output .= '<select class="of-typography of-typography-size select" name="' . $value['id'] . '[size]" id="' . $value['id'] . '_size">';
                     for ($i = 9; $i < 101; $i++) {
                         $test = $i . 'px';
                         $output .= '<option value="' . $i . 'px" ' . selected($typography_stored['size'], $test, false) . '>' . $i . 'px</option>';
                     }
                     $output .= '</select></div>';
                 }
                 /* Line Height */
                 if (isset($typography_stored['height'])) {
                     $output .= '<div class="select_wrapper typography-height" original-title="Line height">';
                     $output .= '<select class="of-typography of-typography-height select" name="' . $value['id'] . '[height]" id="' . $value['id'] . '_height">';
                     for ($i = 20; $i < 38; $i++) {
                         $test = $i . 'px';
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:67,代码来源:class.options_machine.php


示例4: optionsframework_machine


//.........这里部分代码省略.........
                 }
                 $fold = '';
                 if (array_key_exists("folds", $value)) {
                     $fold = "fld ";
                 }
                 $output .= '<input type="hidden" class="' . $fold . 'checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="0"/>';
                 $output .= '<input type="checkbox" class="' . $fold . 'checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="1" ' . checked($smof_data[$value['id']], 1, false) . ' />';
                 break;
                 //multiple checkbox option
             //multiple checkbox option
             case 'multicheck':
                 isset($smof_data[$value['id']]) ? $multi_stored = $smof_data[$value['id']] : ($multi_stored = "");
                 foreach ($value['options'] as $key => $option) {
                     if (!isset($multi_stored[$key])) {
                         $multi_stored[$key] = '';
                     }
                     $of_key_string = $value['id'] . '_' . $key;
                     $output .= '<input type="checkbox" class="checkbox of-input" name="' . $value['id'] . '[' . $key . ']' . '" id="' . $of_key_string . '" value="1" ' . checked($multi_stored[$key], 1, false) . ' /><label class="multicheck" for="' . $of_key_string . '">' . $option . '</label><br />';
                 }
                 break;
                 //ajax image upload option
             //ajax image upload option
             case 'upload':
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 $output .= Options_Machine::optionsframework_uploader_function($value['id'], $value['std'], $value['mod']);
                 break;
                 // native media library uploader - @uses optionsframework_media_uploader_function()
             // native media library uploader - @uses optionsframework_media_uploader_function()
             case 'media':
                 $_id = strip_tags(strtolower($value['id']));
                 $int = '';
                 $int = optionsframework_mlu_get_silentpost($_id);
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 $output .= Options_Machine::optionsframework_media_uploader_function($value['id'], $value['std'], $int, $value['mod']);
                 // New AJAX Uploader using Media Library
                 break;
                 //colorpicker option
             //colorpicker option
             case 'color':
                 $_color = !empty($smof_data[$value['id']]) ? $smof_data[$value['id']] : '';
                 $output .= '<div id="' . $value['id'] . '_picker" class="colorSelector"><div style="background-color: ' . $_color . '"></div></div>';
                 $output .= '<input class="of-color" name="' . $value['id'] . '" id="' . $value['id'] . '" type="text" value="' . $_color . '" />';
                 break;
                 //typography option
             //typography option
             case 'typography':
                 $typography_stored = isset($smof_data[$value['id']]) ? $smof_data[$value['id']] : $value['std'];
                 /* Font Size */
                 if (isset($typography_stored['size'])) {
                     $output .= '<div class="select_wrapper typography-size" original-title="Font size">';
                     $output .= '<select class="of-typography of-typography-size select" name="' . $value['id'] . '[size]" id="' . $value['id'] . '_size">';
                     for ($i = 9; $i < 20; $i++) {
                         $test = $i . 'px';
                         $output .= '<option value="' . $i . 'px" ' . selected($typography_stored['size'], $test, false) . '>' . $i . 'px</option>';
                     }
                     $output .= '</select></div>';
                 }
                 /* Line Height */
                 if (isset($typography_stored['height'])) {
                     $output .= '<div class="select_wrapper typography-height" original-title="Line height">';
                     $output .= '<select class="of-typography of-typography-height select" name="' . $value['id'] . '[height]" id="' . $value['id'] . '_height">';
                     for ($i = 20; $i < 38; $i++) {
开发者ID:sergirams,项目名称:puentes_humanos,代码行数:67,代码来源:class.options_machine.php


示例5: optionsframework_medialibrary_uploader

 function optionsframework_medialibrary_uploader($option_name, $type, $_id, $_value, $_mode = 'full', $_desc = null, $_postid = 0, $_name = null, $_upload_text = null)
 {
     $output = '';
     $id = '';
     $class = '';
     $int = '';
     $value = array('url' => '', 'id' => '');
     $upload_text = __('Upload', 'themeblvd');
     if ($type == 'slider') {
         $name = $option_name . '[image]';
     } else {
         $name = $option_name . '[' . $_id . ']';
     }
     $id = strip_tags(strtolower($_id));
     // If a value is passed and we don't have a stored value, use the value that's passed through.
     if ($_value) {
         $value = $_value;
     }
     // If passed name, set it.
     if ($_name) {
         $name = $name . '[' . $_name . ']';
         $id = $id . '_' . $_name;
     }
     // Set the ID for the post.
     if ($_postid) {
         // Set ID to the one passed in.
         $int = $_postid;
     } else {
         // Change for each field, using a "silent" post.
         // If no post is present, one will be created.
         $int = optionsframework_mlu_get_silentpost($id);
     }
     // If passed upload button text, set it.
     if ($_upload_text) {
         $upload_text = $_upload_text;
     }
     if ($value['url']) {
         $class = ' has-file';
     }
     // Allow multiple upload options on the same page with
     // same ID -- This could happen in the Layout Builder, for example.
     $formfield = uniqid($id . '_');
     if ($type == 'slider') {
         // Slider image ID input w/hidden image URL input for user admin display
         $output .= '<span class="locked"><span></span><input id="' . $formfield . '_id" class="locked upload' . $class . '" type="text" name="' . $name . '[id]" value="' . $value['id'] . '" /></span>' . "\n";
         $output .= '<input id="' . $formfield . '" class="image-url upload' . $class . '" type="hidden" name="' . $name . '[url]" value="' . $value['url'] . '" />' . "\n";
         $output .= '<p class="explain">' . __('You must use the "Get Image" button to modify the image ID for this slide. This is what the locked icon represents.', 'themeblvd') . '</p>';
     } elseif ($type == 'logo') {
         $width_name = str_replace('[image]', '[image_width]', $name);
         $output .= '<input id="' . $formfield . '" class="image-url upload' . $class . '" type="text" name="' . $name . '" value="' . $value['url'] . '" placeholder="' . __('Image URL', 'themeblvd') . '" />' . "\n";
         $output .= '<input id="' . $formfield . '_width" class="image-width upload' . $class . '" type="text" name="' . $width_name . '" value="' . $value['width'] . '" placeholder="' . __('Width', 'themeblvd') . '" />' . "\n";
     } elseif ($type == 'logo_2x') {
         $output .= '<input id="' . $formfield . '" class="image-url upload' . $class . '" type="text" name="' . $name . '" value="' . $value['url'] . '" placeholder="' . __('Image URL twice the size of standard image', 'themeblvd') . '" />' . "\n";
     } else {
         // Standard image input
         $output .= '<input id="' . $formfield . '" class="image-url upload' . $class . '" type="text" name="' . $name . '" value="' . $value['url'] . '" placeholder="' . __('Image URL', 'themeblvd') . '" />' . "\n";
     }
     $output .= '<input id="upload_' . $formfield . '" class="upload_button button" type="button" value="' . $upload_text . '" data-upload-type="' . $type . '" rel="' . $int . '" />' . "\n";
     if ($_desc != '') {
         $output .= '<span class="of_metabox_desc">' . $_desc . '</span>' . "\n";
     }
     $output .= '<div class="screenshot" id="' . $id . '_image">' . "\n";
     if ($value['url'] != '') {
         $remove = '<a href="javascript:(void);" class="mlu_remove button">Remove</a>';
         $image = preg_match('/(^.*\\.jpg|jpeg|png|gif|ico*)/i', $value['url']);
         if ($image) {
             $output .= '<img src="' . $value['url'] . '" alt="" />' . $remove . '';
         } else {
             $parts = explode("/", $value['url']);
             for ($i = 0; $i < sizeof($parts); ++$i) {
                 $title = $parts[$i];
             }
             // No output preview if it's not an image.
             $output .= '';
             // Standard generic output if it's not an image.
             $title = __('View File', 'themeblvd');
             $output .= '<div class="no_image"><span class="file_link"><a href="' . $value['url'] . '" target="_blank" rel="external">' . $title . '</a></span>' . $remove . '</div>';
         }
     }
     $output .= '</div>' . "\n";
     return $output;
 }
开发者ID:JulieKuehl,项目名称:julie-jumpstart,代码行数:82,代码来源:media-uploader-legacy.php


示例6: optionsframework_medialibrary_uploader

 function optionsframework_medialibrary_uploader($_id, $_value, $_mode = 'full', $_desc = '', $_postid = 0, $_name = '')
 {
     /* earlier code
     			$optionsframework_settings = get_option($_id);
     			//print_r($optionsframework_settings);
     			
     			// Gets the unique option id
     			$option_name = $optionsframework_settings['id'];
     			*/
     /* new code*/
     $option_name = get_option($_id);
     /* end new code */
     $output = $id = $class = $int = $name = '';
     $value = get_option($_id);
     $id = strip_tags(strtolower($_id));
     // Change for each field, using a "silent" post. If no post is present, one will be created.
     $int = optionsframework_mlu_get_silentpost($id);
     // If a value is passed and we don't have a stored value, use the value that's passed through.
     if ($_value != '' && $value == '') {
         $value = $_value;
     }
     if ($_name != '') {
         $name = $option_name . '[' . $id . '][' . $_name . ']';
     } else {
         $name = $option_name . '[' . $id . ']';
     }
     if ($value) {
         $class = ' has-file';
     }
     $output .= '<input id="' . $id . '" class="upload' . $class . '" type="text" name="' . $id . '" value="' . $value . '" />' . "\n";
     $output .= '<input id="upload_' . $id . '" class="upload_button button-primary button-large" type="button" value="' . __('Upload', 'optionsframework') . '" rel="' . $int . '" />' . "\n";
     if ($_desc != '') {
         $output .= '<span class="of_metabox_desc">' . $_desc . '</span>' . "\n";
     }
     $output .= '<div class="clear"></div><div class="screenshot" id="' . $id . '_image">' . "\n";
     if ($value != '') {
         $remove = '<a href="javascript:(void);" class="custom_clear_image_button button button-primary">x</a>';
         $image = preg_match('/(^.*\\.jpg|jpeg|png|gif*)/i', $value);
         if ($image) {
             $image_attributes = wp_get_attachment_image_src(get_attachment_id_from_src($value));
             if ($image_attributes[0] != '') {
                 $output .= '<img src="' . $image_attributes[0] . '" alt="" />' . $remove . '';
             } else {
                 $output .= '<img src="' . $value . '" alt="" />' . $remove . '';
             }
         } else {
             $parts = explode("/", $value);
             for ($i = 0; $i < sizeof($parts); ++$i) {
                 $title = $parts[$i];
             }
             // No output preview if it's not an image.
             $output .= '';
             // Standard generic output if it's not an image.
             $title = __('View File', 'optionsframework');
             $output .= '<div class="no_image"><span class="file_link"></span>' . $remove . '</div>';
         }
     }
     $output .= '</div>' . "\n";
     return $output;
 }
开发者ID:pryspry,项目名称:MusicPlay,代码行数:60,代码来源:admin-interface.php


示例7: optionsframework_machine


//.........这里部分代码省略.........
                    }
                    $fold = '';
                    if (array_key_exists("folds", $value)) {
                        $fold = "fld ";
                    }
                    $output .= '<input type="hidden" class="' . $fold . 'checkbox aq-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="0"/>';
                    $output .= '<input type="checkbox" class="' . $fold . 'checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="1" ' . checked(@$data[$value['id']], 1, false) . ' />';
                    break;
                    //multiple checkbox option
                //multiple checkbox option
                case 'multicheck':
                    $multi_stored = @$data[$value['id']];
                    foreach ($value['options'] as $key => $option) {
                        if (!isset($multi_stored[$key])) {
                            $multi_stored[$key] = '';
                        }
                        $of_key_string = $value['id'] . '_' . $key;
                        $output .= '<input type="checkbox" class="checkbox of-input" name="' . $value['id'] . '[' . $key . ']' . '" id="' . $of_key_string . '" value="1" ' . checked($multi_stored[$key], 1, false) . ' /><label class="multicheck" for="' . $of_key_string . '">' . $option . '</label><br />';
                    }
                    break;
                    //ajax image upload option
                //ajax image upload option
                case 'upload':
                    if (!isset($value['mod'])) {
                        $value['mod'] = '';
                    }
                    $output .= Options_Machine::optionsframework_uploader_function($value['id'], $value['std'], $value['mod']);
                    break;
                    // native media library uploader - @uses optionsframework_media_uploader_function()
                // native media library uploader - @uses optionsframework_media_uploader_function()
                case 'media':
                    $_id = strip_tags(strtolower($value['id']));
                    $int = '';
                    $int = optionsframework_mlu_get_silentpost($_id);
                    if (!isset($value['mod'])) {
                        $value['mod'] = '';
                    }
                    $output .= Options_Machine::optionsframework_media_uploader_function($value['id'], $value['std'], $int, $value['mod']);
                    // New AJAX Uploader using Media Library
                    break;
                    //colorpicker option
                //colorpicker option
                case 'color':
                    $output .= '<div id="' . $value['id'] . '_picker" class="colorSelector"><div style="background-color: ' . @$data[$value['id']] . '"></div></div>';
                    $output .= '<input class="of-color" name="' . $value['id'] . '" id="' . $value['id'] . '" type="text" value="' . @$data[$value['id']] . '" />';
                    break;
                    //typography option
                //typography option
                case 'typography':
                    $typography_stored = isset($data[$value['id']]) ? @$data[$value['id']] : $value['std'];
                    /* Font Size */
                    if (isset($typography_stored['size'])) {
                        $output .= '<div class="select_wrapper typography-size" original-title="Font size">';
                        $output .= '<select class="of-typography of-typography-size select" name="' . $value['id'] . '[size]" id="' . $value['id'] . '_size">';
                        if ($value['id'] == 'md_body_fontsize') {
                            $mini = '10';
                            $maxi = '21';
                        } else {
                            $mini = '28';
                            $maxi = '72';
                        }
                        for ($i = $mini; $i < $maxi; $i++) {
                            $test = $i . 'px';
                            $output .= '<option value="' . $i . 'px" ' . selected($typography_stored['size'], $test, false) . '>' . $i . 'px</option>';
                        }
                        $output .= '</select></div>';
开发者ID:NallelyFlores89,项目名称:telesinergia,代码行数:67,代码来源:class.options_machine.php


示例8: optionsframework_machine


//.........这里部分代码省略.........
                 $fold = '';
                 if (array_key_exists("folds", $value)) {
                     $fold = "fld ";
                 }
                 $output .= '<input type="hidden" class="' . $fold . 'checkbox aq-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="0"/>';
                 $output .= '<input type="checkbox" class="' . $fold . 'checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="1" ' . checked($data[$value['id']], 1, false) . ' />';
                 break;
                 //multiple checkbox option
             //multiple checkbox option
             case 'multicheck':
                 //$multi_stored = $data[$value['id']];
                 isset($data[$value['id']]) ? $multi_stored = $data[$value['id']] : ($multi_stored = "");
                 foreach ($value['options'] as $key => $option) {
                     if (!isset($multi_stored[$key])) {
                         $multi_stored[$key] = '';
                     }
                     $of_key_string = $value['id'] . '_' . $key;
                     $output .= '<input type="checkbox" class="checkbox of-input" name="' . $value['id'] . '[' . $key . ']' . '" id="' . $of_key_string . '" value="1" ' . checked($multi_stored[$key], 1, false) . ' /><label class="multicheck" for="' . $of_key_string . '">' . $option . '</label><br />';
                 }
                 break;
                 //ajax image upload option
             //ajax image upload option
             case 'upload':
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 $output .= Options_Machine::optionsframework_uploader_function($value['id'], $value['std'], $value['mod']);
                 break;
                 // native media library uploader - @uses optionsframework_media_uploader_function()
             // native media library uploader - @uses optionsframework_media_uploader_function()
             case 'media':
                 $_id = strip_tags(strtolower($value['id']));
                 $int = '';
                 $int = optionsframework_mlu_get_silentpost($_id);
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 $output .= Options_Machine::optionsframework_media_uploader_function($value['id'], $value['std'], $int, $value['mod']);
                 // New AJAX Uploader using Media Library
                 break;
                 //colorpicker option
             //colorpicker option
             case 'color':
                 $output .= '<div id="' . $value['id'] . '_picker" class="colorSelector"><div style="background-color: ' . $data[$value['id']] . '"></div></div>';
                 $output .= '<input class="of-color" name="' . $value['id'] . '" id="' . $value['id'] . '" type="text" value="' . $data[$value['id']] . '" />';
                 break;
                 //typography option
             //typography option
             case 'typography':
                 $typography_stored = isset($data[$value['id']]) ? $data[$value['id']] : $value['std'];
                 /* Font Size */
                 if (isset($typography_stored['size'])) {
                     $output .= '<div class="select_wrapper typography-size" original-title="Font size">';
                     $output .= '<select class="of-typography of-typography-size select" name="' . $value['id'] . '[size]" id="' . $value['id'] . '_size">';
                     for ($i = 9; $i < 47; $i++) {
                         $test = $i . 'px';
                         $output .= '<option value="' . $i . 'px" ' . selected($typography_stored['size'], $test, false) . '>' . $i . 'px</option>';
                     }
                     $output .= '</select></div>';
                 }
                 /* Line Height */
                 if (isset($typography_stored['height'])) {
                     $output .= '<div class="select_wrapper typography-height" original-title="Line height">';
                     $output .= '<select class="of-typography of-typography-height select" name="' . $value['id'] . '[height]" id="' . $value['id'] . '_height">';
                     for ($i = 20; $i < 38; $i++) {
                         $test = $i . 'px';
开发者ID:kanvasamsterdam,项目名称:deploykanvas,代码行数:67,代码来源:class.options_machine.php


示例9: optionsframework_machine


//.........这里部分代码省略.........
                 if (!isset($pmc_data[$value['id']])) {
                     $pmc_data[$value['id']] = '';
                 }
                 $output .= '<input type="checkbox" class="checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="1" ' . checked($pmc_data[$value['id']], true, false) . ' />';
                 break;
             case 'multicheck':
                 if (!isset($pmc_data[$value['id']])) {
                     $pmc_data[$value['id']] = '';
                 }
                 $multi_stored = $pmc_data[$value['id']];
                 foreach ($value['options'] as $key => $option) {
                     if (!isset($multi_stored[$key])) {
                         $multi_stored[$key] = '';
                     }
                     $of_key_string = $value['id'] . '_' . $key;
                     $output .= '<input type="checkbox" class="checkbox of-input" name="' . $value['id'] . '[' . $key . ']' . '" id="' . $of_key_string . '" value="1" ' . checked($multi_stored[$key], 1, false) . ' /><label for="' . $of_key_string . '">' . $option . '</label><br />';
                 }
                 break;
             case 'upload':
                 if (!isset($pmc_data[$value['id']])) {
                     $pmc_data[$value['id']] = '';
                 }
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 $output .= Options_Machine::optionsframework_uploader_function($value['id'], $value['std'], $value['mod']);
                 break;
             case 'media':
                 if (!isset($pmc_data[$value['id']])) {
                     $pmc_data[$value['id']] = '';
                 }
                 $_id = strip_tags(strtolower($value['id']));
                 $int = '';
                 $int = optionsframework_mlu_get_silentpost($_id);
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 $output .= Options_Machine::optionsframework_media_uploader_function($value['id'], $value['std'], $int, $value['mod']);
                 // New AJAX Uploader using Media Library
                 break;
             case 'slider':
                 if (!isset($pmc_data[$value['id']])) {
                     $pmc_data[$value['id']] = '';
                 }
                 $_id = strip_tags(strtolower($value['id']));
                 $int = '';
                 $int = optionsframework_mlu_get_silentpost($_id);
                 $output .= '<div class="slider"><ul id="' . $value['id'] . '" rel="' . $int . '">';
                 $slides = $pmc_data[$value['id']];
                 $count = count($slides);
                 if ($count < 2) {
                     $oldorder = 1;
                     $order = 1;
                     $output .= Options_Machine::optionsframework_slider_function($value['id'], $value['std'], $oldorder, $order, $int, $value['descshow'], $value['team'], $value['nivo']);
                 } else {
                     $i = 0;
                     foreach ($slides as $slide) {
                         if (isset($slide['order'])) {
                             $oldorder = $slide['order'];
                         } else {
                             $oldorder = 0;
                         }
                         $i++;
                         $order = $i;
                         $output .= Options_Machine::optionsframework_slider_function($value['id'], $value['std'], $oldorder, $order, $int, $value['descshow'], $value['team'], $value['nivo']);
                     }
开发者ID:shimion,项目名称:sim-buller,代码行数:67,代码来源:admin-interface.php


示例10: Inputs


//.........这里部分代码省略.........
             //multiple checkbox option
             case 'multicheck':
                 //(isset($smof_data[$value['id']]))? $multi_stored = $smof_data[$value['id']] : $multi_stored="";
                 $multi_stored = isset($smof_data[$value['id']]) ? $smof_data[$value['id']] : (isset($value['std']) ? $value['std'] : '');
                 foreach ($value['options'] as $key => $option) {
                     if (is_array($multi_stored)) {
                         if (isset($value['keyAsValue']) && $value['keyAsValue'] === true) {
                             $check_this = in_array($key, $multi_stored) ? $key : '';
                         } else {
                             $check_this = isset($multi_stored[$key]) ? $multi_stored[$key] : '';
                         }
                     } else {
                         $check_this = $multi_stored;
                     }
                     $of_key_string = $value['id'] . '_' . $key;
                     $_val = isset($value['keyAsValue']) && $value['keyAsValue'] === true ? $key : '1';
                     $output .= '<input type="checkbox" class="checkbox of-input" name="' . esc_attr($value['id']) . '[' . esc_attr($key) . ']' . '" id="' . esc_attr($of_key_string) . '" value="' . esc_attr($_val) . '" ' . checked($check_this, $_val, false) . ' /><label class="multicheck" for="' . esc_attr($of_key_string) . '">' . $option . '</label><br />';
                 }
                 //$output .= '<pre>'.print_r($multi_stored, true).'</pre>';		// debug
                 break;
                 //ajax image upload option
             //ajax image upload option
             case 'upload':
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 $output .= Options_Machine::optionsframework_uploader_function($value['id'], $value['std'], $value['mod']);
                 break;
                 // native media library uploader - @uses optionsframework_media_uploader_function()
             // native media library uploader - @uses optionsframework_media_uploader_function()
             case 'media':
                 $_id = strip_tags(strtolower($value['id']));
                 $int = '';
                 $int = optionsframework_mlu_get_silentpost($_id);
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 $output .= Options_Machine::optionsframework_media_uploader_function($value['id'], $value['std'], $int, $value['mod']);
                 // New AJAX Uploader using Media Library
                 break;
                 //colorpicker option
             //colorpicker option
             case 'color':
                 $color_stored = isset($smof_data[$value['id']]) ? $smof_data[$value['id']] : $value['std'];
                 $output .= '<div id="' . esc_attr($value['id']) . '_picker" class="colorSelector"><div style="background-color: ' . esc_attr($color_stored) . '"></div></div>';
                 $output .= '<input class="of-color" name="' . esc_attr($value['id']) . '" id="' . esc_attr($value['id']) . '" type="text" value="' . esc_attr($color_stored) . '" />';
                 break;
                 //select option
             //select option
             case 'select_color_scheme':
                 $mini = '';
                 if (!isset($value['mod'])) {
                     $value['mod'] = '';
                 }
                 if (!isset($value['fields']) || !is_array($value['fields'])) {
                     $value['fields'] = array();
                 }
                 if ($value['mod'] == 'mini') {
                     $mini = 'mini';
                 }
                 $output .= '<div class="select_wrapper ' . esc_attr($mini) . '">';
                 $output .= '<select class="select of-input select-color-scheme" name="' . esc_attr($value['id']) . '" id="' . esc_attr($value['id']) . '">';
                 $selected_option = isset($smof_data[$value['id']]) ? $smof_data[$value['id']] : (isset($value['std']) ? $value['std'] : "");
                 foreach ($value['options'] as $select_ID => $option) {
                     $select_ID = !isset($select_ID) ? $option : $select_ID;
                     $output .= '<option id="' . esc_attr($select_ID) . '" value="' . esc_attr($select_ID) . '" ' . selected($selected_option, $select_ID, false) . ' />' . $option . '</option>';
开发者ID:dqishmirian,项目名称:jrrny,代码行数:67,代码来源:class.options_machine.php


示例11: optionsframework_medialibrary_uploader

 function optionsframework_medialibrary_uploader($_id, $_value, $_mode = 'full', $_desc = '', $_postid = 0, $_name = '')
 {
     $optionsframework_settings = get_option('optionsframework');
     // Gets the unique option id
     $option_name = $optionsframework_settings['id'];
     $output = '';
     $id = '';
     $class = '';
     $int = '';
     $value = '';
     $name = '';
     $att_id = 0;
     $id = strip_tags(strtolower($_id));
     // Change for each field, using a "silent" post. If no post is present, one will be created.
     $int = optionsframework_mlu_get_silentpost($id);
     // If a value is passed and we don't have a stored value, use the value that's passed through.
     if ($_mode == 'with_id') {
         $value = !empty($_value[0]) ? $_value[0] : '';
         $att_id = !empty($_value[1]) ? intval($_value[1]) : 0;
     } elseif ($_value != '' && $value == '') {
         $value = $_value;
     }
     if ($_name != '') {
         $name = $option_name . '[' . $id . '][' . $_name . ']';
     } else {
         $name = $option_name . '[' . $id . ']';
     }
     if ($value) {
         $class = ' has-file';
     }
     if ($_mode == 'with_id') {
         $output .= '<input id="' . $id . '" class="upload' . $class . '" type="text" name="' . $name . '[uri]" value="' . $value . '" />' . "\n";
         $output .= '<input type="hidden" class="upload-id" name="' . $name . '[id]" value="' . $att_id . '" />' . "\n";
     } else {
         $output .= '<input id="' . $id . '" class="upload' . $class . '" type="text" name="' . $name . '" value="' . $value . '" />' . "\n";
     }
     $output .= '<input id="upload_' . $id . '" class="upload_button button" type="button" value="' . _x('Upload', 'backend', LANGUAGE_ZONE) . '" rel="' . $int . '" />' . "\n";
     if ($_desc != '') {
         $output .= '<span class="of_metabox_desc">' . $_desc . '</span>' . "\n";
     }
     $output .= '<div class="screenshot" id="' . $id . '_image">' . "\n";
     if ($value != '') {
         $remove = '<a href="javascript:(void);" class="mlu_remove button">Remove</a>';
         $image = preg_match('/(^.*\\.jpg|jpeg|png|gif|ico*)/i', $value);
         if ($image) {
             $value = dt_get_of_uploaded_image($value);
             $output .= '<img src="' . $value . '" alt="" />' . $remove . '';
         } else {
             $parts = explode("/", $value);
             for ($i = 0; $i < sizeof($parts); ++$i) {
                 $title = $parts[$i];
             }
             // No output preview if it's not an image.
             $output .= '';
             // Standard generic output if it's not an image.
             $title = _x('View File', 'backend', LANGUAGE_ZONE);
             $output .= '<div class="no_image"><span class="file_link"><a href="' . $value . '" target="_blank" rel="external">' . $title . '</a></span>' . $remove . '</div>';
         }
     }
     $output .= '</div>' . "\n";
     return $output;
 }
开发者ID:mnjit,项目名称:aa-global,代码行数:62,代码来源:options-medialibrary-uploader.php


示例12: optionsframework_machine


//.........这里部分代码省略.........
                    }
                    $fold = '';
                    if (array_key_exists("folds", $value)) {
                        $fold = "fld ";
                    }
                    $output .= '<input type="hidden" class="' . $fold . 'checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="0"/>';
                    $output .= '<input type="checkbox" class="' . $fold . 'checkbox of-input" name="' . $value['id'] . '" id="' . $value['id'] . '" value="1" ' . checked($smof_data[$value['id']], 1, false) . ' />';
                    break;
                    //multiple checkbox option
                //multiple checkbox option
                case 'multicheck':
                    isset($smof_data[$value['id']]) ? $multi 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP optionsframework_option_name函数代码示例发布时间:2022-05-15
下一篇:
PHP optionsframework_medialibrary_uploader函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap