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

PHP AdminHelper类代码示例

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

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



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

示例1: beforeValidate

 public function beforeValidate()
 {
     if ($this->isNewRecord && $this->keyword === null) {
         $this->keyword = AdminHelper::generateUrlStr($this->alias, $this, 'keyword');
     }
     return parent::beforeValidate();
 }
开发者ID:kostya1017,项目名称:our,代码行数:7,代码来源:CmsAlias.php


示例2: session_footer

 public static function session_footer()
 {
     if (array_key_exists("fc_mode", $_SESSION)) {
         $mode = $_SESSION["fc_mode"];
         if ($mode == AdminHelper::MODE_ADMIN) {
             AdminHelper::admin_footer();
         } elseif ($mode == AdminHelper::MODE_PREVIEW) {
             AdminHelper::preview_footer();
         }
     }
 }
开发者ID:joel-cass,项目名称:structure-cms,代码行数:11,代码来源:AdminHelper.php


示例3: checkLogin

function checkLogin()
{
    if (isset($_POST['email_address']) && isset($_POST['password'])) {
        $login_details = AdminHelper::doLogin($_POST['email_address'], $_POST['password']);
        if ($login_details !== false) {
            return true;
        } else {
            return false;
        }
    } else {
        return false;
    }
}
开发者ID:blacktire,项目名称:DIY,代码行数:13,代码来源:account.php


示例4: addHistoryLink

 public static function addHistoryLink($link = false, $modelName = false, $ignoreRequestForModelName = false)
 {
     if (\Session::has('adminHistoryLinks')) {
         $links = \Session::get('adminHistoryLinks');
     } else {
         $links = array();
     }
     if (!$link) {
         $url = explode('?', $_SERVER["REQUEST_URI"]);
         $link = array_shift($url) . Tools::getGets();
     }
     if (!$modelName) {
         $modelName = \Request::segment(2);
     }
     $linkSegments = explode("/", $link);
     $action = isset($linkSegments[3]) ? $linkSegments[3] : false;
     $addLink = isset($linkSegments[4]) && $linkSegments[4] == "new" ? true : false;
     $tempLinks = $links;
     if (count($links)) {
         $delete = false;
         foreach ($links as $index => $cLink) {
             // If ModelName and Action already exist in history, it means we're going back
             // therefore delete all history links AFTER the current history link
             // and replace current history with the newly modified one
             if ($cLink['modelConfigName'] == $modelName && $cLink['action'] == $action) {
                 $delete = true;
                 // Skip this iteration because this is the link we're going back to
                 continue;
             }
             // Delete all links after the one we're going back to
             if ($delete) {
                 unset($tempLinks[$index]);
             }
         }
         if ($delete) {
             \Session::put('adminHistoryLinks', $tempLinks);
             // There is no need to insert the current link because it already exists
             // so just return
             return;
         }
     }
     $modelConfig = AdminHelper::modelExists($modelName);
     if ($ignoreRequestForModelName) {
         $returnModelName = $modelConfig ? $modelConfig->hrName : $modelName;
     } else {
         $returnModelName = $modelConfig ? count(\Request::segments()) > 2 && \Request::segment(3) == 'edit' ? $modelConfig->hrName : $modelConfig->hrNamePlural : $modelName;
     }
     $links[] = array('link' => $link, 'action' => $action, 'addLink' => $addLink, 'modelConfigName' => $modelConfig ? $modelConfig->name : $modelName, 'modelName' => $returnModelName, 'modelIcon' => $modelConfig && $modelConfig->faIcon ? $modelConfig->faIcon : 'fa-circle');
     \Session::put('adminHistoryLinks', $links);
 }
开发者ID:gtcrais,项目名称:gtcms,代码行数:50,代码来源:AdminHistoryManager.php


示例5: beforeSave

 /**
  * Generate the filtered url string.
  */
 public function beforeSave($event)
 {
     $owner = $this->getOwner();
     $id = !$owner->isNewRecord ? $owner->primaryKey : null;
     foreach (Yii::app()->languageManager->languages as $l => $lang) {
         if ($l === Yii::app()->sourceLanguage) {
             $suffix = '';
             $language = null;
         } else {
             $suffix = '_' . $l;
             $language = $l;
         }
         $owner->{$this->attribute . $suffix} = AdminHelper::generateUrlStr($owner->{$this->sourceAttribute . $suffix}, $owner, $this->attribute, $id, $language);
     }
 }
