_e("Default Tags: ", "tdomf"); ?> </label><br/> <small><?php _e("These tags will be added to any post submitted using this form. Separate multiple tags with commas: cats, pet food, dogs", "tdomf"); ?> </small><br/> <input type="textfield" id="tags-default" name="tags-default" size='40' value="<?php echo htmlentities($options['default'], ENT_QUOTES, get_bloginfo('charset')); ?> " /> </div> <?php } tdomf_register_form_widget_control('tags', __('Tags', 'tdomf'), 'tdomf_widget_tags_control', 500, 300, array("new-post")); //////////////////////// // Preview tags // function tdomf_widget_tags_preview($args) { extract($args); $options = tdomf_widget_tags_options($tdomf_form_id); if ($options['user']) { if (isset($tags) && !empty($tags)) { $output = $before_widget; if ($options['title'] != '') { $output .= $before_title . $options['title'] . $after_title; } $output .= sprintf(__("<b>Post will be sumbmitted with these tags</b>:<br/>%s", "tdomf"), strip_tags($tags)); $output .= $after_widget;
/** * Start widget * * @access public */ function start() { $retVal = false; if (!$this->started || !$this->internalName || !$this->displayName) { $retVal = true; if ($this->multipleInstances) { add_action('tdomf_generate_form_start', array($this, '_multipleInstancesInit'), 10, 2); add_action('tdomf_create_post_start', array($this, '_multipleInstancesInit'), 10, 2); add_action('tdomf_control_form_start', array($this, '_multipleInstancesInit'), 10, 2); add_action('tdomf_preview_form_start', array($this, '_multipleInstancesInit'), 10, 2); add_action('tdomf_validate_form_start', array($this, '_multipleInstancesInit'), 10, 2); add_action('tdomf_control_form_start', array($this, '_multipleInstancesHandler'), 10, 2); add_action('tdomf_widget_page_bottom', array($this, '_multipleInstancesForm'), 10, 2); add_action('tdomf_upload_inline_form_start', array($this, '_multipleInstancesInit'), 10, 2); // for multiple instances, init is handled in _multipleInstancesInit function } else { tdomf_register_form_widget($this->internalName, $this->displayName, array($this, '_form'), $this->modes); if ($this->hack) { tdomf_register_form_widget_hack($this->internalName, $this->displayName, array($this, '_formHack'), $this->modes); } if ($this->control) { tdomf_register_form_widget_control($this->internalName, $this->displayName, array($this, '_control'), $this->controlWidth, $this->controlHeight, $this->modes); } if ($this->preview) { tdomf_register_form_widget_preview($this->internalName, $this->displayName, array($this, '_preview'), $this->modes); } if ($this->previewHack) { tdomf_register_form_widget_preview_hack($this->internalName, $this->displayName, array($this, '_previewHack'), $this->modes); } if ($this->validate) { tdomf_register_form_widget_validate($this->internalName, $this->displayName, array($this, '_validate'), $this->modes); } if ($this->post) { tdomf_register_form_widget_post($this->internalName, $this->displayName, array($this, '_post'), $this->modes); } if ($this->adminEmail) { tdomf_register_form_widget_adminemail($this->internalName, $this->displayName, array($this, '_adminEmail'), $this->modes); } if ($this->adminError) { tdomf_register_form_widget_admin_error($this->internalName, $this->displayName, array($this, '_adminError'), $this->modes); } } } return $retVal; }
function tdomf_widget_categories_init($form_id, $mode) { if (tdomf_form_exists($form_id) && strpos($mode, 'new-post') !== false) { $count = tdomf_get_option_widget('tdomf_categories_widget_count', $form_id); $max = tdomf_get_option_form(TDOMF_OPTION_WIDGET_INSTANCES, $form_id); if ($max <= 1) { $count = 1; } else { if ($count > $max + 1) { $count = $max + 1; } } tdomf_register_form_widget("categories", "Categories 1", 'tdomf_widget_categories', array(), 1); tdomf_register_form_widget_hack("categories", "Categories 1", 'tdomf_widget_categories', array(), 1); tdomf_register_form_widget_control("categories", "Categories 1", 'tdomf_widget_categories_control', 370, 610, array(), 1); tdomf_register_form_widget_preview("categories", "Categories 1", 'tdomf_widget_categories_preview', array(), 1); tdomf_register_form_widget_preview_hack("categories", "Categories 1", 'tdomf_widget_categories_preview_hack', array(), 1); tdomf_register_form_widget_post("categories", "Categories 1", 'tdomf_widget_categories_post', array(), 1); tdomf_register_form_widget_adminemail("categories", "Categories 1", 'tdomf_widget_categories_adminemail', array(), 1); tdomf_register_form_widget_admin_error("categories", "Categories 1", 'tdomf_widget_categories_admin_error', array(), 1); for ($i = 2; $i <= $count; $i++) { tdomf_register_form_widget("categories-{$i}", "Categories {$i}", 'tdomf_widget_categories', array(), $i); tdomf_register_form_widget_hack("categories-{$i}", "Categories {$i}", 'tdomf_widget_categories', array(), $i); tdomf_register_form_widget_control("categories-{$i}", "Categories {$i}", 'tdomf_widget_categories_control', 370, 610, array(), $i); tdomf_register_form_widget_preview("categories-{$i}", "Categories {$i}", 'tdomf_widget_categories_preview', array(), $i); tdomf_register_form_widget_preview_hack("categories-{$i}", "Categories {$i}", 'tdomf_widget_categories_preview_hack', array(), $i); tdomf_register_form_widget_post("categories-{$i}", "Categories {$i}", 'tdomf_widget_categories_post', array(), $i); tdomf_register_form_widget_adminemail("categories-{$i}", "Categories {$i}", 'tdomf_widget_categories_adminemail', array(), $i); tdomf_register_form_widget_admin_error("categories-{$i}", "Categories {$i}", 'tdomf_widget_categories_admin_error', array(), $i); } } }
_e("Use these options to allow submitters to set if they want comments or pings on their submission. This will overwrite any other configuration.", "tdomf"); ?> </small> <br/> <input type="checkbox" name="comments-user-comments" id="comments-user-comments" <?php if ($options['user-comments']) { echo "checked"; } ?> > <label for="overwrite" style="line-height:35px;"><?php _e("Submitter can choose to allow Comments", "tdomf"); ?> </label> <br/> <input type="checkbox" name="comments-user-pings" id="comments-user-pings" <?php if ($options['user-pings']) { echo "checked"; } ?> > <label for="overwrite" style="line-height:35px;"><?php _e("Submitter can choose to allow Pings and Trackbacks", "tdomf"); ?> </label> </div> <?php } tdomf_register_form_widget_control('comments', __('Comments Management', "tdomf"), 'tdomf_widget_comments_control', 700, 400, $modes = array('new'));
<br/> <input type="checkbox" name="subscribe_to_comments-always_subscribe" id="subscribe_to_comments-always_subscribe" <?php if ($options['always_subscribe']) { echo "checked"; } ?> > <label for="subscribe_to_comments-always_subscribe" style="line-height:35px;"><?php _e("Always Subscribe Submitter", "tdomf"); ?> </label><br/> <small><?php _e('Enabling this option means that the submitter (as long as we have a valid email address) will automatically be subscribed to comments. Otherwise they will have a choice.', 'tdomf'); ?> </small> </div> <?php } tdomf_register_form_widget_control('subscribe_to_comments', __('Subscribe to Comments', "tdomf"), 'tdomf_widget_subscribe_to_comments_control', 500, 400); function tdomf_widget_subscribe_to_comments_admin_error($form_id) { if (tdomf_widget_subscribe_to_comments_comment_status($form_id) == false) { $output .= __('<b>Warning</b>: You are using the "Subscribe to Comments" widget but comments seem to be disabled for this form!', 'tdomf'); } return $output; } tdomf_register_form_widget_admin_error('subscribe_to_comments', __('Subscribe to Comments', "tdomf"), 'tdomf_widget_subscribe_to_comments_admin_error'); } /* if subscribe to comments plugin installed */