Beispiel #1
0
 function subscription_edit($id)
 {
     $this->load->library('admin_form');
     $form = new Admin_form();
     $this->load->model('subscription_plan_model');
     $plan = $this->subscription_plan_model->get_plan($id);
     if (!$plan) {
         die(show_error('No subscription plan with that ID.'));
     }
     $this->load->model('users/usergroup_model');
     $usergroups = $this->usergroup_model->get_usergroups();
     $options = array();
     $options[0] = 'No member group move';
     foreach ($usergroups as $group) {
         $options[$group['id']] = $group['name'];
     }
     $usergroups = $options;
     $form->fieldset('Membership Options');
     $form->dropdown('Promotion', 'promotion', $usergroups, $plan['promotion'], FALSE, FALSE, 'Upon subscription, the member will be moved into this usergroup.  They will be removed from this group upon expiration or cancellation.');
     $form->dropdown('Demotion', 'demotion', $usergroups, $plan['demotion'], FALSE, FALSE, 'Upon expiration or cancellation, the member will be moved into this usergroup.');
     $form->fieldset('Description');
     $form->textarea('Description', 'description', $plan['description'], 'This text may be displayed to the user in a list of subscription packages.', FALSE, 'basic', TRUE, '100%', '100px');
     $data = array('member_form' => $form->display(), 'form_title' => 'Edit Subscription Plan', 'form_action' => site_url('admincp/billing/post_subscription/edit/' . $plan['id']), 'action' => 'edit', 'form' => $plan);
     $this->load->view('subscription_form.php', $data);
 }
Beispiel #2
0
 function collection_edit($id)
 {
     $this->load->library('admin_form');
     $form = new Admin_form();
     $form->fieldset('Collection Information');
     $this->load->model('collections_model');
     $collections = $this->collections_model->get_tiered_collections();
     $collection = $this->collections_model->get_collection($id);
     $options = array();
     $options[0] = 'No parent';
     foreach ($collections as $data) {
         $options[$data['id']] = $data['name'];
     }
     $form->dropdown('Parent', 'parent', $options, $collection['parent'], FALSE, FALSE, 'If a parent is selected, this collection will act as a sub-collection of its parent.', TRUE);
     $form->text('Collection Name', 'name', $collection['name'], FALSE, TRUE, 'e.g., Men\'s Shoes', TRUE);
     $form->textarea('Description', 'description', $collection['description'], FALSE, FALSE, 'complete', TRUE);
     // custom fields
     if (setting('collections_custom_field_group') != '') {
         $collection_data = $this->custom_fields_model->get_custom_fields(array('group' => setting('collections_custom_field_group')));
         if (!empty($collection_data)) {
             $form->fieldset('Custom Product Data');
             $form->custom_fields($collection_data, $collection);
         }
     }
     $data = array('form' => $form->display(), 'form_action' => site_url('admincp/store/post_collection/edit/' . $collection['id']), 'form_title' => 'Edit Collection');
     $this->load->view('collection_form', $data);
 }
Beispiel #3
0
 function topic_edit($id)
 {
     $this->load->library('admin_form');
     $form = new Admin_form();
     $form->fieldset('Edit Topic');
     $this->load->model('topic_model');
     $topics = $this->topic_model->get_tiered_topics();
     $topic = $this->topic_model->get_topic($id);
     $options = array();
     $options[0] = 'No parent';
     foreach ($topics as $data) {
         $options[$data['id']] = $data['name'];
     }
     $form->dropdown('Parent', 'parent', $options, $topic['parent'], FALSE, FALSE, 'If a parent is selected, this topic will act as a sub-topic of its parent.', TRUE);
     $form->text('Topic Name', 'name', $topic['name'], FALSE, TRUE, 'e.g., Entertainment & Leisure', TRUE);
     $form->textarea('Description', 'description', $topic['description'], FALSE, FALSE, 'basic', TRUE);
     $data = array('form' => $form->display(), 'form_action' => site_url('admincp/publish/post_topic/edit/' . $topic['id']), 'form_title' => 'Edit Topic');
     $this->load->view('topic_form', $data);
 }
Beispiel #4
0
    /**
     * Email layout
     */
    function email_layout()
    {
        $this->load->helper('file');
        $layout = read_file(setting('path_email_templates') . '/email_layout.thtml');
        if ($layout === FALSE) {
            die(show_error('email_layout.thtml does not exist at ' . setting('path_email_templates') . '.  Please create it and make sure that
			it is writeable.'));
        }
        $this->load->library('admin_form');
        $form = new Admin_form();
        $form->fieldset('Email Layout');
        $form->textarea('Global Email Layout Template', 'html', htmlspecialchars($layout), 'This layout is used in all other email templates by default.  It uses Smarty markup.', TRUE, FALSE, TRUE, '100%', '300px');
        $data = array('form' => $form->display(), 'form_action' => site_url('admincp/emails/post_email_layout'));
        $this->load->view('email_layout', $data);
    }