开发者ID:kostya1017,项目名称:our,代码行数:18,代码来源:GenerateUrlBehavior.php


示例6: beforeSave

 public function beforeSave()
 {
     $id = !$this->isNewRecord ? $this->primaryKey : null;
     foreach (Yii::app()->languageManager->languages as $l => $lang) {
         if ($l === Yii::app()->sourceLanguage) {
             $suffix = '';
             $language = null;
         } else {
             $suffix = '_' . $l;
             $language = $l;
         }
         $this->{'title_url' . $suffix} = AdminHelper::generateUrlStr($this->{'title' . $suffix}, $this, 'title_url', $id, $language);
     }
     return parent::beforeSave();
 }
开发者ID:kostya1017,项目名称:our,代码行数:15,代码来源:Job.php


示例7: getRealPath

 /**
  * Returns script filename by URL
  *
  * @param string $site Site ID.
  * @param string $url URL.
  * @return string|null
  */
 public static function getRealPath($site, $url)
 {
     $docRoot = rtrim(\Bitrix\Main\SiteTable::getDocumentRoot($site), '/');
     $url = str_replace('\\', '/', $url);
     $url = \CHTTP::urnEncode($url);
     $uri = new \Bitrix\Main\Web\Uri($url);
     $path = \CHTTP::urnDecode($uri->getPath());
     if (substr($path, -1, 1) == '/') {
         $path .= 'index.php';
     }
     $file = new \Bitrix\Main\IO\File($docRoot . $path);
     if ($file->isExists()) {
         return substr($file->getPath(), strlen($docRoot));
     }
     if ($rewriteRules = AdminHelper::getRewriteRules($site)) {
         $pathQuery = \CHTTP::urnDecode($uri->getPathQuery());
         foreach ($rewriteRules as &$item) {
             if (preg_match($item['CONDITION'], $pathQuery)) {
                 $url = empty($item['PATH']) && !empty($item['RULE']) ? preg_replace($item['CONDITION'], $item['RULE'], $pathQuery) : $item['PATH'];
                 $url = \CHTTP::urnEncode($url);
                 $uri = new \Bitrix\Main\Web\Uri($url);
                 $path = \CHTTP::urnDecode($uri->getPath());
                 $file = new \Bitrix\Main\IO\File($docRoot . $path);
                 if ($file->isExists()) {
                     $pathTmp = str_replace('.', '', strtolower(ltrim($path, '/\\')));
                     $pathTmp7 = substr($pathTmp, 0, 7);
                     if ($pathTmp7 == 'upload/' || $pathTmp7 == 'bitrix/') {
                         continue;
                     }
                     if ($file->getExtension() != 'php') {
                         continue;
                     }
                     return substr($file->getPath(), strlen($docRoot));
                 }
             }
         }
     }
     return null;
 }
开发者ID:vim84,项目名称:b-markt,代码行数:46,代码来源:adminhelper.php


