Ejemplo n.º 1
0
/**
 * Kentooz themes setting of all the available option types.
 *
 * @return    void
 *
 * @access    private
 * @since     2.0
 */
function _custom_theme_options()
{
    /**
     * Get a copy of the saved settings array. 
     */
    $saved_settings = get_option('option_tree_settings', array());
    /**
     * Create a custom settings array that we pass to 
     * the OptionTree Settings API Class.
     */
    $custom_settings = array('contextual_help' => array('content' => array(array('id' => 'general_help', 'title' => __('General', ktz_theme_textdomain), 'content' => __('<p>For import admin like kentooz demo go to Import/Export Options get the options code from option.txt and paste it there and click Import</p>', ktz_theme_textdomain))), 'sidebar' => __('<p>Sidebar content goes here!</p>', ktz_theme_textdomain)), 'sections' => array(array('title' => __('General', ktz_theme_textdomain), 'id' => 'general_tab'), array('title' => __('Slider & popup', ktz_theme_textdomain), 'id' => 'featured_tab'), array('title' => __('Banner', ktz_theme_textdomain), 'id' => 'banner_tab'), array('title' => __('Layout', ktz_theme_textdomain), 'id' => 'layout_tab'), array('title' => __('Stylish', ktz_theme_textdomain), 'id' => 'stylish_tab'), array('title' => __('Sidebars', ktz_theme_textdomain), 'id' => 'sidebars_tab'), array('title' => __('Social Network', ktz_theme_textdomain), 'id' => 'social_tab'), array('title' => __('Typography', ktz_theme_textdomain), 'id' => 'typography_tab'), array('title' => __('Comments', ktz_theme_textdomain), 'id' => 'comment_tab'), array('title' => __('Categories', ktz_theme_textdomain), 'id' => 'categories_tab'), array('title' => __('SEO', ktz_theme_textdomain), 'id' => 'seo_tab'), array('title' => __('AGC', ktz_theme_textdomain), 'id' => 'agc_tab'), array('title' => __('Other setting', ktz_theme_textdomain), 'id' => 'other_tab')), 'settings' => array(array('label' => __('Enable logo image?', ktz_theme_textdomain), 'id' => 'ktz_logo_actived', 'type' => 'radio', 'desc' => __('Please check yes for enable logo image and check no for disable logo image.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_tab'), array('label' => __('Your logo image', ktz_theme_textdomain), 'id' => 'ktz_logo', 'type' => 'upload', 'desc' => __('Upload your logo image and type full path here. Default width:232px and height:90px.', ktz_theme_textdomain), 'std' => ktz_url . 'includes/assets/img/logo.png', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_logo_actived:is(yes),ktz_logo_actived:not()', 'section' => 'general_tab'), array('label' => __('Your Favicon', ktz_theme_textdomain), 'id' => 'ktz_favicon', 'type' => 'upload', 'desc' => __('Upload your ico image or type full path here.', ktz_theme_textdomain), 'std' => ktz_url . 'favicon.ico', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_tab'), array('label' => __('Choice page navigation', ktz_theme_textdomain), 'id' => 'ktz_nav_select', 'type' => 'select', 'desc' => __('Select your favorite page navigation, we have 2 page navigation, you can choice default or number page navigation', ktz_theme_textdomain), 'choices' => nav_select(), 'std' => 'number', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_tab'), array('label' => __('Lock all video with social share?', ktz_theme_textdomain), 'id' => 'ktz_active_videolocker', 'type' => 'radio', 'desc' => __('Please check yes for Lock all video with social share in single and check no for disable Lock all video with social share in single. or more information, if this option disable you can enable video locker via metaboxes so you can lock exclusive post for lock video.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_tab'), array('label' => __('Enable breadcrumbs?', ktz_theme_textdomain), 'id' => 'ktz_breadcrumbs', 'type' => 'radio', 'desc' => __('Please check yes for enable breadcrumbs and check no for disable breadcrumbs.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_tab'), array('label' => __('Head Script', ktz_theme_textdomain), 'id' => 'ktz_head', 'type' => 'textarea-simple', 'desc' => __('The content of this box will be added immediately before /head tag. Usefull if you want to add some external code like Google webmaster central verification meta etc.', ktz_theme_textdomain), 'std' => '', 'rows' => '10', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_tab'), array('label' => __('Text footer credits', ktz_theme_textdomain), 'id' => 'ktz_footcredits', 'type' => 'textarea-simple', 'desc' => __('Please fill your footer credits here.', ktz_theme_textdomain), 'std' => '&copy; 2014 Powered by <a href="http://www.wordpress.org">Wordpress</a>', 'rows' => '3', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_tab'), array('label' => __('Footer Script', ktz_theme_textdomain), 'id' => 'ktz_footer', 'type' => 'textarea-simple', 'desc' => __('The content of this box will be added immediately before /body tag. Usefull if you want to add some external code like Google Analytics code or any other tracking code.', ktz_theme_textdomain), 'std' => '', 'rows' => '10', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'general_tab'), array('label' => __('Enable footer popup?', ktz_theme_textdomain), 'id' => 'ktz_popup_activated', 'type' => 'radio', 'desc' => __('Please check yes for enable footer popup and check no for disable footer popup.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'featured_tab'), array('label' => __('Enable header banner 728x90?', ktz_theme_textdomain), 'id' => 'ktz_ban72890_aftermenu_activated', 'type' => 'radio', 'desc' => __('Please check yes for enable header banner 728x90 and check no for disable header banner 728x90.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'banner_tab'), array('label' => __('Header banner (728x90)', ktz_theme_textdomain), 'id' => 'ktz_ban72890_aftermenu', 'type' => 'textarea-simple', 'desc' => __('Fill with banner 728x90 header banner.', ktz_theme_textdomain), 'std' => '<a href="http://www.kentooz.com" title="banner 728x90"><img src="https://farm3.staticflickr.com/2929/14681915121_191f465cf5_b.jpg" alt="banner 728x90" title="banner 728x90" height="90" width="728" /></a>', 'rows' => '5', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_ban72890_aftermenu_activated:is(yes),ktz_ban72890_aftermenu_activated:not()', 'section' => 'banner_tab'), array('label' => __('Enable Footer banner (728x90)?', ktz_theme_textdomain), 'id' => 'ktz_ban72890_footer_activated', 'type' => 'radio', 'desc' => __('Please check yes for enable Footer banner (728x90) and check no for disable Footer banner (728x90).', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'banner_tab'), array('label' => __('Footer banner (728x90)', ktz_theme_textdomain), 'id' => 'ktz_ban72890_footer', 'type' => 'textarea-simple', 'desc' => __('Fill with banner 728x90 in footer page before widget footer', ktz_theme_textdomain), 'std' => '<a href="http://www.kentooz.com" title="banner 728x90"><img src="https://farm3.staticflickr.com/2929/14681915121_191f465cf5_b.jpg" alt="banner 728x90" title="banner 728x90" height="90" width="728" /></a>', 'rows' => '5', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_ban72890_footer_activated:is(yes),ktz_ban72890_footer_activated:not()', 'section' => 'banner_tab'), array('label' => __('Enable Attachment banner before download button 728x90?', ktz_theme_textdomain), 'id' => 'ktz_attachment728_activated', 'type' => 'radio', 'desc' => __('Please check yes for enable Attachment banner before download button 728x90 and check no for disable Attachment banner before download button 728x90.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'banner_tab'), array('label' => __('Attachment banner before download button(728x90)', ktz_theme_textdomain), 'id' => 'ktz_attachment728', 'type' => 'textarea-simple', 'desc' => __('Fill with banner 728x90 before download button banner in attachment page.', ktz_theme_textdomain), 'std' => '<a href="http://www.kentooz.com" title="banner 728x90"><img src="https://farm3.staticflickr.com/2929/14681915121_191f465cf5_b.jpg" alt="banner 728x90" title="banner 728x90" height="90" width="728" /></a>', 'rows' => '5', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_attachment728_activated:is(yes),ktz_attachment728_activated:not()', 'section' => 'banner_tab'), array('label' => __('Enable Single Header banner (336x280)?', ktz_theme_textdomain), 'id' => 'ktz_ban46860_shead_activated', 'type' => 'radio', 'desc' => __('Please check yes for enable Single Header banner (336x280) and check no for disable Single Header banner (336x280).', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'banner_tab'), array('label' => __('Single Header banner (336x280)', ktz_theme_textdomain), 'id' => 'ktz_ban46860_shead', 'type' => 'textarea-simple', 'desc' => __('Fill with header banner 336x280 in single before title', ktz_theme_textdomain), 'std' => '<a href="http://www.kentooz.com/all-themes" title="Best wordpress themes"><img src="https://farm4.staticflickr.com/3892/14681915171_bf8a910b6b_o.png" alt="banner 300x280" width="336" height="280" title="banner 336x280" /></a>', 'rows' => '5', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_ban46860_shead_activated:is(yes),ktz_ban46860_shead_activated:not()', 'section' => 'banner_tab'), array('label' => __('Enable Single After title banner (336x280)?', ktz_theme_textdomain), 'id' => 'ktz_ban46860_stit_activated', 'type' => 'radio', 'desc' => __('Please check yes for enable Single After title banner (336x280) and check no for disable Single After title banner (336x280).', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'banner_tab'), array('label' => __('Single After title banner (336x280)', ktz_theme_textdomain), 'id' => 'ktz_ban46860_stit', 'type' => 'textarea-simple', 'desc' => __('Fill with after title banner 336x280 in single', ktz_theme_textdomain), 'std' => '<a href="http://www.kentooz.com/all-themes" title="Best wordpress themes"><img src="https://farm4.staticflickr.com/3892/14681915171_bf8a910b6b_o.png" alt="banner 300x280" width="336" height="280" title="banner 336x280" /></a>', 'rows' => '5', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_ban46860_stit_activated:is(yes),ktz_ban46860_stit_activated:not()', 'section' => 'banner_tab'), array('label' => __('Enable Single Footer banner (336x280)?', ktz_theme_textdomain), 'id' => 'ktz_ban46860_sfot_activated', 'type' => 'radio', 'desc' => __('Please check yes for enable Single Footer banner (336x280) and check no for disable Single Footer banner (336x280).', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'banner_tab'), array('label' => __('Single Footer banner (336x280)', ktz_theme_textdomain), 'id' => 'ktz_ban46860_sfot', 'type' => 'textarea-simple', 'desc' => __('Fill with bottom banner 336x280 in single after post', ktz_theme_textdomain), 'std' => '<a href="http://www.kentooz.com/all-themes" title="Best wordpress themes"><img src="https://farm4.staticflickr.com/3892/14681915171_bf8a910b6b_o.png" alt="banner 300x280" width="336" height="280" title="banner 336x280" /></a>', 'rows' => '5', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_ban46860_sfot_activated:is(yes),ktz_ban46860_sfot_activated:not()', 'section' => 'banner_tab'), array('label' => __('Enable Single right banner(160x600)?', ktz_theme_textdomain), 'id' => 'ktz_ban160_single_activated', 'type' => 'radio', 'desc' => __('Please check yes for enable Single right banner(160x600) and check no for disable Single right banner(160x600).', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'banner_tab'), array('label' => __('Single right banner(160x600)', ktz_theme_textdomain), 'id' => 'ktz_ban160_single', 'type' => 'textarea-simple', 'desc' => __('Fill with Single page right banner(160x600)', ktz_theme_textdomain), 'std' => '<a href="#" title="example banner link"><img src="https://farm6.staticflickr.com/5572/14681915051_0bf4684147_o.png" alt="example banner" title="example banner" height="600" width="160"></a>', 'rows' => '5', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_ban160_single_activated:is(yes),ktz_ban160_single_activated:not()', 'section' => 'banner_tab'), array('label' => __('General Layout', ktz_theme_textdomain), 'id' => 'ktz_gen_layout', 'type' => 'radio-image', 'desc' => __('Select layout for your global website.', ktz_theme_textdomain), 'choices' => layout_select(), 'std' => 'box', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'layout_tab'), array('label' => __('Content Layout', ktz_theme_textdomain), 'id' => 'ktz_content_layout', 'type' => 'radio-image', 'desc' => __('Select layout for your content in archive.', ktz_theme_textdomain), 'choices' => contentlay_select(), 'std' => 'layout_gallery', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'layout_tab'), array('label' => __('Sidebar Layout', ktz_theme_textdomain), 'id' => 'ktz_sb_layout', 'type' => 'radio-image', 'desc' => __('Select default sidebar for your global website.', ktz_theme_textdomain), 'choices' => sidebar_select(), 'std' => 'right', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'layout_tab'), array('label' => __('Footer coloum', ktz_theme_textdomain), 'id' => 'ktz_footer_columns', 'type' => 'radio-image', 'desc' => __('Select footer coloums layout, you can select footer coloum layout. Example 1/1 (full), 1/2 : 1/2, etc..', ktz_theme_textdomain), 'choices' => coloum_select(), 'std' => 'onethird_onethird_onethird', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'layout_tab'), array('label' => __('Select color scheme', ktz_theme_textdomain), 'id' => 'ktz_colorscheme', 'type' => 'colorpicker', 'desc' => __('Please select default scheme for your website, by default this kentooz themes use color schemes #0087ff.', ktz_theme_textdomain), 'std' => '#0087ff', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'stylish_tab'), array('label' => 'Body background', 'id' => 'ktz_bodybg', 'type' => 'background', 'desc' => 'This setting background for your website. Please select your background for your background sites.', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'stylish_tab'), array('label' => 'Header background', 'id' => 'ktz_headerbg', 'type' => 'background', 'desc' => 'This setting header background for your website. Please select your background for your header background sites.', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'stylish_tab'), array('label' => __('Select font color logo text', ktz_theme_textdomain), 'id' => 'ktz_colorlogo', 'type' => 'colorpicker', 'desc' => __('If use background dark and use text for logo text, please select default logo text color for your website, by default this kentooz themes use font color #222222.', ktz_theme_textdomain), 'std' => '#222222', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'stylish_tab'), array('label' => __('Select font color logo description', ktz_theme_textdomain), 'id' => 'ktz_colorlogodesc', 'type' => 'colorpicker', 'desc' => __('If use background dark and use text for logo text, please select default logo text description font color for your website, by default this kentooz themes use font color #999999.', ktz_theme_textdomain), 'std' => '#999999', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'stylish_tab'), array('label' => __('CSS File', ktz_theme_textdomain), 'id' => 'ktz_styledefault', 'type' => 'select', 'desc' => __('If your modified your own css in custom.css file in includes/assets/css/custom.css. Of if you have own css file for example style-1.css, upload it in folder includes/assets/css/ so this option will auto detect your css file, after that select file and save changes.', ktz_theme_textdomain), 'choices' => autostylish_select(), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'stylish_tab'), array('label' => 'Sidebars', 'id' => 'ktz_sidebars', 'type' => 'list-item', 'desc' => 'Add Unlimited Sidebars to your website.', 'settings' => array(array('label' => 'Slug', 'id' => 'slug', 'type' => 'text', 'desc' => 'Sidebar Slug "All lowercase and must be unique".', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Description', 'id' => 'description', 'type' => 'textarea-simple', 'desc' => 'Sidebar Description.', 'std' => '', 'rows' => '5', 'post_type' => '', 'taxonomy' => '', 'class' => '')), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'sidebars_tab'), array('label' => __('Enable footer social right footer?', ktz_theme_textdomain), 'id' => 'ktz_head_social_activated', 'type' => 'radio', 'desc' => __('Please check yes for enable footer social and check no for disable footer social.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => __('Enable social shared post?', ktz_theme_textdomain), 'id' => 'ktz_active_shared', 'type' => 'radio', 'desc' => __('Please check yes for enable social shared post and check no for disable shared post.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => __('Facebook application id', ktz_theme_textdomain), 'id' => 'ktz_facebook_app_id', 'type' => 'text', 'desc' => __('Fill with your facebook application id. To add a Facebook Comments Box you will need to create a Facebook App first. Go to https://developers.facebook.com/apps/ and create a new app. Enter a name and define the locale for the app.', ktz_theme_textdomain), 'std' => '226875977396331', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => __('Facebook URL', ktz_theme_textdomain), 'id' => 'ktz_fb_sn', 'type' => 'text', 'desc' => __('Please enter your facebook url here, for example http://facebook.com/kentoozdotcom(use http://).', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => __('Twitter URL', ktz_theme_textdomain), 'id' => 'ktz_tweet_sn', 'type' => 'text', 'desc' => __('Please enter your twitter url here, for example http://twitter.com/g14nnakal(use http://).', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => __('Gplus URL', ktz_theme_textdomain), 'id' => 'ktz_gplus_sn', 'type' => 'text', 'desc' => __('Please enter your google plus url here. For example http://plus.google.com/3894293874219340 (use http://)', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => __('Linkedin URL', ktz_theme_textdomain), 'id' => 'ktz_in_sn', 'type' => 'text', 'desc' => __('Please enter your linkedin url here(use http://).', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => __('Dribble URL', ktz_theme_textdomain), 'id' => 'ktz_dribble_sn', 'type' => 'text', 'desc' => __('Please enter your dribble url here(use http://).', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => __('Flickr URL', ktz_theme_textdomain), 'id' => 'ktz_flickr_sn', 'type' => 'text', 'desc' => __('Please enter your flickr url here(use http://).', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => __('Instagram URL', ktz_theme_textdomain), 'id' => 'ktz_instagram_sn', 'type' => 'text', 'desc' => __('Please enter your Instagram url here(use http://).', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => __('Tumblr URL', ktz_theme_textdomain), 'id' => 'ktz_tumblr_sn', 'type' => 'text', 'desc' => __('Please enter your tumblr url here(use http://).', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => __('Youtube URL', ktz_theme_textdomain), 'id' => 'ktz_youtube_sn', 'type' => 'text', 'desc' => __('Please enter your youtube url here(use http://).', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => __('RSS', ktz_theme_textdomain), 'id' => 'ktz_rss_sn', 'type' => 'radio', 'desc' => __('Please check yes for enable RSS link and check no for disable RSS link.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'social_tab'), array('label' => 'Body Font ( Preview Go to http://www.google.com/fonts )', 'id' => 'ktz_body_font', 'type' => 'typography_body', 'desc' => 'Select your body "Default" font from the available fonts, Fonts are provided via Google Fonts API. You can select style for font too, for live preview you can Go to <a href="http://www.google.com/fonts" rel="nofollow">http://www.google.com/fonts</a>.', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'typography_tab'), array('label' => 'Heading Font ( Preview Go to http://www.google.com/fonts )', 'id' => 'ktz_heading_font', 'type' => 'typography_heading', 'desc' => 'Select your heading "Default" font from the available fonts, Fonts are provided via Google Fonts API. You can select style for font too, for live preview you can Go to <a href="http://www.google.com/fonts" rel="nofollow">http://www.google.com/fonts</a>.', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'typography_tab'), array('label' => __('Enable Facebook comment?', ktz_theme_textdomain), 'id' => 'ktz_facebook_com_activated', 'type' => 'radio', 'desc' => __('Please check yes for enable Facebook comment and check no for disable Facebook comment.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'comment_tab'), array('label' => __('Enable Default comment?', ktz_theme_textdomain), 'id' => 'ktz_def_com_activated', 'type' => 'radio', 'desc' => __('Please check yes for enable Default comment and check no for disable Default comment.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'comment_tab'), array('label' => 'Categories', 'id' => 'ktz_categories', 'type' => 'list-item', 'desc' => __('Add Categories Colors & Icons.', ktz_theme_textdomain), 'settings' => array(array('label' => 'Category', 'id' => 'category', 'type' => 'category-select', 'desc' => __('Select the category', ktz_theme_textdomain), 'choices' => '', 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Color', 'id' => 'color', 'type' => 'colorpicker', 'desc' => __('Pick a category color(default: #d64a2b ).', ktz_theme_textdomain), 'std' => '#d64a2b', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Icon', 'id' => 'icon', 'type' => 'select', 'desc' => __('Choose Your Icon.', ktz_theme_textdomain), 'choices' => ktz_icons_select(), 'std' => 'glyphicon glyphicon-transfer', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => ''), array('label' => 'Category Page Background', 'id' => 'background', 'type' => 'background', 'desc' => __('Upload the background pattern you want for the category page', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '')), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'categories_tab'), array('label' => __('Enable kentooz SEO?', ktz_theme_textdomain), 'id' => 'ktz_seo', 'type' => 'radio', 'desc' => __('Please check yes for enable kentooz SEO and check no for disable kentooz SEO. If you install plugin SEO you must disable this featured. WARNING, If you disable this setting, all setting in seo tabs will not display.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'seo_tab'), array('label' => __('Global SEO Keywords', ktz_theme_textdomain), 'id' => 'ktz_meta_keywords', 'type' => 'textarea-simple', 'desc' => __('This Meta keywords will be used in google search results. If you use plugin SEO please disable SEO featured.', ktz_theme_textdomain), 'std' => 'this is, example,keywords, for, kentooz SEO,', 'rows' => '5', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_seo:is(yes),ktz_seo:not()', 'section' => 'seo_tab'), array('label' => __('Google Webmaster Tools verification code', ktz_theme_textdomain), 'id' => 'ktz_google_verified', 'type' => 'text', 'desc' => __('Enter your verification code Google Webmaster Tools here to add a meta tag to your homepage to verify your site.', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_seo:is(yes),ktz_seo:not()', 'section' => 'seo_tab'), array('label' => __('Bing Webmaster verification code', ktz_theme_textdomain), 'id' => 'ktz_bing_verified', 'type' => 'text', 'desc' => __('Enter your verification code for bing webmaster here to add a meta tag to your homepage to verify your site.', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_seo:is(yes),ktz_seo:not()', 'section' => 'seo_tab'), array('label' => __('Pinterest Site verification code', ktz_theme_textdomain), 'id' => 'ktz_pinterest_verified', 'type' => 'text', 'desc' => __('Enter your verification code for pinterest site here to add a meta tag to your homepage to verify your site.', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_seo:is(yes),ktz_seo:not()', 'section' => 'seo_tab'), array('label' => __('Alexa verification code', ktz_theme_textdomain), 'id' => 'ktz_alexa_verified', 'type' => 'text', 'desc' => __('Enter your verification code for Alexa here to add a meta tag to your homepage to verify your site.', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_seo:is(yes),ktz_seo:not()', 'section' => 'seo_tab'), array('label' => __('Google plus profile', ktz_theme_textdomain), 'id' => 'ktz_gplus_profile', 'type' => 'text', 'desc' => __('Enter your Google Plus Profile URL here to link your sites pages to Google Plus..', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_seo:is(yes),ktz_seo:not()', 'section' => 'seo_tab'), array('label' => __('Enable noindex in category?', ktz_theme_textdomain), 'id' => 'ktz_noindex_category', 'type' => 'radio', 'desc' => __('Please check yes for meta noindex in category and check no for meta noindex in category. Check this for excluding category pages from being crawled. Useful for avoiding duplicate content.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_seo:is(yes),ktz_seo:not()', 'section' => 'seo_tab'), array('label' => __('Enable noindex in date page?', ktz_theme_textdomain), 'id' => 'ktz_noindex_date', 'type' => 'radio', 'desc' => __('Please check yes for meta noindex in date page and check no for meta noindex in date page. Check this for excluding date pages from being crawled. Useful for avoiding duplicate content.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_seo:is(yes),ktz_seo:not()', 'section' => 'seo_tab'), array('label' => __('Enable noindex in author archives?', ktz_theme_textdomain), 'id' => 'ktz_noindex_author', 'type' => 'radio', 'desc' => __('Please check yes for meta noindex in Author Archives and check no for meta noindex in Author Archives. Check this for excluding Author Archive pages from being crawled. Useful for avoiding duplicate content.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_seo:is(yes),ktz_seo:not()', 'section' => 'seo_tab'), array('label' => __('Enable noindex in tag archives?', ktz_theme_textdomain), 'id' => 'ktz_noindex_tag', 'type' => 'radio', 'desc' => __('Please check yes for meta noindex in tag Archives and check no for meta noindex in tag Archives. Check this for excluding tag pages from being crawled. Useful for avoiding duplicate content.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_seo:is(yes),ktz_seo:not()', 'section' => 'seo_tab'), array('label' => __('Enable noindex in Attachment?', ktz_theme_textdomain), 'id' => 'ktz_noindex_attachment', 'type' => 'radio', 'desc' => __('Please check yes for meta noindex in attachment and check no for meta noindex in attachment. Check this for excluding tag pages from being crawled. Useful for avoiding duplicate content.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_seo:is(yes),ktz_seo:not()', 'section' => 'seo_tab'), array('label' => __('Enable AGC?', ktz_theme_textdomain), 'id' => 'ktz_agc_activated', 'type' => 'radio', 'desc' => __('Please check yes for enable AGC(auto generate content) and check no for disable AGC(auto generate content).', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'agc_tab'), array('label' => __('Google API Key', ktz_theme_textdomain), 'id' => 'ktz_googleapi_key', 'type' => 'text', 'desc' => __('Fill with your google API Key. Please signuo https://developers.google.com/loader/signup first for get your google API Key.', ktz_theme_textdomain), 'std' => '', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_agc_activated:is(yes),ktz_agc_activated:not()', 'section' => 'agc_tab'), array('label' => __('Filter bad keyword', ktz_theme_textdomain), 'id' => 'ktz_bad_keyword', 'type' => 'textarea-simple', 'desc' => __('Please filter your bad keyword from your AGC.', ktz_theme_textdomain), 'std' => '"keyword1","keyword2","keyword3"', 'rows' => '5', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_agc_activated:is(yes),ktz_agc_activated:not()', 'section' => 'agc_tab'), array('label' => __('Enable download image button in single?', ktz_theme_textdomain), 'id' => 'ktz_active_download', 'type' => 'radio', 'desc' => __('Please check yes for Enable download image button in single and attachment and check no for disable auto disable download image button in single and attachment.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'other_tab'), array('label' => __('Enable auto description?', ktz_theme_textdomain), 'id' => 'ktz_active_autocontent', 'type' => 'radio', 'desc' => __('Please check yes for enable auto description in single and attachment and check no for disable auto description in single and attachment.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'no', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'other_tab'), array('label' => __('Auto content text before image post (first paragraph)', ktz_theme_textdomain), 'id' => 'ktz_wall_autocontent_firstp', 'type' => 'textarea', 'desc' => __('Auto content text, available filter: %ktzhomeurl%=home url, %ktzblogname%=blogname, %ktzblogdescription%=blog description, %ktzpermalink%=permalink, %ktztitle%=title, %ktzdate%=date, %ktzauthor%=author, %ktzcategory%=category, %ktzblogname%=tag list, %ktzview%=Number view post, %ktzpostformat%=Post format', ktz_theme_textdomain), 'std' => '%ktztitle% is free HD wallpaper. This wallpaper was upload at %ktzdate% upload by %ktzauthor% in %ktzcategory%.', 'rows' => '10', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_active_autocontent:is(yes),ktz_active_autocontent:not()', 'section' => 'other_tab'), array('label' => __('Auto content text after image post (second paragraph)', ktz_theme_textdomain), 'id' => 'ktz_wall_autocontent', 'type' => 'textarea', 'desc' => __('Auto content text, available filter: %ktzhomeurl%=home url, %ktzblogname%=blogname, %ktzblogdescription%=blog description, %ktzpermalink%=permalink, %ktztitle%=title, %ktzdate%=date, %ktzauthor%=author, %ktzcategory%=category, %ktzblogname%=tag list, %ktzview%=Number view post, %ktzpostformat%=Post format', ktz_theme_textdomain), 'std' => 'You can download %ktztitle% in your computer by clicking resolution image in Download by size:. Don\'t forget to rate and comment if you interest with this wallpaper.', 'rows' => '10', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_active_autocontent:is(yes),ktz_active_autocontent:not()', 'section' => 'other_tab'), array('label' => __('Auto content text third paragraph only in attachment', ktz_theme_textdomain), 'id' => 'ktz_wall_autocontent_threep', 'type' => 'textarea', 'desc' => __('Auto content text, available filter: %ktzhomeurl%=home url, %ktzblogname%=blogname, %ktzblogdescription%=blog description, %ktzpermalink%=permalink, %ktztitle%=title, %ktzdate%=date, %ktzauthor%=author, %ktzcategory%=category, %ktzblogname%=tag list, %ktzview%=Number view post, %ktzpostformat%=Post format', ktz_theme_textdomain), 'std' => 'This is third paragraph auto content for attahcment title: %ktztitle%. You can make unique content for attachment but automatic and easy.', 'rows' => '10', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_active_autocontent:is(yes),ktz_active_autocontent:not()', 'section' => 'other_tab'), array('label' => __('Enable auto read more?', ktz_theme_textdomain), 'id' => 'ktz_active_automore', 'type' => 'radio', 'desc' => __('Please check yes for enable auto read more and check no for disable auto read more.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'other_tab'), array('label' => __('Word display for auto read more', ktz_theme_textdomain), 'id' => 'ktz_automore_count', 'type' => 'text', 'desc' => __('Fill with number how much word will be display in auto read more.', ktz_theme_textdomain), 'std' => '35', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_active_automore:is(yes),ktz_active_automore:not()', 'section' => 'other_tab'), array('label' => __('Enable related post?', ktz_theme_textdomain), 'id' => 'ktz_active_related', 'type' => 'radio', 'desc' => __('Please check yes for enable related post in single and check no for disable related post in single.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'other_tab'), array('label' => __('Related by taxonomy', ktz_theme_textdomain), 'id' => 'ktz_taxonomy_relpost', 'type' => 'select', 'desc' => __('Please select what do you want related by the taxonomy.', ktz_theme_textdomain), 'choices' => taxonomy_select(), 'std' => 'category', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'condition' => 'ktz_active_related:is(yes),ktz_active_related:not()', 'section' => 'other_tab'), array('label' => __('Enable authorbox?', ktz_theme_textdomain), 'id' => 'ktz_active_autbox', 'type' => 'radio', 'desc' => __('Please check yes for enable authorbox in single and check no for disable authorbox in single.', ktz_theme_textdomain), 'choices' => array(array('label' => 'Yes', 'value' => 'yes'), array('label' => 'No', 'value' => 'no')), 'std' => 'yes', 'rows' => '', 'post_type' => '', 'taxonomy' => '', 'class' => '', 'section' => 'other_tab')));
    /* allow settings to be filtered before saving */
    $custom_settings = apply_filters('option_tree_settings_args', $custom_settings);
    /* settings are not the same update the DB */
    if ($saved_settings !== $custom_settings) {
        update_option('option_tree_settings', $custom_settings);
    }
}
Ejemplo n.º 2
0
function status_editor($a, $x, $popup = false)
{
    $o = '';
    $geotag = $x['allow_location'] ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : '';
    $plaintext = true;
    //	if(feature_enabled(local_channel(),'richtext'))
    //		$plaintext = false;
    $voting = feature_enabled(local_channel(), 'consensus_tools');
    $mimeselect = '';
    if (array_key_exists('mimetype', $x) && $x['mimetype']) {
        if ($x['mimetype'] != 'text/bbcode') {
            $plaintext = true;
        }
        if ($x['mimetype'] === 'choose') {
            $mimeselect = mimetype_select($x['profile_uid']);
        } else {
            $mimeselect = '<input type="hidden" name="mimetype" value="' . $x['mimetype'] . '" />';
        }
    }
    $layoutselect = '';
    if (array_key_exists('layout', $x) && $x['layout']) {
        if ($x['layout'] === 'choose') {
            $layoutselect = layout_select($x['profile_uid']);
        } else {
            $layoutselect = '<input type="hidden" name="layout_mid" value="' . $x['layout'] . '" />';
        }
    }
    if (array_key_exists('channel_select', $x) && $x['channel_select']) {
        require_once 'include/identity.php';
        $id_select = identity_selector();
    } else {
        $id_select = '';
    }
    $webpage = x($x, 'webpage') ? $x['webpage'] : '';
    $tpl = get_markup_template('jot-header.tpl');
    $a->page['htmlhead'] .= replace_macros($tpl, array('$newpost' => 'true', '$baseurl' => $a->get_baseurl(true), '$editselect' => $plaintext ? 'none' : '/(profile-jot-text|prvmail-text)/', '$geotag' => $geotag, '$nickname' => $x['nickname'], '$ispublic' => t('Visible to <strong>everybody</strong>'), '$linkurl' => t('Please enter a link URL:'), '$vidurl' => t('Please enter a video link/URL:'), '$audurl' => t('Please enter an audio link/URL:'), '$term' => t('Tag term:'), '$fileas' => t('Save to Folder:'), '$whereareu' => t('Where are you right now?'), '$expireswhen' => t('Expires YYYY-MM-DD HH:MM')));
    $tpl = get_markup_template('jot.tpl');
    $jotplugins = '';
    $jotnets = '';
    $preview = t('Preview');
    //	$preview = ((feature_enabled($x['profile_uid'],'preview')) ? t('Preview') : '');
    if (x($x, 'nopreview')) {
        $preview = '';
    }
    $defexpire = ($z = get_pconfig($x['profile_uid'], 'system', 'default_post_expire')) && !$webpage ? $z : '';
    if ($defexpire) {
        $defexpire = datetime_convert('UTC', date_default_timezone_get(), $defexpire, 'Y-m-d H:i');
    }
    $cipher = get_pconfig($x['profile_uid'], 'system', 'default_cipher');
    if (!$cipher) {
        $cipher = 'aes256';
    }
    call_hooks('jot_tool', $jotplugins);
    call_hooks('jot_networks', $jotnets);
    $o .= replace_macros($tpl, array('$return_path' => x($x, 'return_path') ? $x['return_path'] : $a->query_string, '$action' => $a->get_baseurl(true) . '/item', '$share' => x($x, 'button') ? $x['button'] : t('Share'), '$webpage' => $webpage, '$placeholdpagetitle' => x($x, 'ptlabel') ? $x['ptlabel'] : t('Page link title'), '$pagetitle' => x($x, 'pagetitle') ? $x['pagetitle'] : '', '$id_select' => $id_select, '$id_seltext' => t('Post as'), '$writefiles' => perm_is_allowed($x['profile_uid'], get_observer_hash(), 'post_photos') || perm_is_allowed($x['profile_uid'], get_observer_hash(), 'write_storage'), '$bold' => t('Bold'), '$italic' => t('Italic'), '$underline' => t('Underline'), '$quote' => t('Quote'), '$code' => t('Code'), '$upload' => t('Upload photo'), '$shortupload' => t('upload photo'), '$attach' => t('Attach file'), '$shortattach' => t('attach file'), '$weblink' => t('Insert web link'), '$shortweblink' => t('web link'), '$video' => t('Insert video link'), '$shortvideo' => t('video link'), '$audio' => t('Insert audio link'), '$shortaudio' => t('audio link'), '$setloc' => t('Set your location'), '$shortsetloc' => t('set location'), '$voting' => t('Toggle voting'), '$feature_voting' => $voting, '$consensus' => 0, '$noloc' => get_pconfig($x['profile_uid'], 'system', 'use_browser_location') ? t('Clear browser location') : '', '$shortnoloc' => t('clear location'), '$title' => x($x, 'title') ? htmlspecialchars($x['title'], ENT_COMPAT, 'UTF-8') : '', '$placeholdertitle' => t('Title (optional)'), '$catsenabled' => feature_enabled($x['profile_uid'], 'categories') && !$webpage ? 'categories' : '', '$category' => "", '$placeholdercategory' => t('Categories (optional, comma-separated list)'), '$wait' => t('Please wait'), '$permset' => t('Permission settings'), '$shortpermset' => t('permissions'), '$ptyp' => $notes_cid ? 'note' : 'wall', '$content' => x($x, 'body') ? htmlspecialchars($x['body'], ENT_COMPAT, 'UTF-8') : '', '$post_id' => '', '$baseurl' => $a->get_baseurl(true), '$defloc' => $x['default_location'], '$visitor' => $x['visitor'], '$public' => t('Public post'), '$jotnets' => $jotnets, '$emtitle' => t('Example: bob@example.com, mary@example.com'), '$lockstate' => $x['lockstate'], '$acl' => $x['acl'], '$mimeselect' => $mimeselect, '$layoutselect' => $layoutselect, '$showacl' => array_key_exists('showacl', $x) ? $x['showacl'] : true, '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], '$preview' => $preview, '$source' => x($x, 'source') ? $x['source'] : '', '$jotplugins' => $jotplugins, '$defexpire' => $defexpire, '$feature_expire' => feature_enabled($x['profile_uid'], 'content_expire') && !$webpage ? true : false, '$expires' => t('Set expiration date'), '$feature_encrypt' => feature_enabled($x['profile_uid'], 'content_encrypt') && !$webpage ? true : false, '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, '$expiryModalOK' => t('OK'), '$expiryModalCANCEL' => t('Cancel')));
    if ($popup === true) {
        $o = '<div id="jot-popup" style="display:none">' . $o . '</div>';
    }
    return $o;
}
Ejemplo n.º 3
0
function editwebpage_content(&$a)
{
    if (!App::$profile) {
        notice(t('Requested profile is not available.') . EOL);
        App::$error = 404;
        return;
    }
    $which = argv(1);
    $uid = local_channel();
    $owner = 0;
    $channel = null;
    $observer = App::get_observer();
    $channel = App::get_channel();
    if (App::$is_sys && is_site_admin()) {
        $sys = get_sys_channel();
        if ($sys && intval($sys['channel_id'])) {
            $uid = $owner = intval($sys['channel_id']);
            $channel = $sys;
            $observer = $sys;
        }
    }
    if (!$owner) {
        // Figure out who the page owner is.
        $r = q("select channel_id from channel where channel_address = '%s'", dbesc($which));
        if ($r) {
            $owner = intval($r[0]['channel_id']);
        }
    }
    $ob_hash = $observer ? $observer['xchan_hash'] : '';
    if (!perm_is_allowed($owner, $ob_hash, 'write_pages')) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $is_owner = $uid && $uid == $owner ? true : false;
    $o = '';
    // Figure out which post we're editing
    $post_id = argc() > 2 ? intval(argv(2)) : 0;
    if (!$post_id) {
        notice(t('Item not found') . EOL);
        return;
    }
    $ob_hash = $observer ? $observer['xchan_hash'] : '';
    $perms = get_all_perms($owner, $ob_hash);
    if (!$perms['write_pages']) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    // We've already figured out which item we want and whose copy we need,
    // so we don't need anything fancy here
    $sql_extra = item_permissions_sql($owner);
    $itm = q("SELECT * FROM `item` WHERE `id` = %d and uid = %s {$sql_extra} LIMIT 1", intval($post_id), intval($owner));
    if (!$itm) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    if (intval($itm[0]['item_obscured'])) {
        $key = get_config('system', 'prvkey');
        if ($itm[0]['title']) {
            $itm[0]['title'] = crypto_unencapsulate(json_decode_plus($itm[0]['title']), $key);
        }
        if ($itm[0]['body']) {
            $itm[0]['body'] = crypto_unencapsulate(json_decode_plus($itm[0]['body']), $key);
        }
    }
    $item_id = q("select * from item_id where service = 'WEBPAGE' and iid = %d limit 1", intval($itm[0]['id']));
    if ($item_id) {
        $page_title = $item_id[0]['sid'];
    }
    $plaintext = true;
    $mimetype = $itm[0]['mimetype'];
    if ($mimetype === 'application/x-php') {
        if (!$uid || $uid != $itm[0]['uid']) {
            notice(t('Permission denied.') . EOL);
            return;
        }
    }
    $mimeselect = '';
    if ($mimetype != 'text/bbcode') {
        $plaintext = true;
    }
    if (get_config('system', 'page_mimetype')) {
        $mimeselect = '<input type="hidden" name="mimetype" value="' . $mimetype . '" />';
    } else {
        $mimeselect = mimetype_select($itm[0]['uid'], $mimetype);
    }
    $layout = get_config('system', 'page_layout');
    if ($layout) {
        $layoutselect = '<input type="hidden" name="layout_mid" value="' . $layout . '" />';
    } else {
        $layoutselect = layout_select($itm[0]['uid'], $itm[0]['layout_mid']);
    }
    App::$page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array('$baseurl' => z_root(), '$editselect' => $plaintext ? 'none' : '/(profile-jot-text|prvmail-text)/', '$pretext' => '', '$ispublic' => '&nbsp;', '$geotag' => $geotag, '$nickname' => $channel['channel_address'], '$confirmdelete' => t('Delete webpage?'), '$bbco_autocomplete' => $mimetype == 'text/bbcode' ? 'bbcode' : ''));
    $tpl = get_markup_template("jot.tpl");
    $jotplugins = '';
    $jotnets = '';
    call_hooks('jot_tool', $jotplugins);
    call_hooks('jot_networks', $jotnets);
    // FIXME A return path with $_SESSION doesn't always work for observer - it may WSoD
    // instead of loading a sensible page.  So, send folk to the webpage list.
    $rp = 'webpages/' . $which;
    $editor = replace_macros($tpl, array('$return_path' => $rp, '$webpage' => ITEM_TYPE_WEBPAGE, '$placeholdpagetitle' => t('Page link title'), '$pagetitle' => $page_title, '$writefiles' => perm_is_allowed($owner, get_observer_hash(), 'write_storage'), '$action' => 'item', '$share' => t('Edit'), '$bold' => t('Bold'), '$italic' => t('Italic'), '$underline' => t('Underline'), '$quote' => t('Quote'), '$code' => t('Code'), '$upload' => t('Upload photo'), '$attach' => t('Attach file'), '$weblink' => t('Insert web link'), '$youtube' => t('Insert YouTube video'), '$video' => t('Insert Vorbis [.ogg] video'), '$audio' => t('Insert Vorbis [.ogg] audio'), '$setloc' => t('Set your location'), '$noloc' => get_pconfig($uid, 'system', 'use_browser_location') ? t('Clear browser location') : '', '$wait' => t('Please wait'), '$permset' => t('Permission settings'), '$ptyp' => $itm[0]['type'], '$content' => undo_post_tagging($itm[0]['body']), '$post_id' => $post_id, '$baseurl' => z_root(), '$defloc' => $itm[0]['location'], '$visitor' => $is_owner ? true : false, '$acl' => populate_acl($itm[0], false), '$showacl' => $is_owner ? true : false, '$public' => t('Public post'), '$jotnets' => $jotnets, '$mimeselect' => $mimeselect, '$layoutselect' => $layoutselect, '$title' => htmlspecialchars($itm[0]['title'], ENT_COMPAT, 'UTF-8'), '$placeholdertitle' => t('Title (optional)'), '$category' => '', '$placeholdercategory' => t('Categories (optional, comma-separated list)'), '$emtitle' => t('Example: bob@example.com, mary@example.com'), 'lockstate' => strlen($itm[0]['allow_cid']) || strlen($itm[0]['allow_gid']) || strlen($itm[0]['deny_cid']) || strlen($itm[0]['deny_gid']) ? 'lock' : 'unlock', '$bang' => '', '$profile_uid' => intval($owner), '$preview' => t('Preview'), '$jotplugins' => $jotplugins, '$sourceapp' => App::$sourcename, '$defexpire' => '', '$feature_expire' => false, '$expires' => t('Set expiration date'), '$bbcode' => $mimetype == 'text/bbcode' ? true : false));
    $o .= replace_macros(get_markup_template('edpost_head.tpl'), array('$title' => t('Edit Webpage'), '$delete' => $itm[0]['author_xchan'] === $ob_hash || $itm[0]['owner_xchan'] === $ob_hash ? t('Delete') : false, '$editor' => $editor, '$id' => $itm[0]['id']));
    return $o;
}
Ejemplo n.º 4
0
function editwebpage_content(&$a)
{
    // We first need to figure out who owns the webpage, grab it from an argument
    $which = argv(1);
    // $a->get_channel() and stuff don't work here, so we've got to find the owner for ourselves.
    $r = q("select channel_id from channel where channel_address = '%s'", dbesc($which));
    if ($r) {
        $owner = intval($r[0]['channel_id']);
        //logger('owner: ' . print_r($owner,true));
    }
    $is_owner = local_user() && local_user() == $owner ? true : false;
    $o = '';
    // Figure out which post we're editing
    $post_id = argc() > 2 ? intval(argv(2)) : 0;
    if (!$post_id) {
        notice(t('Item not found') . EOL);
        return;
    }
    // Now we've got a post and an owner, let's find out if we're allowed to edit it
    $observer = $a->get_observer();
    $ob_hash = $observer ? $observer['xchan_hash'] : '';
    $perms = get_all_perms($owner, $ob_hash);
    if (!$perms['write_pages']) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    // We've already figured out which item we want and whose copy we need, so we don't need anything fancy here
    $itm = q("SELECT * FROM `item` WHERE `id` = %d and uid = %s LIMIT 1", intval($post_id), intval($owner));
    if ($itm[0]['item_flags'] & ITEM_OBSCURED) {
        $key = get_config('system', 'prvkey');
        if ($itm[0]['title']) {
            $itm[0]['title'] = crypto_unencapsulate(json_decode_plus($itm[0]['title']), $key);
        }
        if ($itm[0]['body']) {
            $itm[0]['body'] = crypto_unencapsulate(json_decode_plus($itm[0]['body']), $key);
        }
    }
    $item_id = q("select * from item_id where service = 'WEBPAGE' and iid = %d limit 1", $itm[0]['id']);
    if ($item_id) {
        $page_title = $item_id[0]['sid'];
    }
    $plaintext = true;
    //	if(feature_enabled($itm[0]['uid'],'richtext'))
    //		$plaintext = false;
    $mimetype = $itm[0]['mimetype'];
    if ($mimetype === 'application/x-php') {
        if (!local_user() || local_user() != $itm[0]['uid']) {
            notice(t('Permission denied.') . EOL);
            return;
        }
    }
    $mimeselect = '';
    if ($mimetype != 'text/bbcode') {
        $plaintext = true;
    }
    if (get_config('system', 'page_mimetype')) {
        $mimeselect = '<input type="hidden" name="mimetype" value="' . $mimetype . '" />';
    } else {
        $mimeselect = mimetype_select($itm[0]['uid'], $mimetype);
    }
    $layout = get_config('system', 'page_layout');
    if ($layout) {
        $layoutselect = '<input type="hidden" name="layout_mid" value="' . $layout . '" />';
    } else {
        $layoutselect = layout_select($itm[0]['uid'], $itm[0]['layout_mid']);
    }
    $o .= replace_macros(get_markup_template('edpost_head.tpl'), array('$title' => t('Edit Webpage')));
    $a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array('$baseurl' => $a->get_baseurl(), '$editselect' => $plaintext ? 'none' : '/(profile-jot-text|prvmail-text)/', '$ispublic' => '&nbsp;', '$geotag' => $geotag, '$nickname' => $a->user['nickname'], '$confirmdelete' => t('Delete webpage?')));
    $tpl = get_markup_template("jot.tpl");
    $jotplugins = '';
    $jotnets = '';
    call_hooks('jot_tool', $jotplugins);
    call_hooks('jot_networks', $jotnets);
    $channel = $a->get_channel();
    //$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
    //FIXME A return path with $_SESSION doesn't always work for observer - it may WSoD instead of loading a sensible page.  So, send folk to the webpage list.
    $rp = 'webpages/' . $which;
    $o .= replace_macros($tpl, array('$return_path' => $rp, '$webpage' => ITEM_WEBPAGE, '$placeholdpagetitle' => t('Page link title'), '$pagetitle' => $page_title, '$action' => 'item', '$share' => t('Edit'), '$upload' => t('Upload photo'), '$attach' => t('Attach file'), '$weblink' => t('Insert web link'), '$youtube' => t('Insert YouTube video'), '$video' => t('Insert Vorbis [.ogg] video'), '$audio' => t('Insert Vorbis [.ogg] audio'), '$setloc' => t('Set your location'), '$noloc' => t('Clear browser location'), '$wait' => t('Please wait'), '$permset' => t('Permission settings'), '$ptyp' => $itm[0]['type'], '$content' => undo_post_tagging($itm[0]['body']), '$post_id' => $post_id, '$baseurl' => $a->get_baseurl(), '$defloc' => $itm[0]['location'], '$visitor' => $is_owner ? true : false, '$acl' => populate_acl($itm[0], false), '$showacl' => $is_owner ? true : false, '$public' => t('Public post'), '$jotnets' => $jotnets, '$mimeselect' => $mimeselect, '$layoutselect' => $layoutselect, '$title' => htmlspecialchars($itm[0]['title'], ENT_COMPAT, 'UTF-8'), '$placeholdertitle' => t('Set title'), '$category' => '', '$placeholdercategory' => t('Categories (comma-separated list)'), '$emtitle' => t('Example: bob@example.com, mary@example.com'), 'lockstate' => strlen($itm[0]['allow_cid']) || strlen($itm[0]['allow_gid']) || strlen($itm[0]['deny_cid']) || strlen($itm[0]['deny_gid']) ? 'lock' : 'unlock', '$bang' => '', '$profile_uid' => intval($owner), '$preview' => feature_enabled(local_user(), 'preview') ? t('Preview') : '', '$jotplugins' => $jotplugins, '$sourceapp' => t($a->sourcename), '$defexpire' => '', '$feature_expire' => false, '$expires' => t('Set expiration date')));
    $ob = get_observer_hash();
    if ($itm[0]['author_xchan'] === $ob || $itm[0]['owner_xchan'] === $ob) {
        $o .= '<br /><br /><a class="page-delete-link" href="item/drop/' . $itm[0]['id'] . '" >' . t('Delete Webpage') . '</a><br />';
    }
    return $o;
}
Ejemplo n.º 5
0
/**
 * This is our general purpose content editor. 
 * It was once nicknamed "jot" and you may see references to "jot" littered throughout the code.
 * They are referring to the content editor or components thereof. 
 */
function status_editor($a, $x, $popup = false)
{
    $o = '';
    $c = channelx_by_n($x['profile_uid']);
    if ($c && $c['channel_moved']) {
        return $o;
    }
    $plaintext = true;
    //	if(feature_enabled(local_channel(),'richtext'))
    //		$plaintext = false;
    $feature_voting = feature_enabled($x['profile_uid'], 'consensus_tools');
    if (x($x, 'hide_voting')) {
        $feature_voting = false;
    }
    $feature_expire = feature_enabled($x['profile_uid'], 'content_expire') && !$webpage ? true : false;
    if (x($x, 'hide_expire')) {
        $feature_expire = false;
    }
    $feature_future = feature_enabled($x['profile_uid'], 'delayed_posting') && !$webpage ? true : false;
    if (x($x, 'hide_future')) {
        $feature_future = false;
    }
    $geotag = $x['allow_location'] ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : '';
    $setloc = t('Set your location');
    $clearloc = get_pconfig($x['profile_uid'], 'system', 'use_browser_location') ? t('Clear browser location') : '';
    if (x($x, 'hide_location')) {
        $geotag = $setloc = $clearloc = '';
    }
    $mimetype = x($x, 'mimetype') ? $x['mimetype'] : 'text/bbcode';
    $mimeselect = x($x, 'mimeselect') ? $x['mimeselect'] : false;
    if ($mimeselect) {
        $mimeselect = mimetype_select($x['profile_uid'], $mimetype);
    } else {
        $mimeselect = '<input type="hidden" name="mimetype" value="' . $mimetype . '" />';
    }
    $weblink = $mimetype === 'text/bbcode' ? t('Insert web link') : false;
    if (x($x, 'hide_weblink')) {
        $weblink = false;
    }
    $embedPhotos = t('Embed image from photo albums');
    $writefiles = $mimetype === 'text/bbcode' ? perm_is_allowed($x['profile_uid'], get_observer_hash(), 'write_storage') : false;
    if (x($x, 'hide_attach')) {
        $writefiles = false;
    }
    $layout = x($x, 'layout') ? $x['layout'] : '';
    $layoutselect = x($x, 'layoutselect') ? $x['layoutselect'] : false;
    if ($layoutselect) {
        $layoutselect = layout_select($x['profile_uid'], $layout);
    } else {
        $layoutselect = '<input type="hidden" name="layout_mid" value="' . $layout . '" />';
    }
    if (array_key_exists('channel_select', $x) && $x['channel_select']) {
        require_once 'include/channel.php';
        $id_select = identity_selector();
    } else {
        $id_select = '';
    }
    $webpage = x($x, 'webpage') ? $x['webpage'] : '';
    $tpl = get_markup_template('jot-header.tpl');
    App::$page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => z_root(), '$editselect' => $plaintext ? 'none' : '/(profile-jot-text|prvmail-text)/', '$pretext' => x($x, 'pretext') ? $x['pretext'] : '', '$geotag' => $geotag, '$nickname' => $x['nickname'], '$linkurl' => t('Please enter a link URL:'), '$term' => t('Tag term:'), '$whereareu' => t('Where are you right now?'), '$editor_autocomplete' => x($x, 'editor_autocomplete') ? $x['editor_autocomplete'] : '', '$bbco_autocomplete' => x($x, 'bbco_autocomplete') ? $x['bbco_autocomplete'] : '', '$modalchooseimages' => t('Choose images to embed'), '$modalchoosealbum' => t('Choose an album'), '$modaldiffalbum' => t('Choose a different album...'), '$modalerrorlist' => t('Error getting album list'), '$modalerrorlink' => t('Error getting photo link'), '$modalerroralbum' => t('Error getting album')));
    $tpl = get_markup_template('jot.tpl');
    $jotplugins = '';
    $preview = t('Preview');
    if (x($x, 'hide_preview')) {
        $preview = '';
    }
    $defexpire = ($z = get_pconfig($x['profile_uid'], 'system', 'default_post_expire')) && !$webpage ? $z : '';
    if ($defexpire) {
        $defexpire = datetime_convert('UTC', date_default_timezone_get(), $defexpire, 'Y-m-d H:i');
    }
    $defpublish = ($z = get_pconfig($x['profile_uid'], 'system', 'default_post_publish')) && !$webpage ? $z : '';
    if ($defpublish) {
        $defpublish = datetime_convert('UTC', date_default_timezone_get(), $defpublish, 'Y-m-d H:i');
    }
    $cipher = get_pconfig($x['profile_uid'], 'system', 'default_cipher');
    if (!$cipher) {
        $cipher = 'aes256';
    }
    call_hooks('jot_tool', $jotplugins);
    $o .= replace_macros($tpl, array('$return_path' => x($x, 'return_path') ? $x['return_path'] : App::$query_string, '$action' => z_root() . '/item', '$share' => x($x, 'button') ? $x['button'] : t('Share'), '$webpage' => $webpage, '$placeholdpagetitle' => x($x, 'ptlabel') ? $x['ptlabel'] : t('Page link name'), '$pagetitle' => x($x, 'pagetitle') ? $x['pagetitle'] : '', '$id_select' => $id_select, '$id_seltext' => t('Post as'), '$writefiles' => $writefiles, '$bold' => t('Bold'), '$italic' => t('Italic'), '$underline' => t('Underline'), '$quote' => t('Quote'), '$code' => t('Code'), '$attach' => t('Attach file'), '$weblink' => $weblink, '$embedPhotos' => $embedPhotos, '$embedPhotosModalTitle' => t('Embed an image from your albums'), '$embedPhotosModalCancel' => t('Cancel'), '$embedPhotosModalOK' => t('OK'), '$setloc' => $setloc, '$voting' => t('Toggle voting'), '$feature_voting' => $feature_voting, '$consensus' => 0, '$clearloc' => $clearloc, '$title' => x($x, 'title') ? htmlspecialchars($x['title'], ENT_COMPAT, 'UTF-8') : '', '$placeholdertitle' => x($x, 'placeholdertitle') ? $x['placeholdertitle'] : t('Title (optional)'), '$catsenabled' => feature_enabled($x['profile_uid'], 'categories') && !$webpage ? 'categories' : '', '$category' => x($x, 'category') ? $x['category'] : '', '$placeholdercategory' => t('Categories (optional, comma-separated list)'), '$permset' => t('Permission settings'), '$ptyp' => x($x, 'ptyp') ? $x['ptyp'] : '', '$content' => x($x, 'body') ? htmlspecialchars($x['body'], ENT_COMPAT, 'UTF-8') : '', '$attachment' => x($x, 'attachment') ? $x['attachment'] : '', '$post_id' => x($x, 'post_id') ? $x['post_id'] : '', '$defloc' => $x['default_location'], '$visitor' => $x['visitor'], '$lockstate' => $x['lockstate'], '$acl' => $x['acl'], '$mimeselect' => $mimeselect, '$layoutselect' => $layoutselect, '$showacl' => array_key_exists('showacl', $x) ? $x['showacl'] : true, '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], '$preview' => $preview, '$source' => x($x, 'source') ? $x['source'] : '', '$jotplugins' => $jotplugins, '$defexpire' => $defexpire, '$feature_expire' => $feature_expire, '$expires' => t('Set expiration date'), '$defpublish' => $defpublish, '$feature_future' => $feature_future, '$future_txt' => t('Set publish date'), '$feature_encrypt' => feature_enabled($x['profile_uid'], 'content_encrypt') && !$webpage ? true : false, '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, '$expiryModalOK' => t('OK'), '$expiryModalCANCEL' => t('Cancel'), '$expanded' => x($x, 'expanded') ? $x['expanded'] : false, '$bbcode' => x($x, 'bbcode') ? $x['bbcode'] : false));
    if ($popup === true) {
        $o = '<div id="jot-popup" style="display:none">' . $o . '</div>';
    }
    return $o;
}