• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP osc_apply_filter函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中osc_apply_filter函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_apply_filter函数的具体用法?PHP osc_apply_filter怎么用?PHP osc_apply_filter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了osc_apply_filter函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct()
 {
     parent::__construct();
     // check if is moderator and can enter to this page
     if ($this->isModerator()) {
         if (!in_array($this->page, osc_apply_filter('moderator_access', array('items', 'comments', 'media', 'login', 'admins', 'ajax', 'stats', '')))) {
             osc_add_flash_error_message(_m("You don't have enough permissions"), 'admin');
             $this->redirectTo(osc_admin_base_url());
         }
     }
     osc_run_hook('init_admin');
     $config_version = str_replace('.', '', OSCLASS_VERSION);
     $config_version = preg_replace('|-.*|', '', $config_version);
     if ($config_version > osc_get_preference('version')) {
         if (get_class($this) == 'CAdminTools') {
         } else {
             if (get_class($this) != 'CAdminUpgrade') {
                 $this->redirectTo(osc_admin_base_url(true) . '?page=upgrade');
             }
         }
     }
     // show donation successful
     if (Params::getParam('donation') == 'successful') {
         osc_add_flash_ok_message(_m('Thank you very much for your donation'), 'admin');
     }
     // enqueue scripts
     osc_enqueue_script('jquery');
     osc_enqueue_script('jquery-ui');
     osc_enqueue_script('admin-osc');
     osc_enqueue_script('admin-ui-osc');
 }
开发者ID:mylastof,项目名称:os-class,代码行数:31,代码来源:AdminSecBaseModel.php


示例2: admin_header_favicons

function admin_header_favicons()
{
    $favicons = array();
    $favicons[] = array('rel' => 'shortcut icon', 'sizes' => '', 'href' => osc_current_admin_theme_url('images/favicon-48.png'));
    $favicons[] = array('rel' => 'apple-touch-icon-precomposed', 'sizes' => '144x144', 'href' => osc_current_admin_theme_url('images/favicon-144.png'));
    $favicons[] = array('rel' => 'apple-touch-icon-precomposed', 'sizes' => '114x114', 'href' => osc_current_admin_theme_url('images/favicon-114.png'));
    $favicons[] = array('rel' => 'apple-touch-icon-precomposed', 'sizes' => '72x72', 'href' => osc_current_admin_theme_url('images/favicon-72.png'));
    $favicons[] = array('rel' => 'apple-touch-icon-precomposed', 'sizes' => '', 'href' => osc_current_admin_theme_url('images/favicon-57.png'));
    $favicons = osc_apply_filter('admin_favicons', $favicons);
    foreach ($favicons as $f) {
        ?>
        <link <?php 
        if ($f['rel'] !== '') {
            ?>
rel="<?php 
            echo $f['rel'];
            ?>
" <?php 
        }
        if ($f['sizes'] !== '') {
            ?>
sizes="<?php 
            echo $f['sizes'];
            ?>
" <?php 
        }
        ?>
href="<?php 
        echo $f['href'];
        ?>
">
    <?php 
    }
}
开发者ID:mylastof,项目名称:os-class,代码行数:34,代码来源:functions.php


示例3: processData

 private function processData($products)
 {
     if (!empty($products)) {
         $total = 0;
         foreach ($products as $aRow) {
             $row = array();
             $row['id'] = $aRow['id'];
             $row['description'] = $aRow['description'];
             $row['amount'] = osc_format_price(1000000 * $aRow['amount'], osc_get_preference('currency', 'payment_pro'));
             $row['quantity'] = $aRow['quantity'];
             $row['total'] = osc_format_price(1000000 * $aRow['amount'] * $aRow['quantity'], osc_get_preference('currency', 'payment_pro'));
             $row['delete'] = '<a href="' . osc_route_url('payment-pro-cart-delete', array('id' => $aRow['id'])) . '" >' . __('Delete', 'payment_pro') . '</a>';
             $row = osc_apply_filter('payment_pro_processing_row', $row, $aRow);
             $this->addRow($row);
             $this->rawRows[] = $aRow;
             $total += $aRow['amount'] * $aRow['quantity'];
         }
         $row = array();
         $row['id'] = '';
         $row['description'] = '';
         $row['amount'] = '';
         $row['quantity'] = '<b>' . __('Total', 'payment_pro') . '</b>';
         $row['total'] = '<b>' . osc_format_price(1000000 * $total, osc_get_preference('currency', 'payment_pro')) . '</b>';
         $row['delete'] = '';
         $this->addRow($row);
         //$this->rawRows[] = $row;
     }
 }
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:28,代码来源:CheckoutDataTable.php