示例8: run

 /**
  * Generates the TabularInputWidget and the javascript that drives the blocs.
  */
 public function run()
 {
     // Preparing variables.
     $layouts = array();
     $layoutSelect = array();
     $afterAddItem = '';
     $beforeAddItem = '';
     $afterInit = '';
     $sortableStart = '';
     $sortableStop = '';
     $beforeDeleteItem = '';
     $afterDeleteItem = '';
     foreach (Yii::app()->params['blocs'] as $bloc) {
         $modelClassName = 'Bloc' . ucfirst($bloc);
         $newBlocModel = new $modelClassName();
         $newBlocModel->title_anchor = true;
         $newBlocModel->title_page = true;
         $layouts['application.components.blocs.' . $bloc . '.views.admin'] = $newBlocModel;
         $layoutSelect['application.components.blocs.' . $bloc . '.views.admin'] = Yii::t('admin', 'bloc_' . $bloc);
         $afterAddItem .= Yii::app()->cms->blocs[$bloc]->afterAddItem() . "\n";
         $beforeAddItem .= Yii::app()->cms->blocs[$bloc]->beforeAddItem() . "\n";
         $afterInit .= Yii::app()->cms->blocs[$bloc]->afterInit() . "\n";
         $sortableStart .= Yii::app()->cms->blocs[$bloc]->sortableStart() . "\n";
         $sortableStop .= Yii::app()->cms->blocs[$bloc]->sortableStop() . "\n";
         $beforeDeleteItem .= Yii::app()->cms->blocs[$bloc]->beforeDeleteItem() . "\n";
         $afterDeleteItem .= Yii::app()->cms->blocs[$bloc]->afterDeleteItem() . "\n";
     }
     $renderData = array();
     foreach ($this->models as $key => $models) {
         if ($key !== 0) {
             $renderData[$key] = $models;
         }
     }
     // Instanciating widget.
     $this->widget('application.components.widgets.TabularInput.TabularInputWidget', array('id' => $this->id, 'form' => isset($this->form) ? $this->form : null, 'models' => $this->models[0], 'layoutExpression' => "'application.components.blocs.'.lcfirst(mb_substr(get_class(\$model), 4)).'.views.admin'", 'layout' => $layouts, 'layoutSelect' => $layoutSelect, 'itemTitleExpression' => "Yii::t('admin', \$model->tableName())", 'orderAttribute' => 'rank', 'nestedWidgets' => array('{formId}-{itemId}-blocDocumentDocumentForm', '{formId}-{itemId}-blocPeoplePeopleForm', '{formId}-{itemId}-blocCitationCitationForm', '{formId}-{itemId}-blocFeatureFeatureForm'), 'renderData' => $renderData, 'sortable' => array('start' => "js:function(event, ui){\n\t\t\t\t\t" . AdminHelper::tabularInputCkEditorSortableStart() . "\n\t\t\t\t\t" . $sortableStart . "\n\t\t\t\t}", 'stop' => "js:function(event, ui){\n\t\t\t\t\t" . AdminHelper::tabularInputCkEditorSortableStop() . "\n\t\t\t\t\t" . $sortableStop . "\n\t\t\t\t}"), 'beforeDeleteItem' => "function(id, itemId){\n\t\t\t\t" . AdminHelper::tabularInputCkEditorBeforeDeleteItem() . "\n\t\t\t\t" . $beforeDeleteItem . "\n\t\t\t}", 'afterDeleteItem' => "function(id, itemId){\n\t\t\t\t" . $afterDeleteItem . "\n\t\t\t}", 'beforeAddItem' => "function(id, itemId){\n\t\t\t\t" . $beforeAddItem . "\n\t\t\t}", 'afterAddItem' => "function(id, itemId){\n\t\t\t\t" . AdminHelper::tabularInputAfterAddItemDatetimePicker() . "\n\t\t\t\t" . $afterAddItem . "\n\t\t\t}", 'afterInit' => "function(id){\n\t\t\t\t" . $afterInit . "\n\t\t\t}"));
 }
开发者ID:kostya1017,项目名称:our,代码行数:39,代码来源:AdminBlocsWidget.php


示例9: foreach

<div class="col-lg-6">

	@foreach ($modelConfig->relatedModels as $relatedModel)
		<?php 
$displayModel = true;
if ($modelConfig->reverseConstrainingModels) {
    foreach ($modelConfig->reverseConstrainingModels as $constraint) {
        if (method_exists($object, $constraint) && $object->{$constraint}->count()) {
            $displayModel = false;
            break;
        }
    }
}
$method = $relatedModel->method;
$relatedModelConfig = AdminHelper::modelExists($relatedModel->name);
$gets = Tools::getGets(array($modelConfig->id => $object->id ? $object->id : "new_gtcms_entry"));
$configInParent = $object->relatedModelConfiguration($relatedModelConfig->name);
GtcmsPremium::setDisplayRelatedModelBasedOnModelKey($configInParent, $object, $displayModel);
?>
		@if ($displayModel)

			<div class="panel panel-default">
				<div class="panel-body">
					<?php 
// --------------- EXCEPTIONS ----------------
$addObject = true;
?>
					@if ($addObject)
						<div class="indexTableHeader">
							<a href="/admin/{{$relatedModelConfig->name}}/add{{$gets}}&addToParent=true" class="btn btn-primary btn-sm addRelatedObject">
								<i class="fa fa-plus-circle"></i> {{$relatedModelConfig->hrName}}
开发者ID:gtcrais,项目名称:gtcms,代码行数:31,代码来源:editContentRelatedModels.blade.php


