本文整理汇总了PHP中osc_apply_filter函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_apply_filter函数的具体用法?PHP osc_apply_filter怎么用?PHP osc_apply_filter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_apply_filter函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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');
}
示例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
}
}
示例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;
}
}
示例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&action=edit&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&action=delete&id=' . $aRow['pk_i_id'] . '&' . 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;
}
}
}
示例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;
}
示例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/');
}
}
示例7: customPageHeader
function customPageHeader()
{
?>
<h1><?php
echo osc_apply_filter('custom_appearance_title', __('Appearance'));
?>
</h1>
<?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);
}
示例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']);
}
示例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;
}
示例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');
}
示例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');
}
}
}
}
示例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;
}
}
}
示例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&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&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;
}
}
}
示例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;
}
}
}