Пример #1
0
 protected function _indexPage(&$iaView)
 {
     $page = isset($this->_iaCore->requestPath[0]) && in_array($this->_iaCore->requestPath[0], $this->_actions) ? $this->_iaCore->requestPath[0] : $this->_actions[0];
     $this->_checkActions($page, $iaView);
     switch ($page) {
         default:
             $pageCaption = iaLanguage::get('sql_management');
             $this->_queryPage($iaView);
             break;
         case 'export':
             $pageCaption = iaLanguage::get('export');
             $this->_exportPage($iaView);
             break;
         case 'import':
             $pageCaption = iaLanguage::get('import');
             $this->_importPage($iaView);
             break;
         case 'consistency':
             $pageCaption = iaLanguage::get('consistency');
             $this->_consistencyPage($iaView);
             break;
         case 'reset':
             $pageCaption = iaLanguage::get('reset');
             $this->_resetPage($iaView);
     }
     if ($this->getMessages()) {
         $iaView->setMessages($this->getMessages(), $this->_error ? iaView::ERROR : iaView::SUCCESS);
     }
     $iaView->assign('action', $page);
     iaBreadcrumb::toEnd($pageCaption, IA_SELF);
     $iaView->title($pageCaption);
     $iaView->display($this->getName());
 }
Пример #2
0
 protected function _view(&$iaView, $invoiceId)
 {
     iaBreadcrumb::add(iaLanguage::get('view'), IA_SELF);
     $invoice = $this->getHelper()->getById($invoiceId);
     if (!$invoice) {
         return iaView::errorPage(iaView::ERROR_NOT_FOUND);
     }
     $iaView->assign('invoice', $invoice);
     $iaView->assign('items', $this->getHelper()->getItemsByInvoiceId($invoiceId));
     $iaView->display('invoice-view');
 }
 private function _viewPage(&$iaView, $id)
 {
     $item = $this->getById($id);
     if (!$item) {
         return iaView::errorPage(iaView::ERROR_NOT_FOUND);
     }
     $iaUsers = $this->_iaCore->factory('users');
     $iaView->assign('item', $item);
     $iaView->assign('initiator', $iaUsers->getInfo($item['member_id']));
     iaBreadcrumb::toEnd(iaLanguage::get('claim_details'));
     $iaView->title(iaLanguage::get('claim_details'));
     $iaView->display('view');
 }
Пример #4
0
 protected function _indexPage(&$iaView)
 {
     $settings = $this->_getSettings();
     if (in_array($settings['target'], array(iaAcl::USER, iaAcl::GROUP))) {
         if (iaAcl::USER == $settings['target']) {
             iaBreadcrumb::add(iaLanguage::get('members'), IA_ADMIN_URL . 'members/');
             $iaView->title(iaLanguage::getf('permissions_members', array('member' => '"' . $settings['item']['fullname'] . '"')));
         } else {
             iaBreadcrumb::add(iaLanguage::get('usergroups'), IA_ADMIN_URL . 'usergroups/');
             $iaView->title(iaLanguage::getf('permissions_usergroups', array('usergroup' => '"' . iaLanguage::get('usergroup_' . $settings['item']['name']) . '"')));
         }
         $userPermissions = $this->getHelper()->getPermissions($settings['id'], $settings['group']);
         $custom = array('user' => $settings['user'], 'group' => $settings['group'], 'perms' => $userPermissions);
         $actionCode = 'admin_access--read';
         list($object, ) = explode(iaAcl::DELIMITER, $actionCode);
         $adminAccess = array('title' => iaLanguage::get($actionCode, $actionCode), 'modified' => isset($userPermissions[$this->getHelper()->encodeAction($object, iaCore::ACTION_READ, '0')][$settings['action']]), 'default' => $this->_objects[$actionCode], 'access' => (int) $this->getHelper()->checkAccess($object, null, 0, 0, $custom));
         $iaView->assign('adminAccess', $adminAccess);
         $iaView->assign('pageGroupTitles', $this->_iaDb->keyvalue(array('id', 'title'), null, 'admin_pages_groups'));
         $iaView->assign('permissions', $this->_getPermissionsInfo($settings, $userPermissions, $custom));
     } else {
         $this->_list($iaView);
     }
 }
Пример #5
0
 private function _setGroup(&$iaView, &$iaItem, array $groupData)
 {
     $iaView->title($groupData['title']);
     if ($groupData['extras']) {
         $iaPage = $this->_iaCore->factory('page', iaCore::ADMIN);
         $activeMenu = $groupData['name'];
         if ($groupData['extras'] == $this->_iaCore->get('tmpl')) {
             // template configuration options
             $page = $iaPage->getByName('templates');
             $iaView->set('group', $page['group']);
             $iaView->set('active_config', $groupData['name']);
             iaBreadcrumb::add($page['title'], IA_ADMIN_URL . $page['alias']);
         } elseif ($pluginPage = $this->_iaDb->row(array('alias', 'group'), iaDb::printf("`name` = ':name' OR `name` = ':name_stats'", array('name' => $groupData['extras'])), iaPage::getAdminTable())) {
             // it is a package
             $iaView->set('group', $pluginPage['group']);
             $iaView->set('active_config', $groupData['name']);
             $activeMenu = null;
             iaBreadcrumb::insert($groupData['title'], IA_ADMIN_URL . $pluginPage['alias'], iaBreadcrumb::POSITION_FIRST);
         } elseif ($iaItem->isExtrasExist($groupData['extras'], iaItem::TYPE_PLUGIN)) {
             // plugin with no admin pages
             $iaView->set('group', 5);
             $iaView->set('active_config', $groupData['extras']);
         }
     } else {
         $activeMenu = 'configuration_' . $groupData['name'];
         iaBreadcrumb::toEnd($groupData['title'], IA_SELF);
     }
     $iaView->set('active_menu', $activeMenu);
 }