示例10: attributeLabels

 public function attributeLabels()
 {
     return AdminHelper::multilangLabels($this, array('id' => '#', 'title_anchor' => 'Inclure dans l’index de contenu', 'title_page' => 'Afficher le titre dans la page', 'title' => 'Titre du bloc', 'user_id' => 'Utilisateur', 'set_id' => 'Galerie', 'nbr_images' => 'Nombre d’images', 'show_as_carrousel' => 'Afficher en tant que carrousel'));
 }
开发者ID:kostya1017,项目名称:our,代码行数:4,代码来源:BlocFlickr.php


示例11: foreach

<?php

// parsing posted data:
if (isset($_POST['docampaignedit'])) {
    // do the actual list add stuffs...
    $edit_response = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'editcampaign', 'id' => $request_parameters[0], 'title' => $_POST['campaign_title'], 'description' => $_POST['campaign_description']));
    if ($edit_response['status_uid'] == 'element_editcampaign_200') {
        AdminHelper::formSuccess('Success. Edited.', '/');
    } else {
        AdminHelper::formFailure('Error. There was a problem editing your campaign.', '/');
    }
}
$current_response = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'getcampaign', 'id' => $request_parameters[0]));
$cash_admin->page_data['ui_title'] = 'Campaigns: Edit "' . $current_response['payload']['title'] . '"';
$current_campaign = $current_response['payload'];
if (is_array($current_campaign)) {
    $cash_admin->page_data = array_merge($cash_admin->page_data, $current_campaign);
}
$cash_admin->page_data['form_state_action'] = 'docampaignedit';
$cash_admin->page_data['button_text'] = 'Save changes';
$elements_response = $cash_admin->requestAndStore(array('cash_request_type' => 'element', 'cash_action' => 'getelementsforcampaign', 'id' => $request_parameters[0]));
if (is_array($elements_response['payload'])) {
    foreach ($elements_response['payload'] as &$element) {
        if ($element['modification_date'] == 0) {
            $element['formatted_date'] = CASHSystem::formatTimeAgo($element['creation_date']);
        } else {
            $element['formatted_date'] = CASHSystem::formatTimeAgo($element['modification_date']);
        }
    }
    $cash_admin->page_data['elements_for_campaign'] = new ArrayIterator($elements_response['payload']);
}
开发者ID:JamesLinus,项目名称:platform,代码行数:31,代码来源:campaigns_edit.php


示例12: attributeLabels

 public function attributeLabels()
 {
     return AdminHelper::multilangLabels($this, array('id' => 'ID', 'bloc_feature_id' => 'Bloc Feature', 'image' => 'Image reliée', 'title' => 'Titre de la caractéristique', 'description' => 'Détails de la caractéristique', 'rank' => 'Rank'));
 }
开发者ID:kostya1017,项目名称:our,代码行数:4,代码来源:BlocFeatureFeature.php


示例13: array

<?php

// add unique page settings:
$page_title = 'Elements: Main';
$page_tips = 'This is where specific functionalities will be deployed, pages installed, and widgets set up. It is really the heart of the public-facing tools — the other tabs are more aimed at management, lightweight CRM, and fulfillment.';
$page_memu = array('Elements' => array('elements/add/' => array('Add Element', 'plus_alt'), 'elements/view/' => array('Your Elements', 'heart_fill')));
$element_page_request = new CASHRequest(array('cash_request_type' => 'element', 'cash_action' => 'getanalytics', 'analtyics_type' => 'mostactive', 'user_id' => AdminHelper::getPersistentData('cash_effective_user')));
if ($element_page_request->response['status_code'] == 200) {
    $page_data['element_mostactive'] = $element_page_request->response['payload'];
} else {
    $page_data['element_mostactive'] = false;
}
$element_page_request = new CASHRequest(array('cash_request_type' => 'element', 'cash_action' => 'getanalytics', 'analtyics_type' => 'recentlyadded', 'user_id' => AdminHelper::getPersistentData('cash_effective_user')));
if ($element_page_request->response['status_code'] == 200) {
    $page_data['element_recentlyadded'] = $element_page_request->response['payload'];
} else {
    $page_data['element_recentlyadded'] = false;
}
开发者ID:nodots,项目名称:DIY,代码行数:18,代码来源:elements.php