示例4: processData

 private function processData($pages)
 {
     if (!empty($pages)) {
         $prefLocale = osc_current_user_locale();
         foreach ($pages as $aRow) {
             $row = array();
             $content = array();
             if (isset($aRow['locale'][$prefLocale]) && !empty($aRow['locale'][$prefLocale]['s_title'])) {
                 $content = $aRow['locale'][$prefLocale];
             } else {
                 $content = current($aRow['locale']);
             }
             // -- options --
             $options = array();
             View::newInstance()->_exportVariableToView('page', $aRow);
             $options[] = '<a href="' . osc_static_page_url() . '" target="_blank">' . __('View page') . '</a>';
             $options[] = '<a href="' . osc_admin_base_url(true) . '?page=pages&amp;action=edit&amp;id=' . $aRow['pk_i_id'] . '">' . __('Edit') . '</a>';
             if (!$aRow['b_indelible']) {
                 $options[] = '<a onclick="return delete_dialog(\'' . $aRow['pk_i_id'] . '\');" href="' . osc_admin_base_url(true) . '?page=pages&amp;action=delete&amp;id=' . $aRow['pk_i_id'] . '&amp;' . osc_csrf_token_url() . '">' . __('Delete') . '</a>';
             }
             $auxOptions = '<ul>' . PHP_EOL;
             foreach ($options as $actual) {
                 $auxOptions .= '<li>' . $actual . '</li>' . PHP_EOL;
             }
             $actions = '<div class="actions">' . $auxOptions . '</div>' . PHP_EOL;
             $row['bulkactions'] = '<input type="checkbox" name="id[]"" value="' . $aRow['pk_i_id'] . '"" />';
             $row['internal_name'] = $aRow['s_internal_name'] . $actions;
             $row['title'] = $content['s_title'];
             $row['order'] = '<div class="order-box">' . $aRow['i_order'] . ' <img class="up" onclick="order_up(' . $aRow['pk_i_id'] . ');" src="' . osc_current_admin_theme_url('images/arrow_up.png') . '" alt="' . __('Up') . '" title="' . __('Up') . '" />  <img class="down" onclick="order_down(' . $aRow['pk_i_id'] . ');" src="' . osc_current_admin_theme_url('images/arrow_down.png') . '" alt="' . __('Down') . '" title="' . __('Down') . '" /></div>';
             $row = osc_apply_filter('pages_processing_row', $row, $aRow);
             $this->addRow($row);
             $this->rawRows[] = $aRow;
         }
     }
 }
开发者ID:mylastof,项目名称:os-class,代码行数:35,代码来源:PagesDataTable.php


示例5: payment_pro_check_items_blockchain