Пример #6
0
             $affected = $iaDb->update(array('id' => $transaction['id'], 'gateway' => $gate), null, array('date' => iaDb::FUNCTION_NOW), iaTransaction::getTable());
             $iaCore->factory('invoice')->updateAddress($transaction['id'], $_POST['invaddr']);
             // include pre form send files
             $paymentGatewayHandler = IA_PLUGINS . $gate . IA_DS . 'includes' . IA_DS . 'pre-processing' . iaSystem::EXECUTABLE_FILE_EXT;
             if (file_exists($paymentGatewayHandler)) {
                 include $paymentGatewayHandler;
             }
             if (!empty($gateways[$gate])) {
                 $data = array('caption' => 'Redirect to ' . $gate . '', 'msg' => 'You will be redirected to ' . $gate . '', 'form' => $gateways[$gate]);
                 $iaView->assign('redir', $data);
                 $tplFile = 'redirect-gateway';
                 $iaView->disableLayout();
             }
         }
     }
     iaBreadcrumb::add(iaLanguage::get('page_title_member_funds'), $iaCore->factory('page', iaCore::FRONT)->getUrlByName('member_funds'));
 } elseif (!empty($transaction['gateway']) && 'completed' == $action) {
     $gate = $transaction['gateway'];
     if (isset($gateways[$gate])) {
         $temp_transaction = $transaction;
         $transaction = array();
         // include post form send files
         $paymentGatewayHandler = IA_PLUGINS . $gate . IA_DS . 'includes' . IA_DS . 'post-processing' . iaSystem::EXECUTABLE_FILE_EXT;
         if (file_exists($paymentGatewayHandler)) {
             // set to true if custom transaction handling needed
             $replaceHandler = false;
             $iaCore->startHook('phpPayBeforeIncludePostGate', array('gateway' => $gate));
             include $paymentGatewayHandler;
             $iaCore->startHook('phpPayAfterIncludePostGate', array('gateway' => $gate));
             // print transaction information
             if (INTELLI_DEBUG) {
Пример #7
0
 ******************************************************************************/
$iaDb->setTable('portfolio_entries');
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    $iaView->iaSmarty->compile_check = true;
    unset($iaCore->iaView->blocks['left']);
    unset($iaCore->iaView->blocks['right']);
    if (isset($iaCore->requestPath[0])) {
        $id = (int) $iaCore->requestPath[0];
        if (!$id) {
            return iaView::errorPage(iaView::ERROR_NOT_FOUND);
        }
        $portfolioEntry = $iaDb->row_bind(iaDb::ALL_COLUMNS_SELECTION, 'id = :id AND `status` = :status', array('id' => $id, 'status' => iaCore::STATUS_ACTIVE));
        if (empty($portfolioEntry)) {
            return iaView::errorPage(iaView::ERROR_NOT_FOUND);
        }
        iaBreadcrumb::toEnd($portfolioEntry['title'], IA_SELF);
        $openGraph = array('title' => $portfolioEntry['title'], 'url' => IA_SELF, 'description' => $portfolioEntry['body']);
        if (isset($portfolioEntry['image'])) {
            $openGraph['image'] = IA_CLEAR_URL . 'uploads/' . $portfolioEntry['image'];
        }
        $iaView->set('og', $openGraph);
        $iaView->assign('portfolio_entry', $portfolioEntry);
        $iaView->title(iaSanitize::tags($portfolioEntry['title']));
    } else {
        $page = empty($_GET['page']) ? 0 : (int) $_GET['page'];
        $page = $page < 1 ? 1 : $page;
        $pageUrl = $iaCore->factory('page', iaCore::FRONT)->getUrlByName('portfolio');
        $pagination = array('start' => ($page - 1) * $iaCore->get('portfolio_entries_per_page'), 'limit' => (int) $iaCore->get('portfolio_entries_per_page'), 'template' => $pageUrl . '?page={page}');
        $order = 'date' == $iaCore->get('portfolio_entries_order') ? 'ORDER BY `date_added` DESC' : 'ORDER BY `title` ASC';
        $stmt = '`status` = :status AND `lang` = :language';
        $iaDb->bind($stmt, array('status' => iaCore::STATUS_ACTIVE, 'language' => $iaView->language));
Пример #8
0
        case iaCore::ACTION_EDIT:
            $output = $iaAd->gridUpdate($_POST);
            break;
        case iaCore::ACTION_DELETE:
            $output = $iaAd->gridDelete($_POST);
    }
    $iaView->assign($output);
}
// process html page actions
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    // display grid
    if (iaCore::ACTION_READ == $pageAction) {
        $iaView->grid('_IA_URL_packages/affiliates/js/admin/ads');
    } else {
        $baseUrl = IA_ADMIN_URL . 'affiliates/ads/';
        iaBreadcrumb::add(iaLanguage::get('ads'), $baseUrl);
        $ad = array('status' => iaCore::STATUS_ACTIVE);
        if (iaCore::ACTION_EDIT == $pageAction) {
            if (!isset($_GET['id'])) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
            $ad = $iaAd->getById((int) $_GET['id']);
            if (empty($ad)) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
        }
        // define fields class
        $iaFields = iaCore::fields();
        // process mandatory hook
        $iaCore->startHook('editItemSetSystemDefaults', array('item' => &$ad));
        if (isset($_POST['save'])) {
Пример #9
0
        case iaCore::ACTION_EDIT:
            $output = $iaBanner->gridUpdate($_POST);
            break;
        case iaCore::ACTION_DELETE:
            $output = $iaBanner->gridDelete($_POST);
    }
    $iaView->assign($output);
}
// process html page actions
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    // display grid
    if (iaCore::ACTION_READ == $pageAction) {
        $iaView->grid('_IA_URL_packages/affiliates/js/admin/banners');
    } else {
        $baseUrl = IA_ADMIN_URL . $iaBanner->getModuleUrl();
        iaBreadcrumb::add(iaLanguage::get('banners'), $baseUrl);
        if (iaCore::ACTION_EDIT == $pageAction) {
            if (!isset($_GET['id'])) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
            $listingData = $iaBanner->getById((int) $_GET['id']);
            if (empty($listingData)) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
        } else {
            $listingData = array('member_id' => iaUsers::getIdentity()->id, 'date_added' => date(iaDb::DATETIME_SHORT_FORMAT), 'status' => iaCore::STATUS_ACTIVE);
        }
        // define fields class
        $iaField = $iaCore->factory('field');
        // process mandatory hook
        $iaCore->startHook('editItemSetSystemDefaults', array('item' => &$listingData));
Пример #10
0
                }
            }
            if (isset($iaCore->requestPath[0]) && !isset($iaCore->requestPath[1])) {
                iaBreadcrumb::preEnd('Blog Archive', 'blog/date');
                iaBreadcrumb::replaceEnd($iaCore->requestPath[0], IA_SELF);
                $iaView->title($iaCore->requestPath[0]);
            }
            $iaView->assign('show', $show);
            $iaView->assign('years', $years);
            $iaView->assign('months', $months);
        } else {
            $iaView->setMessages(iaLanguage::get('no_blog_entries'), iaView::ALERT);
        }
    } elseif (isset($iaCore->requestPath[0]) && isset($iaCore->requestPath[1])) {
        $page = empty($_GET['page']) ? 0 : (int) $_GET['page'];
        $page = $page < 1 ? 1 : $page;
        $pageUrl = $iaCore->factory('page', iaCore::FRONT)->getUrlByName('blog_date');
        $pagination = array('start' => ($page - 1) * $iaCore->get('blog_number'), 'limit' => (int) $iaCore->get('blog_number'), 'template' => $pageUrl . '?page={page}');
        $stmt = "`status` = 'active' AND MONTH(b.`date_added`) = '" . $iaCore->requestPath[1] . "' AND YEAR(b.`date_added`) = '" . $iaCore->requestPath[0] . "' ";
        $order = 'date' == $iaCore->get('blog_order') ? 'ORDER BY b.`date_added` DESC' : 'ORDER BY b.`title` ASC';
        $sql = 'SELECT SQL_CALC_FOUND_ROWS ' . 'b.`id`, b.`title`, b.`date_added`, b.`body`, b.`alias`, b.`image`, m.`fullname` ' . 'FROM `:prefix:table_blog_entries` b ' . 'LEFT JOIN `:prefix:table_members` m ON (b.`member_id` = m.`id`) ' . 'WHERE b.' . $stmt . $order . ' LIMIT :start, :limit';
        $sql = iaDb::printf($sql, array('prefix' => $iaDb->prefix, 'table_blog_entries' => 'blog_entries', 'table_members' => 'members', 'start' => $pagination['start'], 'limit' => $pagination['limit']));
        $blogs = $iaDb->getAll($sql);
        iaBreadcrumb::toEnd(date("F", mktime(0, 0, 0, $iaCore->requestPath[1], 10)));
        $pagination['total'] = $iaDb->foundRows();
        $iaView->assign('blogs', $blogs);
        $iaView->assign('pagination', $pagination);
        $iaView->title(date("F", mktime(0, 0, 0, $iaCore->requestPath[1], 10)));
    }
    $iaView->display('date');
}
Пример #11
0
 protected function _assignValues(&$iaView, array &$entryData)
 {
     iaBreadcrumb::replaceEnd(iaLanguage::get('add_usergroup'), IA_SELF);
     $iaView->assign('groups', $this->_iaDb->keyvalue(array('id', 'name')));
 }