示例14: afterSave

 /**
  * Saving related Bloc entry.
  */
 public function afterSave($event)
 {
     $owner = $this->getOwner();
     if ($owner->isNewRecord) {
         $contentBloc = new Bloc();
         if (Yii::app()->languageManager->multilang) {
             $contentBloc->multilang();
         }
         $contentBloc->parent_id = $owner->parent_id;
         $contentBloc->bloc_type = mb_substr($owner->tableName(), 5);
         $contentBloc->bloc_id = $owner->primaryKey;
     } else {
         if (Yii::app()->languageManager->multilang) {
             $contentBloc = Bloc::model()->multilang()->findByAttributes(array('bloc_id' => $owner->primaryKey, 'bloc_type' => mb_substr($owner->tableName(), 5)));
         } else {
             $contentBloc = Bloc::model()->findByAttributes(array('bloc_id' => $owner->primaryKey, 'bloc_type' => mb_substr($owner->tableName(), 5)));
         }
     }
     $contentBloc->rank = $owner->rank;
     $contentBloc->title_anchor = $owner->title_anchor;
     $contentBloc->title_page = $owner->title_page;
     $contentBloc->unique_id = $owner->unique_id;
     $contentBloc->last_modified = date('Y-m-d H:i:s');
     foreach (Yii::app()->languageManager->languages as $l => $fullLanguage) {
         if ($l === Yii::app()->sourceLanguage) {
             $suffix = '';
         } else {
             $suffix = '_' . $l;
         }
         $contentBloc->{'title' . $suffix} = $owner->{'title' . $suffix};
         if ($owner->isNewRecord) {
             $contentBloc->{'title_url' . $suffix} = AdminHelper::generateUrlStr($owner->{'title' . $suffix}, $contentBloc, 'title_url', null, $l);
         } else {
             $contentBloc->{'title_url' . $suffix} = AdminHelper::generateUrlStr($owner->{'title' . $suffix}, $contentBloc, 'title_url', $contentBloc->id, $l);
         }
     }
     $contentBloc->save(false);
 }
开发者ID:kostya1017,项目名称:our,代码行数:41,代码来源:BlocBehavior.php


示例15: header

<?php

if (!$request_parameters) {
    header('Location: ' . ADMIN_WWW_BASE_PATH . '/people/lists/');
}
$page_request = $cash_admin->requestAndStore(array('cash_request_type' => 'people', 'cash_action' => 'getlist', 'list_id' => $request_parameters[0]), 'getlist');
//var_dump($page_request);
if ($page_request['status_uid'] == 'people_getlist_200') {
    $elements_data = AdminHelper::getElementsData();
    $effective_user = AdminHelper::getPersistentData('cash_effective_user');
    if ($page_request['payload']['user_id'] == $effective_user) {
        if (isset($_POST['dodelete']) || isset($_GET['modalconfirm'])) {
            $list_delete_request = new CASHRequest(array('cash_request_type' => 'people', 'cash_action' => 'deletelist', 'list_id' => $request_parameters[0]));
            if ($list_delete_request->response['status_uid'] == 'people_deletelist_200') {
                header('Location: ' . ADMIN_WWW_BASE_PATH . '/people/lists/');
            }
        }
        $cash_admin->page_data['title'] = 'People: Delete “' . $page_request->response['payload']['name'] . '”';
    } else {
        header('Location: ' . ADMIN_WWW_BASE_PATH . '/people/lists/');
    }
} else {
    header('Location: ' . ADMIN_WWW_BASE_PATH . '/people/lists/delete/' . $request_parameters[0]);
}
$cash_admin->setPageContentTemplate('delete_confirm');
开发者ID:blacktire,项目名称:DIY,代码行数:25,代码来源:people_lists_delete.php


示例16: Title

		<input type="hidden" name="doelementedit" value="makeitso" />
		<input type="hidden" name="element_type" value="signin" />
		<h3>Element Details</h3>

		<label for="element_name">Name</label><br />
		<input type="text" id="element_name" name="element_name" value="<?php 
echo $page_data['name'];
?>
" /> 

		<div class="row_seperator">.</div>
			<label for="email_list_id">Target Mailing List</label><br />
			<select id="email_list_id" name="email_list_id">
				<option value="0">none</option>
				<?php 
AdminHelper::echoFormOptions('people_lists', $page_data['options']->email_list_id);
?>
			</select>

		<div class="row_seperator">.</div>
		<br />
		<label for="display_title">Display Title (blank for none)</label><br />
		<input type="text" id="display_title" name="display_title" value="<?php 
