function edit($bucket, $id) { $this->data['widgettext'] = 'Edit ' . cms_depluralize($this->data['table']); $this->data['helpertext'] = 'To edit a the ' . cms_depluralize($this->data['table']) . ' fill out the field below and click "save"'; $this->data['type'] = 'edit'; // Get data $this->db->where($this->data['table'] . 'Id', $id); $this->data['data'] = $this->db->get($this->data['table'])->row_array(); // Add formating to the data. if (isset($this->data['data'][$this->data['table'] . 'Extra'])) { $this->data['data'][$this->data['table'] . 'Extra'] = json_decode($this->data['data'][$this->data['table'] . 'Extra'], TRUE); } else { $this->data['data'][$this->data['table'] . 'Extra'] = array(); } // See if we need to include any media info as well foreach ($this->data['bucket']['CMS_BucketsFields'] as $key => $row) { if (isset($this->data['data'][$key]) && ($row['type'] == 'cms-image' || $row['type'] == 'cms-image-crop')) { $this->data['data'][$key . '_media'] = $this->cms_media_model->get_by_id($this->data['data'][$key]); } } $this->_add_edit_shared_func(true); }
<?php $add_name = isset($bucket['CMS_BucketsDisplay']['add-button']) ? $bucket['CMS_BucketsDisplay']['add-button'] : 'Add ' . cms_depluralize($table); $search = empty($state['search']) ? '' : $state['search']; $order = isset($bucket['CMS_BucketsListview']['order']) ? $bucket['CMS_BucketsListview']['order'] : $table . 'Order'; $sort = isset($bucket['CMS_BucketsListview']['sort']) ? $bucket['CMS_BucketsListview']['sort'] : 'desc'; $sortable = isset($bucket['CMS_BucketsListview']['sortable']) ? $bucket['CMS_BucketsListview']['sortable'] : 'Yes'; $url_extra = isset($bucket['CMS_BucketsListview']['url_extra']) ? $bucket['CMS_BucketsListview']['url_extra'] : ''; ?> <?php echo $this->load->view('cms/buckets/section-header'); ?> <div class="row"> <div class="span12"> <div class="row"> <div class="span6 pull-left"> <form class="tables-search-form" action="<?php echo current_url(); ?> " method="get"> <input type="text" id="table-search" name="search" style="width: 220px;" value="<?php echo empty($state['search']) ? '' : $state['search']; ?> " placeholder="Search" /><span class="add-on" style="vertical-align: top;"> </form> </div> <div class="pull-right"> <a href="<?php