Пример #12
0
    if (!isset($out)) {
        $iaView->assign_all($iaAlbum->gridActions($_GET));
    }
}
// process html page actions
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    $iaArtist = $iaCore->factoryPackage('artist', IA_CURRENT_PACKAGE, iaCore::ADMIN);
    // init classes
    $iaFields = iaCore::fields();
    switch ($pageAction) {
        default:
            $iaView->grid('_IA_URL_packages/lyrics/js/admin/albums');
            break;
        case 'edit':
        case 'add':
            iaBreadcrumb::add(iaLanguage::get('albums'), IA_ADMIN_URL . 'lyrics/albums/');
            // these fields are system and used in system template
            $item = array('status' => 'active', 'account_username' => $_SESSION['user']['username'], 'featured' => true);
            if ('edit' == $pageAction) {
                $item = $iaAlbum->getById((int) $_GET['id']);
                if (empty($item)) {
                    iaView::errorPage(iaView::ERROR_NOT_FOUND);
                }
            }
            $fields = iaField::getAllFields(true, '', 'albums');
            if (isset($_POST['save'])) {
                $error = false;
                $errorFields = array();
                $messages = array();
                iaCore::util();
                if ($fields) {
Пример #13
0
            			{
            				$iaLog = $iaCore->factory('log');
            				foreach ($_POST['id'] as $id)
            				{
            					$iaLog->write(iaLog::ACTION_DELETE, array('item' => 'guestbook', 'name' => '', 'id' => (int)$id));
            				}
            			}*/
    }
    $iaView->assign($output);
}
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    if (iaCore::ACTION_EDIT == $pageAction && isset($iaCore->requestPath[0])) {
        if (iaCore::ACTION_EDIT == $pageAction && !isset($iaCore->requestPath[0])) {
            return iaView::errorPage(iaView::ERROR_NOT_FOUND);
        }
        iaBreadcrumb::replaceEnd(iaLanguage::get('edit'));
        $guestbook = array('status' => iaCore::STATUS_ACTIVE);
        if (iaCore::ACTION_EDIT == $pageAction) {
            $id = (int) $iaCore->requestPath[0];
            $guestbook = $iaDb->row(iaDb::ALL_COLUMNS_SELECTION, iaDb::convertIds($id));
        }
        $guestbook = array('id' => isset($id) ? $id : 0, 'author_name' => iaUtil::checkPostParam('author_name', $guestbook), 'email' => iaUtil::checkPostParam('email', $guestbook), 'member_id' => iaUtil::checkPostParam('member_id', $guestbook), 'author_url' => iaUtil::checkPostParam('author_url', $guestbook), 'body' => iaUtil::checkPostParam('body', $guestbook), 'status' => iaUtil::checkPostParam('status', $guestbook), 'avatar' => iaUtil::checkPostParam('avatar', $guestbook), 'date' => iaUtil::checkPostParam('date', $guestbook));
        if (isset($_POST['save'])) {
            iaUtil::loadUTF8Functions('ascii', 'validation', 'bad');
            $error = false;
            $messages = array();
            $guestbook['avatar'] = iaSanitize::html($guestbook['avatar']);
            if (utf8_is_valid($guestbook['author_name'])) {
                $guestbook['author_name'] = utf8_bad_replace($guestbook['author_name']);
            }
            if (isset($_FILES['image']['tmp_name']) && $_FILES['image']['tmp_name']) {
Пример #14
0
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Subrion is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Subrion. If not, see <http://www.gnu.org/licenses/>.
 *
 *
 * @link http://www.subrion.org/
 *
 ******************************************************************************/
if (iaView::REQUEST_JSON == $iaView->getRequestType()) {
    return iaView::errorPage(iaView::ERROR_NOT_FOUND);
}
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    iaBreadcrumb::add(iaLanguage::get('main_page'), IA_URL);
    $redirectUrl = IA_URL;
    if (isset($_SESSION['redir'])) {
        $iaView->assign('redir', $_SESSION['redir']);
        $redirectUrl = $_SESSION['redir']['url'];
        unset($_SESSION['redir']);
    }
    $iaView->disableLayout();
    $iaView->assign('redirect_url', $redirectUrl);
    $iaView->title($iaCore->get('site'));
}
Пример #15
0
     // increment views counter
     $iaGenre->incrementViewsCounter($genre['id']);
     // get artists by genre
     $iaArtist = $iaCore->factoryPackage('artist', IA_CURRENT_PACKAGE);
     $artists = $iaArtist->getArtistsByGenre($genre['id']);
     if ($artists) {
         // update favorites icon
         $artists = $iaItem->updateItemsFavorites($artists, $iaArtist->getItemName());
         // filter fields
         $fields = iaField::filterFields($artists, $iaArtist->getItemName());
         $iaView->assign('fields', $fields);
     }
     $iaView->assign('artists', $artists);
     // breadcrumb formation
     iaBreadcrumb::add(_t('genres'), $iaCore->packagesData['lyrics']['url'] . 'genres/');
     iaBreadcrumb::replaceEnd($genre['title'], '');
     // set meta keywords and description
     $iaView->set('description', $genre['meta_description']);
     $iaView->set('keywords', $genre['meta_keywords']);
     $iaView->title($genre['title']);
     $iaView->display('genreview');
     break;
 case 'genres':
     $per_page = $iaCore->get('lyrics_per_page', 10);
     $page = isset($_GET['page']) && 1 < $_GET['page'] ? (int) $_GET['page'] : 1;
     $start = ($page - 1) * $per_page;
     $where = false;
     // gets current page and defines start position
     $num_index = 20;
     $page = !empty($_GET['page']) ? (int) $_GET['page'] : 1;
     $start = (max($page, 1) - 1) * $num_index;
Пример #16
0
            $start = ($page - 1) * $per_page;
            $search_alphas = iaUtil::getLetters();
            $alpha = isset($iaCore->requestPath[0]) && in_array($iaCore->requestPath[0], $search_alphas) ? $iaCore->requestPath[0] : false;
            $cause = $alpha ? '0-9' == $alpha ? "(`title` REGEXP '^[0-9]') AND " : "(`title` LIKE '{$alpha}%') AND " : '';
            $iaView->assign('search_alphas', $search_alphas);
            $iaView->assign('alpha', $alpha);
            $iaArtist->where = $cause . "`status`='active' ORDER BY `title` ASC ";
            $artists = $iaArtist->getArtists(false, $start, $per_page);
            $total_artists = $iaArtist->count;
            if ($artists) {
                $iaItem = $iaCore->factory('item');
                $artists = $iaItem->updateItemsFavorites($artists, $iaArtist->getItemName());
                // filter fields
                $fields = iaField::filterFields($artists, 'artists');
                $iaView->assign('fields', $fields);
            }
            $iaView->assign('artists', $artists);
            $iaView->assign('aTotal', $total_artists);
            $iaView->assign('aItemsPerPage', $per_page);
            if ($alpha) {
                iaBreadcrumb::add(_t('artists'), IA_PACKAGE_URL . 'artists/');
                iaBreadcrumb::replaceEnd($alpha, '');
                $iaView->assign('aTemplate', IA_URL . 'artists/' . $alpha . '/?page={page}');
            } else {
                $iaView->assign('aTemplate', IA_URL . 'artists/?page={page}');
            }
            break;
        default:
            break;
    }
}
Пример #17
0
 /**
  * Resets breadcrumb chain array
  *
  * @return void
  */
 public static function clear()
 {
     self::$_list = array();
 }
Пример #18
0
 * (at your option) any later version.
 *
 * Subrion is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Subrion. If not, see <http://www.gnu.org/licenses/>.
 *
 *
 * @link http://www.subrion.org/
 *
 ******************************************************************************/
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    iaBreadcrumb::preEnd(iaLanguage::get('payment'), IA_SELF);
    $transactionId = isset($iaCore->requestPath[0]) ? iaSanitize::paranoid($iaCore->requestPath[0]) : 0;
    $action = isset($iaCore->requestPath[1]) ? iaSanitize::sql($iaCore->requestPath[1]) : null;
    if (empty($transactionId)) {
        return iaView::errorPage(iaView::ERROR_NOT_FOUND);
    }
    $iaTransaction = $iaCore->factory('transaction');
    $iaPage = $iaCore->factory('page', iaCore::FRONT);
    $transaction = $iaTransaction->getBy('sec_key', $transactionId);
    if (empty($transaction)) {
        return iaView::errorPage(iaView::ERROR_NOT_FOUND, iaLanguage::get('no_transaction'));
    }
    // delete transaction
    if (isset($_GET['delete'])) {
        $iaTransaction->delete($transaction['id']);
        $iaView->setMessages(iaLanguage::get('invoice_deleted'), iaView::SUCCESS);
Пример #19
0
        case iaCore::ACTION_EDIT:
            $output = $iaProduct->gridUpdate($_POST);
            break;
        case iaCore::ACTION_DELETE:
            $output = $iaProduct->gridDelete($_POST);
    }
    $iaView->assign($output);
}
// process html page actions
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    // display grid
    if (iaCore::ACTION_READ == $pageAction) {
        $iaView->grid('_IA_URL_packages/affiliates/js/admin/products');
    } else {
        $baseUrl = IA_ADMIN_URL . $iaProduct->getModuleUrl();
        iaBreadcrumb::add(iaLanguage::get('products'), $baseUrl);
        if (iaCore::ACTION_EDIT == $pageAction) {
            if (!isset($_GET['id'])) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
            $listingData = $iaProduct->getById((int) $_GET['id']);
            if (empty($listingData)) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
        } else {
            $listingData = array('member_id' => iaUsers::getIdentity()->id, 'date_added' => date(iaDb::DATETIME_SHORT_FORMAT), 'status' => iaCore::STATUS_ACTIVE);
        }
        // define fields class
        $iaField = $iaCore->factory('field');
        // process mandatory hook
        $iaCore->startHook('editItemSetSystemDefaults', array('item' => &$listingData));
Пример #20
0
    }
    if (count($itemsFlat) > 0) {
        $limit = $iaCore->get('num_items_perpage');
        foreach ($itemsFlat as $itemName) {
            if ($class = $iaCore->factoryPackage('item', $itemsList[$itemName], iaCore::FRONT, $itemName)) {
                $result = method_exists($class, iaUsers::METHOD_NAME_GET_LISTINGS) ? $class->{iaUsers::METHOD_NAME_GET_LISTINGS}($member['id'], $start, $limit) : null;
                if (!is_null($result)) {
                    if ($result['items']) {
                        $result['items'] = $iaItem->updateItemsFavorites($result['items'], $itemName);
                    }
                    $member['items'][$itemName] = $result;
                    $member['items'][$itemName]['fields'] = $iaField->filter($member['items'][$itemName]['items'], $itemName);
                }
            }
        }
    }
    $alpha = substr($member[$filterBy], 0, 1);
    $alpha || ($alpha = substr($member['username'], 0, 1));
    $alpha = strtoupper($alpha);
    $iaView->set('subpage', $alpha);
    iaBreadcrumb::preEnd($alpha, $iaPage->getUrlByName('members') . $alpha . IA_URL_DELIMITER);
    $iaView->assign('item', $member);
    $iaView->assign('sections', $sections);
    $title = empty($member['fullname']) ? $member['username'] : $member['fullname'];
    $iaView->title($title);
    // add open graph data
    $avatar = $member['avatar'] ? unserialize($member['avatar']) : '';
    $openGraph = array('title' => $title, 'url' => IA_SELF, 'image' => $avatar ? IA_CLEAR_URL . 'uploads/' . $avatar['path'] : '');
    $iaView->set('og', $openGraph);
    $iaView->display('view-member');
}
Пример #21
0
            // get account info
            if ($lyric['member_id'] > 0) {
                $author = $iaDb->row('*', "`id`='{$lyric['member_id']}'", iaUsers::getTable());
                $iaView->assign('author', $author);
            }
            // get artist information
            $iaArtist = $iaCore->factoryPackage('artist', IA_CURRENT_PACKAGE);
            $artist = $iaArtist->getArtist($lyric['id_artist']);
            $iaView->assign('artist', $artist);
            // get album information
            $iaAlbum = $iaCore->factoryPackage('album', IA_CURRENT_PACKAGE);
            $album = $iaAlbum->getAlbum($lyric['id_album']);
            $iaView->assign('album', $album);
            // count views
            $iaLyric->incrementViewsCounter($lyric['id']);
            // breadcrumb formation
            iaBreadcrumb::add(_t('artists'), 'artists/');
            iaBreadcrumb::add($artist['title'], $iaCore->iaSmarty->ia_url(array('type' => 'url', 'item' => $iaArtist->getItemName(), 'data' => $artist)));
            iaBreadcrumb::add($album['title'], $iaCore->iaSmarty->ia_url(array('type' => 'url', 'item' => $iaAlbum->getItemName(), 'data' => $album)));
            // set meta keywords and description
            $iaView->set('description', isset($lyric['meta_description']) ? $lyric['meta_description'] : '');
            $iaView->set('keywords', isset($lyric['meta_keywords']) ? $lyric['meta_keywords'] : '');
            $iaView->title($lyric['title']);
            $iaView->display('lyricview');
            break;
        case 'lyrics_home':
            // display index file
            $iaView->display();
            break;
    }
}
Пример #22
0
 private function _setGroup(&$iaView, array $groupData)
 {
     $iaItem = $this->_iaCore->factory('item');
     if ($this->_type) {
         $entity = 'user' == $this->_type ? $this->_iaCore->factory('users')->getInfo($this->_typeId) : $this->_iaDb->row(array('name'), iaDb::convertIds($this->_typeId), iaUsers::getUsergroupsTable());
         if (!$entity) {
             return iaView::errorPage(iaView::ERROR_NOT_FOUND);
         }
         $title = 'user' == $this->_type ? $entity['fullname'] : iaLanguage::get('usergroup_' . $entity['name']);
         $title = iaLanguage::getf('custom_configuration_title', array('settings' => $groupData['title'], 'title' => $title, 'type' => strtolower(iaLanguage::get('user' == $this->_type ? 'member' : 'usergroup'))));
     } else {
         $title = $groupData['title'];
     }
     $iaView->title($title);
     if ($groupData['extras']) {
         $iaPage = $this->_iaCore->factory('page', iaCore::ADMIN);
         $activeMenu = $groupData['name'];
         if ($groupData['extras'] == $this->_iaCore->get('tmpl')) {
             // template configuration options
             $page = $iaPage->getByName('templates');
             $iaView->set('group', $page['group']);
             $iaView->set('active_config', $groupData['name']);
             iaBreadcrumb::add($page['title'], IA_ADMIN_URL . $page['alias']);
         } elseif ($pluginPage = $this->_iaDb->row(array('alias', 'group'), iaDb::printf("`name` = ':name' OR `name` = ':name_stats'", array('name' => $groupData['extras'])), iaPage::getAdminTable())) {
             // it is a package
             $iaView->set('group', $pluginPage['group']);
             $iaView->set('active_config', $groupData['name']);
             $activeMenu = null;
             iaBreadcrumb::insert($groupData['title'], IA_ADMIN_URL . $pluginPage['alias'], iaBreadcrumb::POSITION_FIRST);
         } elseif ($iaItem->isExtrasExist($groupData['extras'], iaItem::TYPE_PLUGIN)) {
             // plugin with no admin pages
             $iaView->set('group', 5);
             $iaView->set('active_config', $groupData['extras']);
         }
     } else {
         $activeMenu = 'configuration_' . $groupData['name'];
         iaBreadcrumb::toEnd($groupData['title'], IA_SELF);
     }
     $iaView->set('active_menu', $activeMenu);
 }
