Exemplo n.º 1
0
 public function browse()
 {
     // Parameters
     $params = array('join_columns' => array(), 'join_items' => array());
     // Process filters
     $params = $this->parseCounters($params);
     // Process query string
     $qstring = $this->parseQuerystring($params['total']);
     // Actions
     $actions = array(0 => __('select', 'system'), 'approve' => __('approve', 'system'), 'decline' => __('decline', 'system'), 'delete' => __('delete', 'system'));
     // Check form action
     if (input::post('do_action')) {
         // Delete selected blogs
         if (input::post('action') && isset($actions[input::post('action')]) && input::post('blog_id') && is_array(input::post('blog_id'))) {
             foreach (input::post('blog_id') as $blogID) {
                 $blogID = (int) $blogID;
                 if ($blogID && $blogID > 0) {
                     $this->action(input::post('action'), $blogID);
                 }
             }
         }
         // Success
         view::setInfo(__('action_applied', 'system'));
         router::redirect('cp/plugins/blogs?' . $qstring['url'] . 'page=' . $qstring['page']);
     }
     // Get blogs
     $blogs = array();
     if ($params['total']) {
         $blogs = $this->blogs_model->getBlogs('in_list', $params['join_columns'], $params['join_items'], $qstring['order'], $qstring['limit']);
     }
     // Create table grid
     $grid = array('uri' => 'cp/plugins/blogs', 'keyword' => 'blogs', 'header' => array('check' => array('html' => 'blog_id', 'class' => 'check'), 'data_title' => array('html' => __('name', 'system'), 'class' => 'name', 'sortable' => true), 'user' => array('html' => __('user', 'system'), 'class' => 'user'), 'post_date' => array('html' => __('post_date', 'system'), 'class' => 'date', 'sortable' => true), 'status' => array('html' => __('status', 'system'), 'class' => 'status'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($blogs as $blog) {
         if ($blog['active'] == 1) {
             $status = html_helper::anchor('cp/plugins/blogs/decline/' . $blog['blog_id'] . '?' . $qstring['url'] . 'page=' . $qstring['page'], __('active', 'system'), array('class' => 'label small success'));
         } else {
             $status = html_helper::anchor('cp/plugins/blogs/approve/' . $blog['blog_id'] . '?' . $qstring['url'] . 'page=' . $qstring['page'], $blog['active'] ? __('pending', 'system') : __('inactive', 'system'), array('class' => 'label small ' . ($blog['active'] ? 'info' : 'important')));
         }
         $grid['content'][] = array('check' => array('html' => $blog['blog_id']), 'data_title' => array('html' => html_helper::anchor('cp/plugins/blogs/edit/' . $blog['blog_id'], text_helper::truncate($blog['data_title'], 64))), 'user' => array('html' => users_helper::anchor($blog['user'])), 'post_date' => array('html' => date_helper::formatDate($blog['post_date'])), 'status' => array('html' => $status), 'actions' => array('html' => array('edit' => html_helper::anchor('cp/plugins/blogs/edit/' . $blog['blog_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/plugins/blogs/delete/' . $blog['blog_id'] . '?' . $qstring['url'] . 'page=' . $qstring['page'], __('delete', 'system'), array('data-html' => __('blog_delete?', 'blogs'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Set pagination
     $config = array('base_url' => config::siteURL('cp/plugins/blogs?' . $qstring['url']), 'total_items' => $params['total'], 'items_per_page' => $this->blogsPerPage, 'current_page' => $qstring['page'], 'uri_segment' => 'page');
     $pagination = loader::library('pagination', $config, null);
     // Filter hooks
     hook::filter('cp/plugins/blogs/browse/grid', $grid);
     hook::filter('cp/plugins/blogs/browse/actions', $actions);
     // Assign vars
     view::assign(array('grid' => $grid, 'actions' => $actions, 'pagination' => $pagination));
     // Set title
     view::setTitle(__('blogs_manage', 'system_navigation'));
     // Set trail
     if ($qstring['search_id']) {
         view::setTrail('cp/plugins/blogs?' . $qstring['url'] . 'page=' . $qstring['page'], __('search_results', 'system'));
     }
     // Assign actions
     view::setAction('#', __('search', 'system'), array('class' => 'icon-text icon-system-search', 'onclick' => '$(\'#blogs-search\').toggle();return false;'));
     // Load view
     view::load('cp/plugins/blogs/browse');
 }
Exemplo n.º 2
0
 public function browse()
 {
     // Parameters
     $params = array('join_columns' => array(), 'join_items' => array());
     // Process filters
     $params = $this->parseCounters($params);
     // Process query string
     $qstring = $this->parseQuerystring($params['total']);
     // Actions
     $actions = array(0 => __('select', 'system'), 'delete' => __('delete', 'system'));
     // Check form action
     if (input::post('do_action')) {
         // Delete selected news
         if (input::post('action') == 'delete') {
             if (input::post('news_id') && is_array(input::post('news_id'))) {
                 foreach (input::post('news_id') as $newsID) {
                     $newsID = (int) $newsID;
                     if ($newsID && $newsID > 0) {
                         $this->delete($newsID);
                     }
                 }
             }
         }
         // Success
         view::setInfo(__('action_applied', 'system'));
         router::redirect('cp/content/news?' . $qstring['url'] . 'page=' . $qstring['page']);
     }
     // Get news
     $news = array();
     if ($params['total']) {
         $news = $this->news_model->getEntries('in_list', $params['join_columns'], $params['join_items'], $qstring['order'], $qstring['limit']);
     }
     // Create table grid
     $grid = array('uri' => 'cp/content/news', 'keyword' => 'news', 'header' => array('check' => array('html' => 'news_id', 'class' => 'check'), 'data_title_' . session::item('language') => array('html' => __('name', 'system'), 'class' => 'name', 'sortable' => true), 'post_date' => array('html' => __('post_date', 'system'), 'class' => 'date', 'sortable' => true), 'status' => array('html' => __('status', 'system'), 'class' => 'status'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($news as $entry) {
         $grid['content'][] = array('check' => array('html' => $entry['news_id']), 'data_title_' . session::item('language') => array('html' => html_helper::anchor('cp/content/news/edit/' . $entry['news_id'], text_helper::truncate($entry['data_title'], 64))), 'post_date' => array('html' => date_helper::formatDate($entry['post_date'])), 'status' => array('html' => $entry['active'] ? '<span class="label success small">' . __('yes', 'system') . '</span>' : '<span class="label important small">' . __('no', 'system') . '</span>'), 'actions' => array('html' => array('edit' => html_helper::anchor('cp/content/news/edit/' . $entry['news_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/content/news/delete/' . $entry['news_id'] . '?' . $qstring['url'] . 'page=' . $qstring['page'], __('delete', 'system'), array('data-html' => __('entry_delete?', 'news'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Set pagination
     $config = array('base_url' => config::siteURL('cp/content/news?' . $qstring['url']), 'total_items' => $params['total'], 'items_per_page' => $this->newsPerPage, 'current_page' => $qstring['page'], 'uri_segment' => 'page');
     $pagination = loader::library('pagination', $config, null);
     // Filter hooks
     hook::filter('cp/content/news/browse/grid', $grid);
     hook::filter('cp/content/news/browse/actions', $actions);
     // Assign vars
     view::assign(array('grid' => $grid, 'actions' => $actions, 'pagination' => $pagination));
     // Set title
     view::setTitle(__('news_manage', 'system_navigation'));
     // Set trail
     if ($qstring['search_id']) {
         view::setTrail('cp/content/news?' . $qstring['url'] . 'page=' . $qstring['page'], __('search_results', 'system'));
     }
     // Assign actions
     view::setAction('cp/content/news/edit/', __('entry_new', 'news'), array('class' => 'icon-text icon-news-new'));
     view::setAction('#', __('search', 'system'), array('class' => 'icon-text icon-system-search', 'onclick' => '$(\'#news-search\').toggle();return false;'));
     // Load view
     view::load('cp/content/news/browse');
 }
Exemplo n.º 3
0
 public function browse()
 {
     // Parameters
     $params = array('join_columns' => array());
     // Process filters
     $params = $this->parseCounters($params);
     // Process query string
     $qstring = $this->parseQuerystring($params['total']);
     // Actions
     $actions = array(0 => __('select', 'system'), 'delete' => __('delete', 'system'));
     // Check form action
     if (input::post('do_action')) {
         // Delete selected messages
         if (input::post('action') == 'delete') {
             if (input::post('message_id') && is_array(input::post('message_id'))) {
                 foreach (input::post('message_id') as $messageID) {
                     $messageID = (int) $messageID;
                     if ($messageID && $messageID > 0) {
                         $this->delete($messageID);
                     }
                 }
             }
         }
         // Success
         view::setInfo(__('action_applied', 'system'));
         router::redirect('cp/plugins/messages?' . $qstring['url'] . 'page=' . $qstring['page']);
     }
     // Get messages
     $messages = array();
     if ($params['total']) {
         $messages = $this->messages_model->getMessages($params['join_columns'], $qstring['order'], $qstring['limit']);
     }
     // Create table grid
     $grid = array('uri' => 'cp/plugins/messages', 'keyword' => 'messages', 'header' => array('check' => array('html' => 'message_id', 'class' => 'check'), 'message' => array('html' => __('message', 'messages'), 'class' => 'name'), 'user' => array('html' => __('user', 'system'), 'class' => 'user'), 'post_date' => array('html' => __('post_date', 'system'), 'class' => 'date', 'sortable' => true), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($messages as $message) {
         $grid['content'][] = array('check' => array('html' => $message['message_id']), 'message' => array('html' => html_helper::anchor('cp/plugins/messages/edit/' . $message['message_id'], text_helper::truncate($message['message'], 64))), 'user' => array('html' => users_helper::anchor($message['user'])), 'post_date' => array('html' => date_helper::formatDate($message['post_date'])), 'actions' => array('html' => array('edit' => html_helper::anchor('cp/plugins/messages/edit/' . $message['message_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/plugins/messages/delete/' . $message['message_id'] . '?' . $qstring['url'] . 'page=' . $qstring['page'], __('delete', 'system'), array('data-html' => __('message_delete?', 'messages'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Set pagination
     $config = array('base_url' => config::siteURL('cp/plugins/messages?' . $qstring['url']), 'total_items' => $params['total'], 'items_per_page' => $this->messagesPerPage, 'current_page' => $qstring['page'], 'uri_segment' => 'page');
     $pagination = loader::library('pagination', $config, null);
     // Filter hooks
     hook::filter('cp/plugins/messages/browse/grid', $grid);
     hook::filter('cp/plugins/messages/browse/actions', $actions);
     // Assign vars
     view::assign(array('grid' => $grid, 'actions' => $actions, 'pagination' => $pagination));
     // Set title
     view::setTitle(__('messages_manage', 'system_navigation'));
     // Set trail
     if ($qstring['search_id']) {
         view::setTrail('cp/plugins/messages?' . $qstring['url'] . 'page=' . $qstring['page'], __('search_results', 'system'));
     }
     // Assign actions
     view::setAction('#', __('search', 'system'), array('class' => 'icon-text icon-system-search', 'onclick' => '$(\'#messages-search\').toggle();return false;'));
     // Load view
     view::load('cp/plugins/messages/browse');
 }
Exemplo n.º 4
0
 public function usersSettingsAccountOptions($settings, $user = array())
 {
     if (input::isCP()) {
         if (uri::segment(3) == 'edit') {
             loader::helper('array');
             $expiration = array('name' => __('expire_date', 'users_account'), 'keyword' => 'expire_date', 'type' => 'date', 'value' => $user ? $user['expire_date'] : 0, 'rules' => array('valid_date'), 'select' => true);
             $credits = array('name' => __('credits_current', 'users_account'), 'keyword' => 'total_credits', 'type' => 'number', 'value' => $user ? $user['total_credits'] : 0, 'rules' => array('required' => 1, 'min_value' => 0));
             $settings = array_helper::spliceArray($settings, 'group_id', $credits, 'total_credits');
             $settings = array_helper::spliceArray($settings, 'group_id', $expiration, 'expire_date');
         }
     } else {
         if (config::item('subscriptions_active', 'billing')) {
             $settings['subscription'] = array('name' => __('plan_current', 'users_account'), 'keyword' => 'subscription', 'type' => 'static', 'value' => config::item('usergroups', 'core', session::item('group_id')) . (session::item('expire_date') ? ' (' . __('expire_date', 'users_account') . ': ' . date_helper::formatDate(session::item('expire_date'), 'date') . ')' : '') . (session::permission('plans_purchase', 'billing') ? ' - ' . html_helper::anchor('billing/plans', __('plan_change', 'users_account')) : ''));
         }
         if (config::item('credits_active', 'billing')) {
             $settings['credits'] = array('name' => __('credits_current', 'users_account'), 'keyword' => 'subscription', 'type' => 'static', 'value' => session::item('total_credits') . (session::permission('credits_purchase', 'billing') ? ' - ' . html_helper::anchor('billing/credits', __('credits_purchase', 'users_account')) : ''));
         }
     }
     return $settings;
 }
Exemplo n.º 5
0
 public function edit()
 {
     // Get URI vars
     $userID = (int) uri::segment(4);
     // Assign vars
     view::assign(array('userID' => $userID));
     // Get user
     $user = array();
     if ($userID && !($user = $this->users_model->getUser($userID))) {
         view::setError(__('no_user', 'users'));
         router::redirect('cp/users');
     }
     // Get user groups
     $groups = config::item('usergroups', 'core');
     unset($groups[config::item('group_guests_id', 'users')]);
     // Create privacy settings
     $settings = array();
     $settings['email'] = array('name' => __('email', 'users'), 'keyword' => 'email', 'type' => 'text', 'class' => 'input-xlarge', 'value' => $user ? input::demo(0) ? current(explode('@', $user['email'])) . '@hidden.com' : $user['email'] : '', 'rules' => array('required', 'max_length' => 255, 'valid_email', 'callback__is_unique_email' => $userID));
     if (config::item('user_username', 'users')) {
         $settings['username'] = array('name' => __('username', 'users'), 'keyword' => 'username', 'type' => 'text', 'class' => 'input-xlarge', 'value' => $user ? $user['username'] : '', 'rules' => array('required', 'min_length' => 3, 'max_length' => 128, 'callback__is_valid_username' => $userID));
     }
     $settings['password'] = array('name' => __('password', 'users'), 'keyword' => 'password', 'type' => 'password', 'maxlength' => 128, 'class' => 'input-xlarge', 'rules' => array(!$userID ? 'required' : '', 'max_length' => 128));
     $settings['password2'] = array('name' => __('password_confirm', 'users'), 'keyword' => 'password2', 'type' => 'password', 'maxlength' => 128, 'class' => 'input-xlarge', 'rules' => array('max_length' => 128, 'matches' => 'password'));
     $settings['type_id'] = array('name' => __('user_type', 'users'), 'keyword' => 'type_id', 'keyword' => 'type_id', 'type' => 'select', 'items' => $userID ? array($user['type_id'] => text_helper::entities(config::item('usertypes', 'core', 'names', $user['type_id']))) : config::item('usertypes', 'core', 'names'), 'value' => $user ? $user['type_id'] : config::item('type_default_id', 'users'), 'rules' => array('intval'));
     $settings['group_id'] = array('name' => __('user_group', 'users'), 'keyword' => 'group_id', 'type' => 'select', 'items' => $userID && $userID == session::item('user_id') ? array($user['group_id'] => config::item('usergroups', 'core', $user['group_id'])) : $groups, 'value' => $user ? $user['group_id'] : config::item('group_default_id', 'users'), 'rules' => array('intval'));
     if ($userID != session::item('user_id')) {
         $settings['verified'] = array('name' => __('verified', 'users'), 'keyword' => 'verified', 'type' => 'boolean', 'value' => $user ? $user['verified'] : '1', 'rules' => array('intval'));
         $settings['active'] = array('name' => __('active', 'system'), 'keyword' => 'active', 'type' => 'boolean', 'value' => $user ? $user['active'] : '1', 'rules' => array('intval'));
     }
     if ($userID) {
         $settings['join_date'] = array('name' => __('join_date', 'users'), 'keyword' => 'join_date', 'type' => 'static', 'value' => date_helper::formatDate($user['join_date'], 'date-time'));
         $settings['visit_date'] = array('name' => __('visit_date', 'users'), 'keyword' => 'visit_date', 'type' => 'static', 'value' => $user['visit_date'] ? date_helper::formatDate($user['visit_date'], 'date-time') : __('never', 'system'));
         $settings['ip_address'] = array('name' => __('ip_address', 'users'), 'keyword' => 'ip_address', 'type' => 'static', 'value' => input::demo(0) ? 'Hidden in this demo' : $user['ip_address']);
     }
     // Filter hook
     $settings = hook::filter('users/settings/account/options', $settings, $user);
     // Assign vars
     view::assign(array('user' => $user, 'settings' => $settings));
     // Process form values
     if (input::post('do_save_user')) {
         $this->_saveUser($userID, $settings, $user);
     }
     // Set title
     view::setTitle($userID ? __('user_edit', 'users') : __('user_new', 'users'));
     // Assign tabs
     if ($userID) {
         $this->_userActions($userID, 'account');
     }
     // Set trail
     view::setTrail('cp/users/edit/' . ($userID ? $userID : ''), $userID ? __('user_edit', 'users') . ' - ' . ($user['name1'] ? $user['name'] : $user['email']) : __('user_new', 'users'));
     // Assign actions
     if ($userID && $user['user_id'] != session::item('user_id') && $user['group_id'] != config::item('group_cancelled_id', 'users') && $user['active'] && $user['verified']) {
         view::setAction('cp/users/login/spy/' . $user['user_id'], __('login', 'system_navigation'), array('class' => 'icon-text icon-users-login'));
     }
     // Load view
     view::load('cp/users/edit');
 }
Exemplo n.º 6
0
        if ($album['data_description']) {
            ?>
								<?php 
            echo $album['data_description'];
            ?>
							<?php 
        }
        ?>
						</div>

						<footer class="item-footer">

							<ul class="unstyled content-meta clearfix">
								<li class="date">
									<?php 
        echo __('post_date', 'system_info', array('%date' => date_helper::formatDate($album['post_date'])));
        ?>
								</li>
								<?php 
        if (config::item('album_views', 'pictures')) {
            ?>
									<li class="views">
										<?php 
            if ($album['total_views'] > 0) {
                ?>
											<?php 
                echo __('views_num' . ($album['total_views'] == 1 ? '_one' : ''), 'system_info', array('%views' => $album['total_views']));
                ?>
										<?php 
            } else {
                ?>
Exemplo n.º 7
0
					<?php 
        view::load('users/profile/elements/picture', array_merge($notice['user'], array('picture_file_suffix' => 't')));
        ?>
				</figure>

				<div class="item-article">
					<?php 
        echo $notice['html'];
        ?>
				</div>

				<footer class="item-footer">
					<ul class="unstyled content-meta clearfix">
						<li class="date">
							<?php 
        echo __('author_date', 'system_info', array('%author' => users_helper::anchor($notice['user']), '%date' => date_helper::formatDate($notice['post_date'])));
        ?>
						</li>
					</ul>
				</footer>

			</article>

		</li>

	<?php 
    }
    ?>

	<li class="clearfix loader <?php 
    echo text_helper::alternate('odd', 'even');
Exemplo n.º 8
0
				<li class="<?php 
        echo text_helper::alternate('odd', 'even');
        ?>
 clearfix" id="row-invoice-<?php 
        echo $invoice['transaction_id'];
        ?>
">
					<span class="name">
						<?php 
        echo $invoice['name'];
        ?>
					</span>
					<span class="date">
						<?php 
        echo date_helper::formatDate($invoice['post_date']);
        ?>
					</span>
					<span class="amount">
						<?php 
        echo money_helper::symbol(config::item('currency', 'billing')) . $invoice['amount'];
        ?>
					</span>
				</li>

			<?php 
    }
    ?>

		</ul>
Exemplo n.º 9
0
    echo users_helper::anchor($conversation['users'][$message['user_id']]);
    ?>
						</h2>
					</header>

					<div class="item-article">
						<?php 
    echo nl2br($message['message']);
    ?>
					</div>

					<footer class="item-footer">
						<ul class="unstyled content-meta clearfix">
							<li class="date">
								<?php 
    echo __('message_date', 'messages', array('%date' => date_helper::formatDate($message['post_date'])));
    ?>
							</li>
							<?php 
    if (config::item('reports_active', 'reports') && users_helper::isLoggedin() && $message['user_id'] != session::item('user_id') && session::permission('reports_post', 'reports')) {
        ?>
								<li class="report">
									<?php 
        echo html_helper::anchor('report/submit/message/' . $message['message_id'], __('report', 'system'), array('data-role' => 'modal', 'data-display' => 'iframe', 'data-title' => __('report', 'system')));
        ?>
								</li>
							<?php 
    }
    ?>
						</ul>
					</footer>
Exemplo n.º 10
0
 public function browse()
 {
     // Get gateways
     $gateways = array();
     foreach ($this->gateways_model->getGateways(false, false) as $gateway) {
         $gateways[$gateway['gateway_id']] = $gateway['name'];
     }
     // Parameters
     $params = array('join_columns' => array());
     // Process filters
     $params = $this->parseCounters($params, $gateways);
     // Process query string
     $qstring = $this->parseQuerystring($params['total']);
     // Create actions
     $actions = array(0 => __('select', 'system'), 'delete' => __('delete', 'system'));
     // Check form action
     if (input::post('do_action')) {
         // Delete selected transactions
         if (input::post('action') == 'delete') {
             if (input::post('transaction_id') && is_array(input::post('transaction_id'))) {
                 foreach (input::post('transaction_id') as $transactionID) {
                     $transactionID = (int) $transactionID;
                     if ($transactionID && $transactionID > 0) {
                         $this->delete($transactionID);
                     }
                 }
             }
         }
         // Success
         view::setInfo(__('action_applied', 'system'));
         router::redirect('cp/billing/transactions?' . $qstring['url'] . 'page=' . $qstring['page']);
     }
     // Get transaction
     $transactions = array();
     if ($params['total']) {
         $transactions = $this->transactions_model->getTransactions($params['join_columns'], $qstring['order'], $qstring['limit']);
     }
     // Create table grid
     $grid = array('uri' => 'cp/billing/transactions', 'keyword' => 'billing_transactions', 'header' => array('check' => array('html' => 'transaction_id', 'class' => 'check'), 'product' => array('html' => __('product', 'billing'), 'class' => 'product'), 'user' => array('html' => __('user', 'system'), 'class' => 'user'), 'gateway' => array('html' => __('payment_gateway', 'billing'), 'class' => 'gateway'), 'amount' => array('html' => __('price', 'billing'), 'class' => 'price', 'sortable' => true), 'post_date' => array('html' => __('payment_date', 'billing'), 'class' => 'date', 'sortable' => true), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($transactions as $transaction) {
         $grid['content'][] = array('check' => array('html' => $transaction['transaction_id']), 'product' => array('html' => html_helper::anchor('cp/billing/transactions/view/' . $transaction['transaction_id'], $transaction['name'])), 'user' => array('html' => users_helper::anchor($transaction['user'])), 'gateway' => array('html' => $gateways[$transaction['gateway_id']]), 'amount' => array('html' => money_helper::symbol(config::item('currency', 'billing')) . $transaction['amount']), 'post_date' => array('html' => date_helper::formatDate($transaction['post_date'])), 'actions' => array('html' => array('edit' => html_helper::anchor('cp/billing/transactions/view/' . $transaction['transaction_id'], __('details', 'system'), array('class' => 'details')), 'delete' => html_helper::anchor('cp/billing/transactions/delete/' . $transaction['transaction_id'] . '?' . $qstring['url'] . 'page=' . $qstring['page'], __('delete', 'system'), array('data-html' => __('transaction_delete?', 'billing_transactions'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Set pagination
     $config = array('base_url' => config::siteURL('cp/billing/transactions?' . $qstring['url']), 'total_items' => $params['total'], 'items_per_page' => $this->transactionPerPage, 'current_page' => $qstring['page'], 'uri_segment' => 'page');
     $pagination = loader::library('pagination', $config, null);
     // Filter hooks
     hook::filter('cp/billing/transactions/browse/grid', $grid);
     hook::filter('cp/billing/transactions/browse/actions', $actions);
     // Assign vars
     view::assign(array('grid' => $grid, 'actions' => $actions, 'pagination' => $pagination));
     // Set title
     view::setTitle(__('billing_transactions_manage', 'system_navigation'));
     // Set trail
     if ($qstring['search_id']) {
         view::setTrail('cp/billing/transactions?' . $qstring['url'] . 'page=' . $qstring['page'], __('search_results', 'system'));
     }
     // Assign actions
     view::setAction('#', __('search', 'system'), array('class' => 'icon-text icon-system-search', 'onclick' => '$(\'#transactions-search\').toggle();return false;'));
     // Load view
     view::load('cp/billing/transactions/browse');
 }
Exemplo n.º 11
0
 public function browse()
 {
     // Parameters
     $params = array('join_columns' => array());
     // Process filters
     $params = $this->parseCounters($params);
     // Process query string
     $qstring = $this->parseQuerystring($params['total']);
     // Create actions
     $actions = array(0 => __('select', 'system'), 'dismiss' => __('report_dismiss', 'reports'));
     // Check form action
     if (input::post('do_action')) {
         // Delete selected reports
         if (input::post('action') == 'dismiss') {
             if (input::post('report_id') && is_array(input::post('report_id'))) {
                 foreach (input::post('report_id') as $reportID) {
                     $reportID = (int) $reportID;
                     if ($reportID && $reportID > 0) {
                         $this->dismiss($reportID);
                     }
                 }
             }
         }
         // Success
         view::setInfo(__('action_applied', 'system'));
         router::redirect('cp/content/reports?' . $qstring['url'] . 'page=' . $qstring['page']);
     }
     // Get reports
     $reports = array();
     if ($params['total']) {
         $reports = $this->reports_model->getReports('', $params['join_columns'], $qstring['order'], $qstring['limit']);
     }
     // Load subjects model
     loader::model('reports/subjects', array(), 'reports_subjects_model');
     // Get subjects
     $subjects = array();
     $data = $this->reports_subjects_model->getSubjects();
     foreach ($data as $subject) {
         $subjects[$subject['subject_id']] = $subject['name'];
     }
     // Create table grid
     $grid = array('uri' => 'cp/content/reports', 'keyword' => 'reports', 'header' => array('check' => array('html' => 'report_id', 'class' => 'check'), 'subject' => array('html' => __('report_subject', 'reports'), 'class' => 'subject'), 'message' => array('html' => __('report_message', 'reports'), 'class' => 'comment'), 'item' => array('html' => __('report_item', 'reports'), 'class' => 'item'), 'user' => array('html' => __('reporter', 'reports'), 'class' => 'user'), 'post_date' => array('html' => __('post_date', 'system'), 'class' => 'date', 'sortable' => true), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($reports as $report) {
         $grid['content'][] = array('check' => array('html' => $report['report_id']), 'subject' => array('html' => isset($subjects[$report['subject_id']]) ? $subjects[$report['subject_id']] : ''), 'message' => array('html' => text_helper::truncate($report['message'], 56) . (utf8::strlen($report['message']) > 56 ? ' ' . html_helper::anchor('', __('view', 'system'), array('data-title' => __('message', 'reports'), 'data-role' => 'modal', 'data-display' => 'html', 'data-html' => text_helper::entities($report['message']))) : '')), 'item' => array('html' => __(config::item('resources', 'core', $report['resource_id']), config::item('resources', 'core', config::item('resources', 'core', $report['resource_id']), 'plugin'))), 'user' => array('html' => users_helper::anchor($report['user'])), 'post_date' => array('html' => date_helper::formatDate($report['post_date'])), 'actions' => array('html' => array('actions' => html_helper::anchor('cp/content/reports/actions/' . $report['report_id'], __('report_actions', 'reports'), array('class' => 'action', 'data-role' => 'modal', 'data-display' => 'iframe', 'data-title' => __('report_action_select', 'reports'))), 'view' => html_helper::anchor('cp/content/reports/view/' . $report['report_id'], __('report_view', 'reports'), array('class' => 'view')), 'dismiss' => html_helper::anchor('cp/content/reports/dismiss/' . $report['report_id'] . '?' . $qstring['url'] . 'page=' . $qstring['page'], __('report_dismiss', 'reports'), array('data-html' => __('report_dismiss?', 'reports'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Set pagination
     $config = array('base_url' => config::siteURL('cp/content/reports?' . $qstring['url']), 'total_items' => $params['total'], 'items_per_page' => $this->reportsPerPage, 'current_page' => $qstring['page'], 'uri_segment' => 'page');
     $pagination = loader::library('pagination', $config, null);
     // Filter hooks
     hook::filter('cp/content/reports/browse/grid', $grid);
     hook::filter('cp/content/reports/browse/actions', $actions);
     // Assign vars
     view::assign(array('grid' => $grid, 'actions' => $actions, 'pagination' => $pagination));
     // Set title
     view::setTitle(__('reports_manage', 'system_navigation'));
     // Set trail
     if ($qstring['search_id']) {
         view::setTrail('cp/content/reports?' . $qstring['url'] . 'page=' . $qstring['page'], __('search_results', 'system'));
     }
     // Assign actions
     view::setAction('#', __('search', 'system'), array('class' => 'icon-text icon-system-search', 'onclick' => '$(\'#reports-search\').toggle();return false;'));
     // Load view
     view::load('cp/content/reports/browse');
 }
Exemplo n.º 12
0
?>
			</td>
		</tr>

		<tr class="<?php 
echo text_helper::alternate('odd', 'even');
?>
" id="input_row_transaction_payment_date">
			<td class="name">
				<?php 
echo __('payment_date', 'billing');
?>
			</td>
			<td class="value">
				<?php 
echo date_helper::formatDate($transaction['post_date']);
?>
			</td>
		</tr>

		<tr class="<?php 
echo text_helper::alternate('odd', 'even');
?>
" id="input_row_transaction_gateway_id">
			<td class="name">
				<?php 
echo __('payment_gateway', 'billing');
?>
			</td>
			<td class="value">
				<?php 
Exemplo n.º 13
0
        ?>
							</h2>
						</header>

						<div class="item-article">
							<?php 
        echo text_helper::truncate($conversation['message'], 120);
        ?>
						</div>

						<footer class="item-footer">

							<ul class="unstyled content-meta clearfix">
								<li class="date">
									<?php 
        echo __('message_date', 'messages', array('%date' => date_helper::formatDate($conversation['last_post_date'])));
        ?>
								</li>
								<li class="user">
									<?php 
        if ($conversation['message_user_id'] != session::item('user_id')) {
            ?>
										<?php 
            echo __('message_from', 'messages');
            ?>
									<?php 
        } else {
            ?>
										<?php 
            echo __('message_to', 'messages');
            ?>