本文整理汇总了PHP中AF::link方法的典型用法代码示例。如果您正苦于以下问题:PHP AF::link方法的具体用法?PHP AF::link怎么用?PHP AF::link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AF
的用法示例。
在下文中一共展示了AF::link方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createBreadCrumbs
private function createBreadCrumbs()
{
if (!$this->link) {
return;
}
$breadCrumbs = array();
foreach ($this->link as $key => $value) {
$model = new BreadCrumbItem();
if (is_array($value)) {
if (isset($value[1])) {
$array = $value[0];
$params = $value[1];
} else {
$array = $value;
$params = array();
}
$link = AF::link($array, $params);
$model->label = $key;
$model->link = $link ? $link : null;
} else {
$model->label = $value;
$model->link = null;
}
$breadCrumbs[] = $model;
unset($model);
}
$this->bca = $breadCrumbs;
unset($breadCrumbs);
}
示例2: deleteAction
function deleteAction()
{
$id = AF::get($_POST, 'id', 0);
$modelsID = explode(',', $id);
$errors = FALSE;
foreach ($modelsID as $id) {
$model = new CampaignShipping();
$model->model_uset_id = $this->user->user_id;
if ($model->findByPk($id)) {
$model->delete($id);
} else {
$errors = TRUE;
}
if ($model->getErrors()) {
$errors = TRUE;
}
$campaign_id = $model->campaign_id;
unset($model);
}
if (isset($_POST['ajax'])) {
AF::setJsonHeaders('json');
if ($errors) {
Message::echoJsonError(__('campship_not_deleted'));
} else {
$countE = AF::get($_POST, 'countE', 100000);
if (count($modelsID) >= $countE) {
$link = AF::link(array('campship' => 'view'), array('campaign_id' => $campaign_id));
Message::echoJsonRedirect($link);
} else {
Message::echoJsonSuccess(__('campship_deleted'));
}
}
}
$this->redirect();
}
示例3: apiSuccess
private function apiSuccess($url)
{
// $url will be a message in CRM Order, a redirect url in all other cases
// what return type?
if ($this->wsType == 'x1') {
Message::echoJsonRedirect(AF::link(array('orders' => 'update'), array('id' => $this->order->order_id)));
} else {
// is this a system generated url with no prefix or is this a fully formed GC url
// do we need to append noclk ?
$url = stripos($url, 'http') !== false ? $url : 'http://' . $url . ($this->noclk ? '&noclk' : '');
exit(json_encode(array('status' => 1, 'url' => $url)));
}
}
示例4: __construct
function __construct($params)
{
parent::__construct($params);
$this->url = AF::link(array($this->controller => $this->action));
$params = $this->params;
if (isset($params['page'])) {
$this->page = $params['page'] < 1 ? 1 : (int) $params['page'];
unset($params['page']);
}
$amp = $params ? '&' : '';
$this->url .= http_build_query($params) . $amp . 'page=';
if (isset($_POST['pagination_count_in_page_value']) && in_array($_POST['pagination_count_in_page_value'], self::$itemInPage)) {
setcookie('pagination_count_in_page_value', $_POST['pagination_count_in_page_value']);
$this->countInPage = $_POST['pagination_count_in_page_value'];
} elseif (isset($_COOKIE['pagination_count_in_page_value']) && in_array($_COOKIE['pagination_count_in_page_value'], self::$itemInPage)) {
$this->countInPage = $_COOKIE['pagination_count_in_page_value'];
}
}
示例5: createAction
public function createAction()
{
$model = new Campaign();
if (isset($_POST['country_id'])) {
$_POST['country_id'] = implode(',', $_POST['country_id']);
}
// check if this is an attachment campaign. if so, we don't want to validate the urls or fulfillment_id if it isnot presesnt
$attach = false;
if (isset($_POST['attach']) && $_POST['attach']) {
$attach = true;
$_POST['url'] = $_POST['order_url'] = $_POST['return_url'] = 'attach';
if (!strlen($_POST['fulfillment_id'])) {
$_POST['fulfillment_id'] = 0;
}
}
// Uncomment the following line if AJAX validation is needed
$this->performAjaxValidation($model);
if (isset($_POST['model']) && $_POST['model'] == 'campaigns') {
$model->fillFromArray($_POST);
$model->user_id_created = $this->user->user_id;
$model->user_id_updated = $this->user->user_id;
$model->updated = 'NOW():sql';
$model->created = 'NOW():sql';
$model->model_uset_id = $this->user->user_id;
if ($model->save()) {
$link = AF::link(array('campaigns' => 'update'), array('id' => $model->PkValue));
Message::echoJson('success', array('redirect' => $link));
} else {
Message::echoJsonError('Campaign wasn\'t created.');
}
die;
}
$countries = Country::model()->cache()->findAllInArray();
$profiles = Profile::model()->cache()->findAllInArray();
// prepend dry run gateway
array_unshift($profiles, array('profile_id' => 0, 'profile_name' => 'DRY RUN GATEWAY'));
$fulfillments = Fulfillment::model()->cache()->findAllInArray();
$currencies = Currency::model()->cache()->findAllInArray();
Assets::js('jquery.form');
$this->addToPageTitle('Create campaign');
$this->render('create', array('model' => $model, 'countries' => $countries, 'currencies' => $currencies, 'profiles' => $profiles, 'fulfillments' => $fulfillments));
}
示例6: getorder_id_link
public function getorder_id_link()
{
return '<a href="' . AF::link(array('orders' => 'update'), array('id' => $this->order_id)) . '">' . $this->order_id . '</a>';
}
示例7: __
<div <?if($ajax){?>id="af_ajax_table"<?}?>>
<form data="af_ajax_table" class="search-form" action="<?php
echo AF::link(array('reports' => 'fulfillment'));
?>
" method="post" onsubmit="return false;">
<?php
$this->widget(new DataPicker(array('name' => 'r_dates', 'value' => array('main' => $filterFields['r_dates'], 'post' => $filterFields['r_dates_post']), 'inputHtml' => array('class' => 'input-smedium', 'placeholder' => __('filter_date')))));
?>
<select name="show_orders" class="chosen-select select-xlarge af_select_ajax">
<option value="0" <?if($filterFields['show_orders']==0){?>selected="" <?}?>><?php
echo __('group_by_fulfillments');
?>
</option>
<option value="1" <?if($filterFields['show_orders']==1){?>selected="" <?}?>><?php
echo __('group_by_orders');
?>
</option>
</select>
<?if($filterFields['show_orders']==1){?>
<select name="from" class="chosen-select select-xlarge af_select_ajax" data-placeholder="<?php
echo __('all_type');
?>
">
<option value=""></option>
<?foreach(Fulfillment::orderSType() as $itemType){?>
<option value="<?php
echo $itemType;
示例8: array
<?php
$this->includeFile('_menu', array('application', 'views', 'shipping'), array('access' => $access, 'controller' => $controller, 'action' => $action, 'user' => $user));
?>
<?if($access->actionAccess('create')){?>
<a class="btn btn-small" href="shipcats/create/"><i class="icon-plus"></i> <?php
echo __('add_new');
?>
</a>
<?}?>
<?if($access->actionAccess('view_table')){?>
<form data="af_ajax_table" class="search-form" action="<?php
echo AF::link(array('shipcats' => 'view'));
?>
" method="post" onsubmit="return false;">
<input class="input-large af-input-field" type="text" name="stext" placeholder="<?php
echo __('search_text');
?>
" value="<?php
echo $filterFields['stext'];
?>
">
<button type="button" class="btn btn-small btn-set ajax_submit_form" ><i class="icon-search"></i> <?php
echo __('search');
?>
</button>
<button type="button" class="btn btn-small btn-set ajax_clear_form"><i class="icon-remove"></i> <?php
echo __('clear_search');
示例9: resetPassword
public function resetPassword()
{
$this->activkey = md5(microtime());
if (!$this->save()) {
return false;
}
$activeLink = rtrim(Config::get()->url, '/') . AF::link(array('authorization' => 'reset'), array('idUser' => $this->user_id, 'activkey' => $this->activkey, 'reset' => 'true'));
$text = __('reset_password_email_text', array('{username}' => $this->name));
$text .= '<br><br><a href="' . $activeLink . '">' . __('reset_password') . '</a>';
$headers = "Content-type: text/html; charset=utf-8 \r\n";
$headers .= 'To: ' . $this->name . ' <' . $this->login . '>' . "\r\n";
$headers .= 'From: Pinnacle CRM <support@pinnaclecrm.com>' . "\r\n";
mail("{$this->login}", "{__('reset_password_email_subject')}", "{$text}", "{$headers}");
return true;
}
示例10: getcount_cg_2_formatted
public function getcount_cg_2_formatted()
{
$filterFields = self::$FilterFields;
$filterFields['gateway_id'] = $this->gateway_id;
$filterFields['group_by'] = 1;
$filterFields['campaign_id'] = null;
$link = AF::link(array('reports' => 'cg'), $filterFields);
return '<a href="' . $link . '">' . $this->count_cg . '</a>';
}
示例11: createReportAfidLink
private function createReportAfidLink($data, $url, $from, $params = array())
{
$FilterFields = self::$FilterFields;
if ($FilterFields) {
if ($this->gateway_id && $from == 'decline') {
$params['gateway_id'] = $this->gateway_id;
}
if ($this->method_id && $from == 'decline') {
$params['method_id'] = $this->method_id;
}
if ($this->status_note && $from == 'decline') {
$params['reason_id'] = $this->status_note;
}
if (isset($FilterFields['r_dates_post']) && !empty($FilterFields['r_dates_post'])) {
$params['r_dates'] = $FilterFields['r_dates_post'];
}
if ($from == 'decline' && isset($url['declinedreports']) && $url['declinedreports'] == 'orders') {
}
}
$params['from'] = $from;
$link = AF::link($url, $params);
unset($FilterFields);
return "<a href='{$link}'>{$data}</a>";
}
示例12: getgateway_formatted
public function getgateway_formatted()
{
$link = AF::link(array('gateways' => 'update'), array('id' => $this->gateway_id));
return '[<a href="' . $link . '">' . $this->gateway_id . '</a>] <a href="' . $link . '">' . $this->gateway_alias . '</a>';
}
示例13: getpayment_view_link
public function getpayment_view_link()
{
$openUrl = AF::link(array('pixelrates' => 'view'), array('campaign_id' => $this->campaign_id, 'method_id' => $this->method_id));
$removeUrl = AF::link(array('pixelrates' => 'delete'), array('campaign_id' => $this->campaign_id, 'method_id' => $this->method_id, 'all_method' => '1'));
return "<div class='btn-group'> <a class='btn_t btn-mini' href='{$openUrl}'><i class='icon-folder-open'></i></a> <a onclick=\"return confirm('Are you sure?');\" href='{$removeUrl}' class='btn_t btn-mini'><i class='icon-trash'></i></a></div>";
}
示例14: array2str
private function array2str($item)
{
if (isset($item['visible']) && !$item['visible']) {
return false;
}
$menuItem = new MenuItem();
$menuItem->class = isset($this->li_attributes['class']) ? $this->li_attributes['class'] : '';
if (isset($item['url'])) {
$url = AF::linkArr2linkArr($item['url']);
if (!$this->access->actionAccess($url)) {
return false;
}
foreach ($item['url'] as $key => $value) {
if ($this->different) {
if ($key == $this->controller && $value == $this->action) {
$menuItem->class .= ' active';
}
} else {
if ($key == $this->controller) {
$menuItem->class .= ' active';
}
}
}
}
$menuItem->visible = isset($item['visible']) && !$item['visible'] ? '0' : '1';
$menuItem->label = isset($item['label']) ? $item['label'] : 'No Lable';
$menuItem->attributes = ' ';
$params_url = isset($item['params_url']) ? $item['params_url'] : array();
$menuItem->url = isset($item['url']) ? AF::link($item['url'], $params_url) : '#';
if (isset($item['submenu']) && $item['submenu']) {
$subMenu = array();
$active = false;
foreach ($item['submenu'] as $itemSubMenu) {
if (isset($itemSubMenu['url'])) {
foreach ($itemSubMenu['url'] as $key => $value) {
if ($key == $this->controller) {
$active = true;
}
if ($this->different) {
if ($key == $this->controller && $value == $this->action) {
$active = true;
}
} else {
if ($key == $this->controller) {
$active = true;
}
}
}
}
$itemS = $this->array2str($itemSubMenu);
if ($itemS) {
$subMenu[] = $itemS;
}
unset($itemS);
}
if (empty($subMenu)) {
return false;
}
if ($active) {
$menuItem->class .= ' active';
}
$menuItem->subMenu = $subMenu;
unset($subMenu);
$menuItem->class .= ' dropdown';
if (isset($item['attributes']['class'])) {
$item['attributes']['class'] .= 'dropdown-toggle';
} else {
$item['attributes']['class'] = 'dropdown-toggle';
}
}
if ($item['attributes']) {
$tempAttr = '';
foreach ($item['attributes'] as $key => $value) {
$tempAttr .= $key . '="' . $value . '" ';
}
$menuItem->attributes = $tempAttr;
unset($tempAttr, $key, $value);
}
return $menuItem;
}