Пример #23
0
 * (at your option) any later version.
 *
 * Subrion is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Subrion. If not, see <http://www.gnu.org/licenses/>.
 *
 *
 * @link http://www.subrion.org/
 *
 ******************************************************************************/
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    iaBreadcrumb::remove(iaBreadcrumb::POSITION_LAST);
    $iaView->set('nocsrf', true);
    $data = file_get_contents('php://input');
    if (empty($data)) {
        return iaView::errorPage(iaView::ERROR_NOT_FOUND);
    }
    $iaView->disableLayout();
    $iaTransaction = $iaCore->factory('transaction');
    $params = array();
    parse_str($data, $params);
    if (isset($params['user_variable_0']) && isset($params['user_variable_1']) && isset($params['user_variable_2'])) {
        $transaction = $iaTransaction->getBy('sec_key', $params['user_variable_0']);
        if (md5(IA_SALT . $transaction['id']) == $params['user_variable_1']) {
            $values = array('date' => $params['created'], 'amount' => $params['amount'], 'currency' => $params['currency_id'], 'reference_id' => $params['transaction'], 'notes' => 'Updated via IPN at ' . date(iaDb::DATETIME_FORMAT));
            $iaDb->update($values, iaDb::convertIds($params['user_variable_0'], 'sec_key'), null, $iaTransaction::getTable());
            $iaTransaction->addIpnLogEntry(IA_CURRENT_PLUGIN, $params, 'Valid');
Пример #24
0
 protected function _setBreadcrumb()
 {
     if (self::REQUEST_HTML != $this->getRequestType()) {
         return;
     }
     $this->iaCore->factory('breadcrumb');
     if (iaBreadcrumb::total() > 0 || $this->isHomepage() && empty($this->iaCore->requestPath)) {
         return;
     }
     iaCore::ACCESS_FRONT == $this->iaCore->getAccessType() ? iaBreadcrumb::root($this->iaCore->get('bc_home'), IA_URL) : iaBreadcrumb::root(iaLanguage::get('dashboard'), IA_ADMIN_URL);
     $pluginName = $this->get('extras');
     switch ($this->iaCore->getAccessType()) {
         case iaCore::ACCESS_FRONT:
             $parents = array();
             $iaPage = $this->iaCore->factory('page', iaCore::FRONT);
             $iaPage->getParents($this->get('parent'), $parents);
             if ($parents) {
                 iaBreadcrumb::addChain($parents);
             } elseif ($pluginName && 'package' == $this->get('type') && $pluginName . '_home' != $this->name()) {
                 if ($this->iaCore->get('default_package') != $pluginName) {
                     iaBreadcrumb::add(iaLanguage::get($pluginName), IA_PACKAGE_URL);
                 }
             }
             if ($url = $iaPage->getUrlByName($this->name())) {
                 iaBreadcrumb::toEnd(iaLanguage::get('page_title_' . $this->name(), $this->name()), $url);
             }
             break;
         case iaCore::ACCESS_ADMIN:
             $iaPage = $this->iaCore->factory('page', iaCore::ADMIN);
             if ($pluginName) {
                 if ('package' == $this->get('type')) {
                     $title = iaLanguage::get($pluginName . '_package');
                     $url = IA_ADMIN_URL . $pluginName . IA_URL_DELIMITER;
                     $pluginName . '_stats' != $this->name() ? iaBreadcrumb::add($title, $url) : iaBreadcrumb::replaceEnd($title, $url);
                 }
             }
             $url = $iaPage->getUrlByName($this->name());
             iaBreadcrumb::add($this->get('title', $this->name()), $url);
             if (in_array($this->get('action'), array(iaCore::ACTION_ADD, iaCore::ACTION_EDIT))) {
                 iaBreadcrumb::toEnd(iaLanguage::get($this->get('action')), IA_SELF);
             }
     }
 }
Пример #25
0
        case iaCore::ACTION_EDIT:
            $output = $iaCommission->gridUpdate($_POST);
            break;
        case iaCore::ACTION_DELETE:
            $output = $iaCommission->gridDelete($_POST);
    }
    $iaView->assign($output);
}
// process html page actions
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    // display grid
    if (iaCore::ACTION_READ == $pageAction) {
        $iaView->grid('_IA_URL_packages/affiliates/js/admin/commissions');
    } else {
        $baseUrl = IA_ADMIN_URL . 'affiliates/commissions/';
        iaBreadcrumb::add(iaLanguage::get('commissions'), $baseUrl);
        $commission = array('status' => iaCore::STATUS_ACTIVE, 'sale_date' => date('Y-m-d'), 'sale_amount' => 0, 'payout_amount' => 0);
        if (iaCore::ACTION_EDIT == $pageAction) {
            if (!isset($_GET['id'])) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
            $commission = $iaCommission->getById((int) $_GET['id']);
            if (empty($commission)) {
                iaView::errorPage(iaView::ERROR_NOT_FOUND);
            }
            $commission['member'] = $commission['member_id'] ? $iaDb->one('`username`', "`id` = {$commission['member_id']}", iaUsers::getTable()) : 0;
        }
        // define fields class
        $iaFields = iaCore::fields();
        // process mandatory hook
        $iaCore->startHook('editItemSetSystemDefaults', array('item' => &$commission));
Пример #26
0
 protected function _indexPage(&$iaView)
 {
     if ('phrases' == $iaView->get('name')) {
         iaBreadcrumb::preEnd(iaLanguage::get('languages'), IA_ADMIN_URL . 'languages/');
         $iaView->assign('action', 'phrases');
         $iaView->display('languages');
         return true;
     }
     $action = isset($this->_iaCore->requestPath[0]) ? $this->_iaCore->requestPath[0] : 'list';
     $iaView->assign('action', $action);
     switch ($action) {
         case 'search':
             $pageCaption = iaLanguage::get('search_in_phrases');
             break;
         case 'download':
             $pageCaption = iaLanguage::get('export_language');
             if (isset($_POST['lang']) && $_POST['lang'] || isset($this->_iaCore->requestPath[1]) && array_key_exists($this->_iaCore->requestPath[1], $this->_iaCore->languages)) {
                 $this->_downloadLanguage($iaView);
             }
             break;
         case 'comparison':
             $pageCaption = iaLanguage::get('languages_comparison');
             $this->_compareLanguages($iaView);
             break;
         case 'rm':
             // TODO: set checkAccess
             $this->_removeLanguage($iaView);
             iaUtil::go_to($this->getPath());
             break;
         case 'default':
             $this->_setLanguageAsDefault($iaView);
             iaUtil::go_to($this->getPath());
             break;
         case 'import':
             $result = $this->_importLanguage($iaView);
             iaUtil::go_to($this->getPath() . ($result ? '' : 'download/'));
             break;
     }
     if (isset($pageCaption)) {
         iaBreadcrumb::toEnd($pageCaption, IA_SELF);
         $iaView->title($pageCaption);
     }
 }
Пример #27
0
    $pagination = array('limit' => 20, 'total' => (int) $iaDb->one(iaDb::STMT_COUNT_ROWS, $cause . "`status` = 'active' "), 'url' => IA_URL . 'members/' . ($letters['active'] ? $letters['active'] . '/' : '') . '?page={page}');
    $page = !empty($_GET['page']) ? (int) $_GET['page'] : 1;
    $start = (max($page, 1) - 1) * $pagination['limit'];
    $membersList = $iaDb->all(iaDb::ALL_COLUMNS_SELECTION, $cause . "`status` = 'active' ORDER BY `date_reg`", $start, $pagination['limit']);
    $fields = $iaCore->factory('field')->filter($membersList, iaUsers::getTable());
    $letters['existing'] = array();
    $array = $iaDb->all('DISTINCT UPPER(SUBSTR(`' . $filterBy . '`, 1, 1)) `letter`', $cause . "`status` = 'active' GROUP BY `username`");
    $iaDb->resetTable();
    if ($array) {
        foreach ($array as $item) {
            $letters['existing'][] = $item['letter'];
        }
    }
    // breadcrumb formation
    if ($activeGroup) {
        iaBreadcrumb::toEnd(iaLanguage::get('usergroup_' . $usergroups[$activeGroup]), IA_URL . 'members/?group=' . $activeGroup);
    }
    if ($letters['active']) {
        iaBreadcrumb::toEnd($letters['active'], IA_SELF);
    }
    if ($membersList) {
        $membersList = $iaCore->factory('item')->updateItemsFavorites($membersList, $iaUsers->getItemName());
    }
    $iaView->assign('title', iaLanguage::get('members') . ($letters['active'] ? " [ {$letters['active']} ] " : ''));
    $iaView->assign('filter', $filterBy);
    $iaView->assign('letters', $letters);
    $iaView->assign('members', $membersList);
    $iaView->assign('pagination', $pagination);
    $iaView->assign('fields', $fields);
    $iaView->title(iaLanguage::get('members') . ($letters['active'] ? " [{$letters['active']}] " : ''));
}
Пример #28
0
 if (isset($iaCore->requestPath[0])) {
     $id = (int) $iaCore->requestPath[0];
     if (!$id) {
         return iaView::errorPage(iaView::ERROR_NOT_FOUND);
     }
     $sql = 'SELECT b.`id`, b.`title`, b.`date_added`, b.`body`, b.`alias`, b.`image`, m.`fullname` ' . 'FROM `:prefix:table_blog_entries` b ' . 'LEFT JOIN `:prefix:table_members` m ON (b.`member_id` = m.`id`) ' . 'WHERE b.`id` = :id AND b.`status` = \':status\' ';
     $sql = iaDb::printf($sql, array('prefix' => $iaDb->prefix, 'table_blog_entries' => 'blog_entries', 'table_members' => iaUsers::getTable(), 'id' => iaSanitize::sql($id), 'status' => iaCore::STATUS_ACTIVE));
     $blogEntry = $iaDb->getRow($sql);
     $sql = 'SELECT DISTINCT bt.`title`, bt.`alias` ' . 'FROM `:prefix:table_blog_tags` bt ' . 'LEFT JOIN `:prefix:table_blog_entries_tags` bet ON (bt.`id` = bet.`tag_id`) ' . 'WHERE bet.`blog_id` = :id';
     $sql = iaDb::printf($sql, array('prefix' => $iaDb->prefix, 'table_blog_entries_tags' => 'blog_entries_tags', 'table_blog_tags' => 'blog_tags', 'id' => iaSanitize::sql($id)));
     $blogTags = $iaDb->getAll($sql);
     if (empty($blogEntry)) {
         return iaView::errorPage(iaView::ERROR_NOT_FOUND);
     }
     $title = iaSanitize::tags($blogEntry['title']);
     iaBreadcrumb::toEnd($title);
     $iaView->title($title);
     // add open graph data
     $openGraph = array('title' => $title, 'url' => IA_SELF, 'description' => $blogEntry['body']);
     if ($blogEntry['image']) {
         $openGraph['image'] = IA_CLEAR_URL . 'uploads/' . $blogEntry['image'];
     }
     $iaView->set('og', $openGraph);
     $iaView->assign('tags', $blogTags);
     $iaView->assign('blog_entry', $blogEntry);
 } else {
     $page = empty($_GET['page']) ? 0 : (int) $_GET['page'];
     $page = $page < 1 ? 1 : $page;
     $pageUrl = $iaCore->factory('page', iaCore::FRONT)->getUrlByName('blog');
     $pagination = array('start' => ($page - 1) * $iaCore->get('blog_number'), 'limit' => (int) $iaCore->get('blog_number'), 'template' => $pageUrl . '?page={page}');
     $order = 'date' == $iaCore->get('blog_order') ? 'ORDER BY `date_added` DESC' : 'ORDER BY `title` ASC';
Пример #29
0
if (iaView::REQUEST_HTML == $iaView->getRequestType()) {
    $iaGenre = $iaCore->factoryPackage('genre', IA_CURRENT_PACKAGE, iaCore::ADMIN);
    $genres = $iaGenre->getGenres("t1.`status` = 'active'");
    $iaView->assign('genres', $genres);
    // init classes
    $iaField = $iaCore->factory('field');
    $error = false;
    $errorFields = array();
    $messages = array();
    switch ($pageAction) {
        default:
            $iaView->grid('_IA_URL_packages/lyrics/js/admin/artists');
            break;
        case 'edit':
        case 'add':
            iaBreadcrumb::add(iaLanguage::get('artists'), IA_ADMIN_URL . 'lyrics/artists/');
            if ('edit' == $pageAction) {
                $item = $iaArtist->getById((int) $_GET['id']);
                if (empty($item)) {
                    iaView::errorPage(iaView::ERROR_NOT_FOUND);
                }
            } elseif ('add' == $pageAction) {
                // these fields are system and used in system template
                $item = array('status' => 'active', 'account_username' => $_SESSION['user']['username'], 'featured' => false);
            }
            $fields = iaField::getAllFields(true, '', 'artists');
            if (isset($_POST['save'])) {
                iaCore::util();
                if ($fields) {
                    list($data, $error, $messages, $errorFields) = iaField::parsePost($fields, $item, true);
                }