echo $page_data['options']->display_title;
?>
" />

		<div class="row_seperator">.</div>
		<label for="display_message">Display Message</label><br />
		<input type="text" id="display_message" name="display_message" value="<?php 
echo $page_data['options']->display_message;
开发者ID:nodots,项目名称:DIY,代码行数:31,代码来源:edit.php


示例17: array_slice

                // turn the rest of the request into the parameters array
                $request_parameters = array_slice($exploded_request, 0 - (sizeof($exploded_request) - $fails_at_level));
            }
        } else {
            define('BASE_PAGENAME', '');
            $include_filename = 'error.php';
        }
    }
} else {
    define('BASE_PAGENAME', 'mainpage');
    $include_filename = 'mainpage.php';
}
// if a login needs doing, do it
$login_message = "Log In";
if (isset($_POST['login'])) {
    $login_details = AdminHelper::doLogin($_POST['address'], $_POST['password']);
    if ($login_details !== false) {
        $admin_primary_cash_request->sessionSet('cash_actual_user', $login_details);
        $admin_primary_cash_request->sessionSet('cash_effective_user', $login_details);
        $admin_primary_cash_request->sessionSet('cash_effective_user_email', $_POST['address']);
        if ($include_filename == 'logout.php') {
            header('Location: ' . ADMIN_WWW_BASE_PATH);
            exit;
        }
    } else {
        $admin_primary_cash_request->sessionClearAll();
        $login_message = "Try Again";
    }
}
// make a few objects to use throughout the pages
$cash_admin = new AdminCore($admin_primary_cash_request->sessionGet('cash_effective_user'));
开发者ID:nodots,项目名称:DIY,代码行数:31,代码来源:controller.php


示例18: attributeLabels

 public function attributeLabels()
 {
     return AdminHelper::multilangLabels($this, array('id' => '#', 'title_anchor' => 'Inclure dans l’index de contenu', 'title_page' => 'Afficher le titre dans la page', 'title' => 'Titre du bloc', 'html' => 'Contenu texte'));
 }
开发者ID:kostya1017,项目名称:our,代码行数:4,代码来源:BlocEditor.php


示例19: array

<div class="form">

<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'job-form', 'enableAjaxValidation' => false, 'htmlOptions' => array('enctype' => 'multipart/form-data')));
?>

	<?php 
echo $form->errorSummary(array_merge(AdminHelper::blocsErrors($blocs), array($model)));
?>
	
	<?php 
foreach (Yii::app()->languageManager->suffixes as $suffix) {
    ?>

		<div class="row">
			<?php 
    echo $form->labelEx($model, 'title' . $suffix);
    ?>
			<?php 
    echo $form->textField($model, 'title' . $suffix, array('size' => 60, 'maxlength' => 255));
    ?>
			<?php 
    echo $form->error($model, 'title' . $suffix);
    ?>
		</div>
	
	<?php 
}
?>
	
	<div class="row">
开发者ID:kostya1017,项目名称:our,代码行数:31,代码来源:_form.php


示例20: array_map

<?php

if (isset($_POST['dobatchcontactsadd'])) {
    if (!empty($_POST['element_content'])) {
        $email_array = array_map('trim', explode(",", str_replace(PHP_EOL, ',', $_POST['element_content'])));
        if (count($email_array) > 0) {
            if ($_POST['email_list_id']) {
                $total_added = 0;
                foreach ($email_array as $address) {
                    $add_request = new CASHRequest(array('cash_request_type' => 'people', 'cash_action' => 'addaddresstolist', 'do_not_verify' => 1, 'address' => $address, 'list_id' => $_POST['email_list_id']));
                    if ($add_request->response['payload']) {
                        $total_added++;
                    }
                }
                $cash_admin->page_data['page_message'] = 'Success. Added ' . $total_added . ' new emails to your list.';
            } else {
                $cash_admin->page_data['page_message'] = 'Please select a list to add contacts to.';
            }
        }
    }
}
$cash_admin->page_data['list_options'] = AdminHelper::echoFormOptions('people_lists', 0, false, true);
$cash_admin->setPageContentTemplate('people_contacts');
开发者ID:blacktire,项目名称:DIY,代码行数:23,代码来源:people_contacts.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP AdminPage类代码示例发布时间:2022-05-23
下一篇:
PHP AdminHandler类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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