function route()
 {
     $action = TouAppHelper::get_param('action');
     if ($action == 'process-form') {
         return $this->process_form();
     } else {
         return $this->display_form();
     }
 }
示例#2
0
 function set_default_options()
 {
     $settings = $this->default_options();
     foreach ($settings as $setting => $default) {
         if (!isset($this->{$setting})) {
             $this->{$setting} = $default;
         }
     }
     if (!empty($this->terms_url) and !is_numeric($this->terms_url)) {
         $this->terms_url = trailingslashit($this->terms_url);
     }
     if (!isset($this->site_name) or !$this->site_name) {
         $this->site_name = get_option('blogname');
     }
     if (!isset($this->terms)) {
         $this->terms = TouAppHelper::get_include_contents('classes/views/settings/terms.php');
     }
     if (!isset($this->privacy_policy)) {
         $this->privacy_policy = TouAppHelper::get_include_contents('classes/views/settings/privacy_policy.php');
     }
 }
 function show_date()
 {
     global $profileuser, $tou_settings;
     if (isset($tou_settings->show_date) and $tou_settings->show_date and $date = TouAppHelper::get_user_meta($profileuser->ID, 'terms_and_conditions')) {
         $initials = TouAppHelper::get_user_meta($profileuser->ID, 'tou_initials');
         TouAppHelper::show_date($date, $initials);
     }
 }
示例#4
0
				</td>
        	</tr>
        	
        	<tr>
            	<th scope="row"><?php 
_e('Require terms in the checked forms', 'terms_of_use');
?>
</th>
    			<td>
			    <?php 
if (class_exists('FrmForm')) {
    ?>
                    <div class="tabs-panel" style="height:140px;margin-left:0;">
                        <div style="width:50%" class="alignleft">
                        <?php 
    TouAppHelper::forms_checkboxes('frm_forms', $tou_settings->frm_forms, 2);
    ?>
                        </div>
                    </div>
                    <div class="clear"></div>
                <?php 
} else {
    ?>
                <strong>Install <a href="http://wordpress.org/extend/plugins/formidable/">Formidable</a> to integrate Terms of Use with forms</strong>
                <?php 
}
?>
                </td>
            </tr>	
       </table>
       
示例#5
0
    function forms_checkboxes($field_name, $field_value = array(), $cols = 1)
    {
        if (!class_exists('FrmForm')) {
            return;
        }
        global $frm_form;
        $forms = $frm_form->getAll("is_template=0 AND (status is NULL OR status = '' OR status = 'published')", ' ORDER BY name');
        $count = count($forms);
        $col_count = ceil($count / $cols);
        $width = 100 / $cols;
        $i = 0;
        foreach ($forms as $form) {
            if ($i == $col_count) {
                ?>
        </div>
        <div style="width:<?php 
                echo $width;
                ?>
%" class="alignleft">
        <?php 
            }
            $i++;
            ?>
            <input name="<?php 
            echo $field_name;
            ?>
[]" type="checkbox" value="<?php 
            echo $form->id;
            ?>
" <?php 
            TouAppHelper::checked($field_value, $form->id);
            ?>
 /> <?php 
            echo substr(stripslashes($form->name), 0, 50);
            ?>
<br/>
        <?php 
        }
    }