function payment_pro_check_items_blockchain($items, $total, $rate = 1, $error = 0.15)
{
    $subtotal = 0;
    foreach ($items as $item) {
        $item['amount'] = $item['amount'] / 1000000;
        $subtotal += $item['amount'];
        $str = substr($item['id'], 0, 3);
        if ($str == 'PUB') {
            $cat = explode("-", $item['id']);
            $price = ModelPaymentPro::newInstance()->getPublishPrice(substr($cat[0], 3));
            if ($item['quantity'] != 1 || $price != $item['amount']) {
                return PAYMENT_PRO_WRONG_AMOUNT_ITEM;
            }
        }
        if ($str == 'PRM') {
            $cat = explode("-", $item['id']);
            $price = ModelPaymentPro::newInstance()->getPremiumPrice(substr($cat[0], 3));
            if ($item['quantity'] != 1 || $price != $item['amount']) {
                return PAYMENT_PRO_WRONG_AMOUNT_ITEM;
            }
        } else {
            $correct_price = osc_apply_filter('payment_pro_price_' . strtolower($str), true, $item);
            if (!$correct_price) {
                return PAYMENT_PRO_WRONG_AMOUNT_ITEM;
            }
        }
    }
    if (abs($subtotal * $rate - $total) > $total * $error) {
        return PAYMENT_PRO_WRONG_AMOUNT_TOTAL;
    }
    return PAYMENT_PRO_COMPLETED;
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:32,代码来源:load.php


示例6: setCurrentThemeUrl

 public function setCurrentThemeUrl()
 {
     if ($this->theme_exists) {
         $this->theme_url = osc_apply_filter('theme_url', osc_base_url() . str_replace(osc_base_path(), '', $this->theme_path));
     } else {
         $this->theme_url = osc_apply_filter('theme_url', osc_base_url() . 'oc-includes/osclass/gui/');
     }
 }
开发者ID:oanav,项目名称:closetshare,代码行数:8,代码来源:WebThemes.php


示例7: customPageHeader

function customPageHeader()
{
    ?>
        <h1><?php 
    echo osc_apply_filter('custom_appearance_title', __('Appearance'));
    ?>
</h1>
    <?php 
}
开发者ID:oanav,项目名称:closetshare,代码行数:9,代码来源:view.php


示例8: osc_admin_base_url

/**
 * Gets the root url of oc-admin for your installation
 *
 * @param boolean $with_index true if index.php in the url is needed
 * @return string
 */
function osc_admin_base_url($with_index = false)
{
    $path = osc_base_url(false) . 'oc-admin/';
    // add the index.php if it's true
    if ($with_index) {
        $path .= "index.php";
    }
    return osc_apply_filter('admin_base_url', $path, $with_index);
}
开发者ID:oanav,项目名称:closetshare,代码行数:15,代码来源:hDefines.php


示例9: getVariables

 /**
  *
  * @param type $email 
  */
 function getVariables($email)
 {
     $array = array();
     $variables = array('email_alert_validation' => array('{USER_NAME}', '{USER_EMAIL}', '{VALIDATION_LINK}'), 'alert_email_hourly' => array('{USER_NAME}', '{USER_EMAIL}', '{ADS}', '{UNSUB_LINK}'), 'alert_email_daily' => array('{USER_NAME}', '{USER_EMAIL}', '{ADS}', '{UNSUB_LINK}'), 'alert_email_weekly' => array('{USER_NAME}', '{USER_EMAIL}', '{ADS}', '{UNSUB_LINK}'), 'alert_email_instant' => array('{USER_NAME}', '{USER_EMAIL}', '{ADS}', '{UNSUB_LINK}'), 'email_comment_validated' => array('{COMMENT_AUTHOR}', '{COMMENT_EMAIL}', '{COMMENT_TITLE}', '{COMMENT_BODY}', '{ITEM_URL}', '{ITEM_LINK}', '{ITEM_TITLE}'), 'email_new_item_non_register_user' => array('{ITEM_ID}', '{USER_NAME}', '{USER_EMAIL}', '{ITEM_TITLE}', '{ITEM_URL}', '{ITEM_LINK}', '{EDIT_LINK}', '{EDIT_URL}', '{DELETE_LINK}', '{DELETE_URL}'), 'email_user_forgot_password' => array('{USER_NAME}', '{USER_EMAIL}', '{PASSWORD_LINK}', '{PASSWORD_URL}', '{DATE_TIME}'), 'email_user_registration' => array('{USER_NAME}', '{USER_EMAIL}'), 'email_new_email' => array('{USER_NAME}', '{USER_EMAIL}', '{VALIDATION_LINK}', '{VALIDATION_URL}'), 'email_user_validation' => array('{USER_NAME}', '{USER_EMAIL}', '{VALIDATION_LINK}', '{VALIDATION_URL}'), 'email_send_friend' => array('{FRIEND_NAME}', '{USER_NAME}', '{USER_EMAIL}', '{FRIEND_EMAIL}', '{ITEM_TITLE}', '{COMMENT}', '{ITEM_URL}', '{ITEM_LINK}'), 'email_item_inquiry' => array('{CONTACT_NAME}', '{USER_NAME}', '{USER_EMAIL}', '{USER_PHONE}', '{ITEM_TITLE}', '{ITEM_URL}', '{ITEM_LINK}', '{COMMENT}'), 'email_new_comment_admin' => array('{COMMENT_AUTHOR}', '{COMMENT_EMAIL}', '{COMMENT_TITLE}', '{COMMENT_TEXT}', '{ITEM_TITLE}', '{ITEM_ID}', '{ITEM_URL}', '{ITEM_LINK}'), 'email_item_validation' => array('{ITEM_DESCRIPTION_ALL_LANGUAGES}', '{ITEM_DESCRIPTION}', '{ITEM_COUNTRY}', '{ITEM_PRICE}', '{ITEM_REGION}', '{ITEM_CITY}', '{ITEM_ID}', '{USER_NAME}', '{USER_EMAIL}', '{ITEM_TITLE}', '{ITEM_URL}', '{ITEM_LINK}', '{VALIDATION_LINK}', '{VALIDATION_URL}'), 'email_admin_new_item' => array('{EDIT_LINK}', '{EDIT_URL}', '{ITEM_DESCRIPTION_ALL_LANGUAGES}', '{ITEM_DESCRIPTION}', '{ITEM_COUNTRY}', '{ITEM_PRICE}', '{ITEM_REGION}', '{ITEM_CITY}', '{ITEM_ID}', '{USER_NAME}', '{USER_EMAIL}', '{ITEM_TITLE}', '{ITEM_URL}', '{ITEM_LINK}', '{VALIDATION_LINK}', '{VALIDATION_URL}'), 'email_item_validation_non_register_user' => array('{ITEM_DESCRIPTION_ALL_LANGUAGES}', '{ITEM_DESCRIPTION}', '{ITEM_COUNTRY}', '{ITEM_PRICE}', '{ITEM_REGION}', '{ITEM_CITY}', '{ITEM_ID}', '{USER_NAME}', '{USER_EMAIL}', '{ITEM_TITLE}', '{ITEM_URL}', '{ITEM_LINK}', '{VALIDATION_LINK}', '{VALIDATION_URL}', '{EDIT_LINK}', '{EDIT_URL}', '{DELETE_LINK}', '{DELETE_URL}'), 'email_admin_new_user' => array('{USER_NAME}', '{USER_EMAIL}'), 'email_contact_user' => array('{CONTACT_NAME}', '{USER_NAME}', '{USER_EMAIL}', '{USER_PHONE}', '{COMMENT}'), 'email_new_comment_user' => array('{COMMENT_AUTHOR}', '{COMMENT_EMAIL}', '{COMMENT_TITLE}', '{COMMENT_TEXT}', '{ITEM_TITLE}', '{ITEM_ID}', '{ITEM_URL}', '{ITEM_LINK}', '{SELLER_NAME}', '{SELLER_EMAIL}'), 'email_new_admin' => array('{ADMIN_NAME}', '{USERNAME}', '{PASSWORD}', '{WEB_ADMIN_LINK}'), 'email_warn_expiration' => array('{USER_NAME}', '{ITEM_TITLE}', '{ITEM_ID}', '{ITEM_EXPIRATION_DATE}', '{ITEM_URL}', '{ITEM_LINK}', '{SELLER_NAME}', '{SELLER_EMAIL}', '{CONTACT_NAME}', '{CONTACT_EMAIL}'));
     if (isset($email['s_internal_name']) && isset($variables[$email['s_internal_name']])) {
         foreach ($variables[$email['s_internal_name']] as $word) {
             $array[$word] = $this->variables[$word];
         }
     }
     return osc_apply_filter('email_legend_words', $array, @$email['s_internal_name']);
 }
开发者ID:oanav,项目名称:closetshare,代码行数:15,代码来源:EmailVariables.php


示例10: getItemUrl

 public static function getItemUrl(&$item)
 {
     $gn_id = $item['gn_id'];
     $gn_title = $item['gn_title'];
     $friendly_title = osc_sanitizeString(osc_apply_filter('slug', $gn_title));
     $item_url = GZ_NEWS_URL . 'pages/item.php';
     if (self::isModRewriteEnabled()) {
         $item_url = osc_base_url() . "news/read/{$gn_id}/{$friendly_title}.html";
     } else {
         $item_url = $item_url . "?i={$gn_id}&title={$friendly_title}";
     }
     return $item_url;
 }
开发者ID:faosclass,项目名称:gz_news,代码行数:13,代码来源:GzNewsUtils.php


示例11: __construct

        function __construct()
        {
            parent::__construct();

            // check if is moderator and can enter to this page
            if( $this->isModerator() ) {
                if( !in_array($this->page, osc_apply_filter('moderator_access', array('items', 'comments', 'media', 'login', 'admins', 'ajax', 'stats',''))) ) {
                    osc_add_flash_error_message(_m("You don't have enough permissions"), 'admin');
                    $this->redirectTo(osc_admin_base_url());
                }
            }

            osc_run_hook( 'init_admin' );

            // check if exist a new version each day
            if( (time() - osc_last_version_check()) > (24 * 3600) ) {
                $data = osc_file_get_contents('http://osclass.org/latest_version_v1.php?callback=?');
                $data = preg_replace('|^\?\((.*?)\);$|', '$01', $data);
                $json = json_decode($data);
                if( $json->version > osc_version() ) {
                    osc_set_preference( 'update_core_json', $data );
                } else {
                    osc_set_preference( 'update_core_json', '' );
                }
                osc_set_preference( 'last_version_check', time() );
                osc_reset_preferences();
            }

            $config_version = str_replace('.', '', OSCLASS_VERSION);
            $config_version = preg_replace('|-.*|', '', $config_version);

            if( $config_version > osc_get_preference('version') ) {
                if(get_class($this) == 'CAdminTools') {
                } else {
                    if(get_class($this) != 'CAdminUpgrade' )
                        $this->redirectTo(osc_admin_base_url(true) . '?page=upgrade');
                }
            }

            // show donation successful
            if( Params::getParam('donation') == 'successful' ) {
                osc_add_flash_ok_message(_m('Thank you very much for your donation'), 'admin');
            }

            // enqueue scripts
            osc_enqueue_script('jquery');
            osc_enqueue_script('jquery-ui');
            osc_enqueue_script('admin-osc');
            osc_enqueue_script('admin-ui-osc');
        }
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:50,代码来源:AdminSecBaseModel.php


示例12: doModel

 function doModel()
 {
     $id = Params::getParam('id');
     $page = false;
     if (is_numeric($id)) {
         $page = $this->pageManager->findByPrimaryKey($id);
     } else {
         $page = $this->pageManager->findByInternalName(Params::getParam('slug'));
     }
     // page not found
     if ($page == false) {
         $this->do404();
         return;
     }
     // this page shouldn't be shown (i.e.: e-mail templates)
     if ($page['b_indelible'] == 1) {
         $this->do404();
         return;
     }
     $kwords = array('{WEB_URL}', '{WEB_TITLE}');
     $rwords = array(osc_base_url(), osc_page_title());
     foreach ($page['locale'] as $k => $v) {
         $page['locale'][$k]['s_title'] = str_ireplace($kwords, $rwords, osc_apply_filter('email_description', $v['s_title']));
         $page['locale'][$k]['s_text'] = str_ireplace($kwords, $rwords, osc_apply_filter('email_description', $v['s_text']));
     }
     // export $page content to View
     $this->_exportVariableToView('page', $page);
     if (Params::getParam('lang') != '') {
         Session::newInstance()->_set('userLocale', Params::getParam('lang'));
     }
     $meta = json_decode($page['s_meta'], true);
     // load the right template file
     if (file_exists(osc_themes_path() . osc_theme() . '/page-' . $page['s_internal_name'] . '.php')) {
         $this->doView('page-' . $page['s_internal_name'] . '.php');
     } else {
         if (isset($meta['template']) && file_exists(osc_themes_path() . osc_theme() . '/' . $meta['template'])) {
             $this->doView($meta['template']);
         } else {
             if (isset($meta['template']) && file_exists(osc_plugins_path() . '/' . $meta['template'])) {
                 osc_run_hook('before_html');
                 require osc_plugins_path() . '/' . $meta['template'];
                 Session::newInstance()->_clearVariables();
                 osc_run_hook('after_html');
             } else {
                 $this->doView('page.php');
             }
         }
     }
 }
开发者ID:jmcclenon,项目名称:Osclass,代码行数:49,代码来源:page.php


示例13: processData

 private function processData($media)
 {
     if (!empty($media)) {
         foreach ($media as $aRow) {
             $row = array();
             $row['bulkactions'] = '<input type="checkbox" name="id[]" value="' . $aRow['pk_i_id'] . '" />';
             $row['file'] = '<div id="media_list_pic"><img src="' . osc_apply_filter('resource_path', osc_base_url() . $aRow['s_path']) . $aRow['pk_i_id'] . '_thumbnail.' . $aRow['s_extension'] . '" style="max-width: 60px; max-height: 60px;" /></div> <div id="media_list_filename">' . $aRow['s_content_type'];
             $row['action'] = '<a onclick="return delete_dialog(\'' . $aRow['pk_i_id'] . '\');" >' . __('Delete') . '</a>';
             $row['attached_to'] = '<a target="_blank" href="' . osc_item_url_ns($aRow['fk_i_item_id']) . '">item #' . $aRow['fk_i_item_id'] . '</a>';
             $row['date'] = osc_format_date($aRow['dt_pub_date']);
             $row = osc_apply_filter('media_processing_row', $row, $aRow);
             $this->addRow($row);
             $this->rawRows[] = $aRow;
         }
     }
 }
开发者ID:mylastof,项目名称:os-class,代码行数:16,代码来源:MediaDataTable.php


示例14: processData

 private function processData($rules)
 {
     if (!empty($rules)) {
         $csrf_token_url = osc_csrf_token_url();
         foreach ($rules as $aRow) {
             $row = array();
             $options = array();
             $options_more = array();
             // first column
             $options[] = '<a href="' . osc_admin_base_url(true) . '?page=users&action=edit_ban_rule&amp;id=' . $aRow['pk_i_id'] . '">' . __('Edit') . '</a>';
             $options[] = '<a onclick="return delete_dialog(\'' . $aRow['pk_i_id'] . '\');" href="' . osc_admin_base_url(true) . '?page=users&action=delete_ban_rule&amp;id[]=' . $aRow['pk_i_id'] . '">' . __('Delete') . '</a>';
             $options_more = osc_apply_filter('more_actions_manage_rules', $options_more, $aRow);
             // more actions
             $moreOptions = '<li class="show-more">' . PHP_EOL . '<a href="#" class="show-more-trigger">' . __('Show more') . '...</a>' . PHP_EOL . '<ul>' . PHP_EOL;
             foreach ($options_more as $actual) {
                 $moreOptions .= '<li>' . $actual . "</li>" . PHP_EOL;
             }
             $moreOptions .= '</ul>' . PHP_EOL . '</li>' . PHP_EOL;
             $options = osc_apply_filter('actions_manage_rules', $options, $aRow);
             // create list of actions
             $auxOptions = '<ul>' . PHP_EOL;
             foreach ($options as $actual) {
                 $auxOptions .= '<li>' . $actual . '</li>' . PHP_EOL;
             }
             $auxOptions .= $moreOptions;
             $auxOptions .= '</ul>' . PHP_EOL;
             $actions = '<div class="actions">' . $auxOptions . '</div>' . PHP_EOL;
             $row['bulkactions'] = '<input type="checkbox" name="id[]" value="' . $aRow['pk_i_id'] . '" /></div>';
             $row['name'] = $aRow['s_name'] . $actions;
             $row['ip'] = $aRow['s_ip'];
             $row['email'] = $aRow['s_email'];
             $row = osc_apply_filter('rules_processing_row', $row, $aRow);
             $this->addRow($row);
             $this->rawRows[] = $aRow;
         }
     }
 }
开发者ID:mylastof,项目名称:os-class,代码行数:37,代码来源:BanRulesDataTable.php


示例15: processData

 private function processData($invoices)
 {
     if (!empty($invoices)) {
         foreach ($invoices as $aRow) {
             $row = array();
             $row['status'] = $aRow['i_status'];
             $row['date'] = $aRow['dt_date'];
             $row['code'] = $aRow['s_code'];
             $row['items'] = $this->_invoiceRows($aRow['pk_i_id'], $aRow['s_currency_code']);
             if ($aRow['s_currency_code'] == "BTC") {
                 // FORGET FORMAT IF BTC
                 $row['amount'] = $aRow['i_amount'] / 1000000 . " " . $aRow['s_currency_code'];
             } else {
                 $row['amount'] = osc_format_price($aRow['i_amount'], $aRow['s_currency_code']);
             }
             $row['email'] = $aRow['s_email'];
             $row['user'] = $aRow['fk_i_user_id'];
             $row['source'] = $aRow['s_source'];
             $row = osc_apply_filter('payment_pro_invoices_processing_row', $row, $aRow);
             $this->addRow($row);
             $this->rawRows[] = $aRow;
         }
     }
 }
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:24,代码来源:CheckoutInvoicesDataTable.php


示例16: insert

 public function insert($fields, $aFieldsDescription = null)
 {
     $columns = implode(', ', array_keys($fields));
     $set = "";
     foreach ($fields as $value) {
         if ($set != "") {
             $set .= ", ";
         }
         $set .= $this->formatValue($value);
     }
     $sql = 'INSERT INTO ' . $this->getTableName() . ' (' . $columns . ') VALUES (' . $set . ')';
     $this->conn->osc_dbExec($sql);
     $category_id = $this->conn->get_last_id();
     foreach ($aFieldsDescription as $k => $fieldsDescription) {
         $fieldsDescription['fk_i_category_id'] = $category_id;
         $fieldsDescription['fk_c_locale_code'] = $k;
         $fieldsDescription['s_slug'] = osc_sanitizeString(osc_apply_filter('slug', $fieldsDescription['s_name']));
         $columns = implode(', ', array_keys($fieldsDescription));
         $set = "";
         foreach ($fieldsDescription as $value) {
             if ($set != "") {
                 $set .= ", ";
             }
             $set .= $this->formatValue($value);
         }
         $sql = 'INSERT INTO ' . $this->getTableDescriptionName() . ' (' . $columns . ') VALUES (' . $set . ')';
         $this->conn->osc_dbExec($sql);
     }
 }
开发者ID:hashemgamal,项目名称:OSClass,代码行数:29,代码来源:Category.php


示例17: toDatatablesFormat

 private function toDatatablesFormat()
 {
     $this->result['iTotalRecords'] = $this->total;
     $this->result['iTotalDisplayRecords'] = $this->total_filtered;
     $this->result['sEcho'] = $this->sEcho;
     $this->result['aaData'] = array();
     if (count($this->media) == 0) {
         return;
     }
     $count = 0;
     foreach ($this->media as $aRow) {
         $row = array();
         $row[] = '<input type="checkbox" name="id[]" value="' . $aRow['pk_i_id'] . '" />';
         $row[] = '<div id="media_list_pic"><img src="' . osc_apply_filter('resource_path', osc_base_url() . $aRow['s_path']) . $aRow['pk_i_id'] . '_thumbnail.' . $aRow['s_extension'] . '" style="max-width: 60px; max-height: 60px;" /></div> <div id="media_list_filename">' . $aRow['s_content_type'];
         $row[] = '<a onclick="javascript:return confirm(\'' . osc_esc_js(__('This action can not be undone. Are you sure you want to continue?')) . '\')" href="' . osc_admin_base_url(true) . '?page=media&amp;action=delete&amp;id[]=' . $aRow['pk_i_id'] . '" id="dt_link_delete">' . __('Delete') . '</a>';
         $row[] = '<a target="_blank" href="' . osc_item_url_ns($aRow['fk_i_item_id']) . '">item #' . $aRow['fk_i_item_id'] . '</a>';
         $row[] = $aRow['dt_pub_date'];
         $count++;
         $this->result['aaData'][] = $row;
     }
 }
开发者ID:randomecho,项目名称:OSClass,代码行数:21,代码来源:media_processing.php


示例18: osc_esc_html

         <input type="submit" id="bulk_apply" class="btn" value="<?php echo osc_esc_html( __('Apply') ); ?>" />
     </label>
 </div>
 <div class="table-contains-actions">
     <table class="table" cellpadding="0" cellspacing="0">
         <thead>
             <tr>
                 <?php foreach($columns as $k => $v) {
                     echo '<th class="col-'.$k.' '.($sort==$k?($direction=='desc'?'sorting_desc':'sorting_asc'):'').'">'.$v.'</th>';
                 }; ?>
             </tr>
         </thead>
         <tbody>
         <?php if( count($rows) > 0 ) { ?>
             <?php foreach($rows as $key => $row) { ?>
                 <tr class="<?php echo implode(' ', osc_apply_filter('datatable_user_class', array(), $aRawRows[$key], $row)); ?>">
                     <?php foreach($row as $k => $v) { ?>
                         <td class="col-<?php echo $k; ?>"><?php echo $v; ?></td>
                     <?php }; ?>
                 </tr>
             <?php }; ?>
         <?php } else { ?>
             <tr>
                 <td colspan="9" class="text-center">
                 <p><?php _e('No data available in table'); ?></p>
                 </td>
             </tr>
         <?php } ?>
         </tbody>
     </table>
     <div id="table-row-actions"></div> <!-- used for table actions -->
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:31,代码来源:index.php


示例19: osc_show_flash_message

/**
 * Shows all the pending flash messages in session and cleans up the array.
 *
 * @param $section
 * @param $class
 * @param $id
 * @return void
 */
function osc_show_flash_message($section = 'pubMessages', $class = "flashmessage", $id = "flashmessage")
{
    $messages = Session::newInstance()->_getMessage($section);
    if (is_array($messages)) {
        foreach ($messages as $message) {
            echo '<div id="flash_js"></div>';
            if (isset($message['msg']) && $message['msg'] != '') {
                echo '<div id="' . $id . '" class="' . strtolower($class) . ' ' . strtolower($class) . '-' . $message['type'] . '"><a class="btn ico btn-mini ico-close">x</a>';
                echo osc_apply_filter('flash_message_text', $message['msg']);
                echo '</div>';
            } else {
                if ($message != '') {
                    echo '<div id="' . $id . '" class="' . $class . '">';
                    echo osc_apply_filter('flash_message_text', $message);
                    echo '</div>';
                } else {
                    echo '<div id="' . $id . '" class="' . $class . '" style="display:none;">';
                    echo osc_apply_filter('flash_message_text', '');
                    echo '</div>';
                }
            }
        }
    }
    Session::newInstance()->_dropMessage($section);
}
开发者ID:mylastof,项目名称:os-class,代码行数:33,代码来源:hMessages.php


示例20: doModel


//.........这里部分代码省略.........
             $item = Item::newInstance()->findByPrimaryKey($itemId);
             if (count($item) == 0) {
                 osc_add_flash_error_message(_m("This listing doesn't exist"));
                 $this->redirectTo(osc_base_url(true));
             }
             View::newInstance()->_exportVariableToView('item', $item);
             if ($this->userId == null) {
                 osc_add_flash_error_message(_m('You must be logged in to delete a comment'));
                 $this->redirectTo(osc_item_url());
             }
             $commentManager = ItemComment::newInstance();
             $aComment = $commentManager->findByPrimaryKey($commentId);
             if (count($aComment) == 0) {
                 osc_add_flash_error_message(_m("The comment doesn't exist"));
                 $this->redirectTo(osc_item_url());
             }
             if ($aComment['b_active'] != 1) {
                 osc_add_flash_error_message(_m('The comment is not active, you cannot delete it'));
                 $this->redirectTo(osc_item_url());
             }
             if ($aComment['fk_i_user_id'] != $this->userId) {
                 osc_add_flash_error_message(_m('The comment was not added by you, you cannot delete it'));
                 $this->redirectTo(osc_item_url());
             }
             $commentManager->deleteByPrimaryKey($commentId);
             osc_add_flash_ok_message(_m('The comment has been deleted'));
             $this->redirectTo(osc_item_url());
             break;
         default:
             // if there isn't ID, show an error 404
             if (Params::getParam('id') == '') {
                 $this->do404();
                 return;
             }
             if (Params::getParam('lang') != '') {
                 Session::newInstance()->_set('userLocale', Params::getParam('lang'));
             }
             $item = $this->itemManager->findByPrimaryKey(Params::getParam('id'));
             // if item doesn't exist show an error 404
             if (count($item) == 0) {
                 $this->do404();
                 return;
             }
             if ($item['b_active'] != 1) {
                 if ($this->userId == $item['fk_i_user_id']) {
                     osc_add_flash_warning_message(_m("The listing hasn't been validated. Please validate it in order to make it public"));
                 } else {
                     osc_add_flash_warning_message(_m("This listing hasn't been validated"));
                     $this->redirectTo(osc_base_url(true));
                 }
             } else {
                 if ($item['b_enabled'] == 0) {
                     osc_add_flash_warning_message(_m('The listing has been suspended'));
                     $this->redirectTo(osc_base_url(true));
                 }
             }
             if (!osc_is_admin_user_logged_in()) {
                 require_once osc_lib_path() . 'osclass/user-agents.php';
                 foreach ($user_agents as $ua) {
                     if (preg_match('|' . $ua . '|', @$_SERVER['HTTP_USER_AGENT'])) {
                         $mStats = new ItemStats();
                         $mStats->increase('i_num_views', $item['pk_i_id']);
                         break;
                     }
                 }
             }
             foreach ($item['locale'] as $k => $v) {
                 $item['locale'][$k]['s_title'] = osc_apply_filter('item_title', $v['s_title']);
                 $item['locale'][$k]['s_description'] = nl2br(osc_apply_filter('item_description', $v['s_description']));
             }
             if ($item['fk_i_user_id'] != '') {
                 $user = User::newInstance()->findByPrimaryKey($item['fk_i_user_id']);
                 $this->_exportVariableToView('user', $user);
             }
             $this->_exportVariableToView('item', $item);
             osc_run_hook('show_item', $item);
             // redirect to the correct url just in case it has changed
             $itemURI = str_replace(osc_base_url(), '', osc_item_url());
             $URI = preg_replace('|^' . REL_WEB_URL . '|', '', $_SERVER['REQUEST_URI']);
             // do not clean QUERY_STRING if permalink is not enabled
             if (osc_rewrite_enabled()) {
                 $URI = str_replace('?' . $_SERVER['QUERY_STRING'], '', $URI);
             } else {
                 $params_keep = array('page', 'id');
                 $params = array();
                 foreach (Params::getParamsAsArray('get') as $k => $v) {
                     if (in_array($k, $params_keep)) {
                         $params[] = "{$k}={$v}";
                     }
                 }
                 $URI = 'index.php?' . implode('&', $params);
             }
             // redirect to the correct url
             if ($itemURI != $URI) {
                 $this->redirectTo(osc_base_url() . $itemURI);
             }
             $this->doView('item.php');
             break;
     }
 }
开发者ID:semul,项目名称:Osclass,代码行数:101,代码来源:item.php



注:本文中的osc_apply_filter函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP osc_base_path函数代码示例发布时间:2022-05-15
下一篇:
PHP osc_admin_render_theme_url函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap