当前位置: 首页>>代码示例>>PHP>>正文


PHP io::post方法代码示例

本文整理汇总了PHP中io::post方法的典型用法代码示例。如果您正苦于以下问题:PHP io::post方法的具体用法?PHP io::post怎么用?PHP io::post使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io的用法示例。


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

示例1: dirname

<?php

require_once dirname(__FILE__) . '/../module.inc.php';
$submitted = io::post('submit');
$name = io::post('name');
$description = io::post('description');
$property = io::post('property');
$expression = io::post('expression');
$mapping = array();
//get all properties (contact metadata)
$allContactMetadata = $api->contactmetadata(array('Limit' => '-1'));
if (isset($api->_response_code) && $api->_response_code === MailjetAPI::MAILJET_STATUS_CODE_OK_GET) {
    $properties = array();
    foreach ($allContactMetadata->Data as $key => $oProperty) {
        $properties[$oProperty->Name] = $oProperty->Name;
        $mapping[$oProperty->Name] = $oProperty->Datatype;
    }
}
$errors = array();
$created = false;
if ($submitted) {
    if (empty($name) || empty($expression)) {
        $errors[] = 'Veuillez remplir tous les champs obligatoires';
    }
    $typeProperty = $mapping[$property];
    switch ($typeProperty) {
        case 'str':
            $expression = '"' . $expression . '"';
            break;
        case 'int':
            if ($expression !== '0' && intval($expression) === 0) {
开发者ID:arthurgorjux,项目名称:mailjetAutomne,代码行数:31,代码来源:add.php

示例2: elseif

$immediateSending = io::post('immediateSending');
if ($immediateSending) {
    $response = $api->newsletterSend($params);
    if (isset($api->_response_code) && $api->_response_code === MailjetAPI::MAILJET_STATUS_CODE_OK_POST) {
        $sent = true;
    } elseif (isset($api->_response_code) && $api->_response_code === MailjetAPI::MAILJET_STATUS_CODE_OK_ERROR) {
        $msg = 'Erreur pendant la programmation de l\'envoi.';
        $immediateErrors[] = $msg;
    } else {
        $immediateErrors[] = 'Erreur interne pendant la programmation de l\'envoi.';
    }
}
$programmed = io::post('programmedSending');
if ($programmed) {
    $date = io::post('date_submit');
    $time = io::post('time');
    if (empty($date) || empty($time)) {
        $programmedErrors[] = 'Veuillez remplir la date et l\'heure';
    }
    if (empty($programmedErrors)) {
        $dateProgrammed = date_create($date . ' ' . $time)->format('c');
        // now we can programme the newsletter sending
        $params = array('method' => 'POST', 'ID' => $campaignId, 'Date' => $dateProgrammed);
        $response = $api->newsletterSchedule($params);
        if (isset($api->_response_code) && $api->_response_code === MailjetAPI::MAILJET_STATUS_CODE_OK_POST) {
            $programmedSuccess = true;
        } elseif (isset($api->_response_code) && $api->_response_code === MailjetAPI::MAILJET_STATUS_CODE_OK_ERROR) {
            $msg = 'Erreur pendant la programmation de l\'envoi.';
            $programmedErrors[] = $msg;
        } else {
            $programmedErrors[] = 'Erreur interne pendant la programmation de l\'envoi.';
开发者ID:arthurgorjux,项目名称:mailjetAutomne,代码行数:31,代码来源:send.php

示例3: dirname

<?php

require_once dirname(__FILE__) . '/../module.inc.php';
$listId = io::get('id');
// Get the list using the listId (passed by parameters)
$list = $api->contactslist(array('method' => 'VIEW', 'ID' => $listId))->Data[0];
// to get all contacts of the list, we use Limit = -1
$contacts = $api->contact(array('method' => 'GET', 'ContactsList' => $listId, 'Limit' => '-1'));
$submitted = io::post('submit');
$errors = array();
$updated = false;
if ($submitted) {
    $label = io::post('label');
    $listId = io::post('id');
    if (empty($label)) {
        $errors[] = 'Veuillez remplir tous les champs obligatoires';
    }
    if (empty($errors)) {
        $response = $api->contactslist(array('method' => 'PUT', 'unique' => $listId, 'Name' => $label));
        if (isset($api->_response_code) && $api->_response_code === MailjetAPI::MAILJET_STATUS_CODE_OK_PUT) {
            $updated = true;
        }
    }
} else {
    if ($list) {
        // List's id (not listId), make with numbers and characters
        $name = $list->Address;
        // List's name
        $label = $list->Name;
    }
}
开发者ID:arthurgorjux,项目名称:mailjetAutomne,代码行数:31,代码来源:view.php

示例4: unset

     if (!$archive->hasError()) {
         $cms_message .= $cms_language->getMessage(MESSAGE_PAGE_MODULE_EXTRACT_DONE) . "\n";
     } else {
         $cms_message .= $cms_language->getMessage(MESSAGE_PAGE_MODULE_EXTRACT_ERROR) . "\n";
         break;
     }
     unset($archive);
     $file = new CMS_file(PATH_TMP_FS . '/export.xml');
     if (!$file->exists()) {
         $cms_message .= $cms_language->getMessage(MESSAGE_PAGE_MODULE_NO_EXPORT) . "\n";
         break;
     }
     $importDatas = $file->getContent();
     $format = 'xml';
 } elseif (io::post('import')) {
     $importDatas = io::post('import');
     if ($format == 'php') {
         //try to eval PHP Array
         try {
             $importDatas = eval('return ' . $importDatas . ';');
         } catch (Exception $e) {
         }
     }
 } else {
     $cms_message .= $cms_language->getMessage(MESSAGE_PAGE_MODULE_ERROR_NO_IMPORT_DATA) . "\n";
     break;
 }
 if (!$importDatas) {
     $cms_message .= $cms_language->getMessage(MESSAGE_PAGE_MODULE_ERROR_NO_IMPORT_DATA) . "\n";
     break;
 }
开发者ID:davidmottet,项目名称:automne,代码行数:31,代码来源:import.php

示例5: CMS_polymod_oembed_definition

$oembedDefinitionId = io::request("definition");
$oembedDefinition = CMS_polymod_oembed_definition_catalog::getById($oembedDefinitionId);
if (!$oembedDefinition) {
    $oembedDefinition = new CMS_polymod_oembed_definition();
}
if ($moduleCodename) {
    $polymod = CMS_modulesCatalog::getByCodename($moduleCodename);
}
$cms_message = "";
switch ($_POST["cms_action"]) {
    case "validate":
        $oembedDefinition->setObjectdefinition(io::post('objectdefinition'));
        $oembedDefinition->setCodename(io::post('codename'));
        $oembedDefinition->setHtml(io::post('html'));
        $oembedDefinition->setParameter(io::post('parameter'));
        $oembedDefinition->setLabel(io::post('label'));
        if ($oembedDefinition->validate()) {
            $oembedDefinition->writeToPersistence();
        } else {
            $errors = $oembedDefinition->getValidationFailures();
            foreach ($errors as $error) {
                $cms_message .= "\n" . $error;
            }
        }
        break;
    case "switchexplanation":
        break;
}
$dialog = new CMS_dialog();
$dialog->setTitle("Cr&eacute;ation / modification d'une d&eacute;finition oembed", 'picto_modules.gif');
$dialog->setBacklink("modules_admin.php?moduleCodename=" . $moduleCodename . "&object=" . $objectDefinition->getID());
开发者ID:davidmottet,项目名称:automne,代码行数:31,代码来源:polymod_oembed_definition.php

示例6: array

    $status = $campaign->Status;
}
$errors = array();
$updated = false;
if ($submitted) {
    $campaignId = io::post('id');
    $title = io::post('title');
    $subject = io::post('subject');
    $footer = io::post('footer');
    $from = io::post('from');
    $from_name = io::post('from_name');
    $lang = io::post('lang');
    $list_id = io::post('list_id');
    $permalink = io::post('permalink');
    $reply_to = io::post('reply_to');
    $segment_id = io::post('segment_id');
    if (empty($title) || empty($subject) || empty($list_id) || empty($lang) || empty($from) || empty($from_name) || empty($footer)) {
        $errors[] = 'Veuillez remplir tous les champs obligatoires';
    } elseif (!filter_var($from, FILTER_VALIDATE_EMAIL)) {
        $errors[] = 'Veuillez saisir un email d\'expéditeur valide';
    } elseif ($reply_to != '' && !filter_var($reply_to, FILTER_VALIDATE_EMAIL)) {
        $errors[] = 'Veuillez saisir un email de réponse valide';
    }
    if (empty($errors)) {
        $params = array('method' => 'PUT', 'unique' => $campaignId, 'Title' => $title, 'Subject' => $subject, 'ContactsListID' => $list_id, 'Locale' => $lang, 'SenderEmail' => $from, 'SenderName' => $from_name, 'Footer' => $footer, 'Permalink' => $permalink, 'ReplyEmail' => $reply_to);
        if ($segment_id !== '') {
            $params['SegmentationID'] = $segment_id;
        }
        $response = $api->newsletter($params);
        if (isset($api->_response_code) && $api->_response_code === MailjetAPI::MAILJET_STATUS_CODE_OK_GET) {
            $updated = true;
开发者ID:arthurgorjux,项目名称:mailjetAutomne,代码行数:31,代码来源:view.php

示例7: array

$validateContentSubmitted = io::post('validate-content');
if ($validateContentSubmitted) {
    $params = array('method' => 'PUT', 'ID' => $campaignId, 'Html-part' => $htmlVersion, 'Text-part' => $textVersion);
    $response = $api->newsletterDetailContent($params);
    if (isset($api->_response_code) && $api->_response_code === MailjetAPI::MAILJET_STATUS_CODE_OK_VIEW) {
        $contentOk = true;
    } elseif (isset($api->_response_code) && $api->_response_code === MailjetAPI::MAILJET_STATUS_CODE_OK_ERROR) {
        $errors[] = 'Erreur pendant l\'envoi du code source de l\'email à Mailjet.';
    } else {
        $errors[] = 'Erreur interne pendant l\'envoi du code source de l\'email à Mailjet.';
    }
}
$testEmail = io::post('test-email');
if ($testEmail) {
    $recipient = io::post('test-recipient');
    $name = io::post('name-recipient');
    if (!filter_var($recipient, FILTER_VALIDATE_EMAIL)) {
        $errors[] = 'Veuillez saisir un email valide.';
    } else {
        $params = array("method" => "POST", "ID" => $campaignId, "Recipients" => json_decode('[
          {
            "Email": "' . $recipient . '",
            "Name": "' . $name . '"
          }
        ]', true));
        $response = $api->newsletterTest($params);
        if (isset($api->_response_code) && $api->_response_code === MailjetAPI::MAILJET_STATUS_CODE_OK_POST) {
            $testMailOk = true;
        } elseif (isset($api->_response_code) && $api->_response_code === MailjetAPI::MAILJET_STATUS_CODE_OK_ERROR) {
            $msg = 'Erreur pendant l\'envoi du mail de test.';
            $errors[] = $msg;
开发者ID:arthurgorjux,项目名称:mailjetAutomne,代码行数:31,代码来源:write.php

示例8: switch

    $content .= '<label>
							<input type="checkbox" name="options[]" value="' . $param . '"' . (in_array($param, $options) ? ' checked="checked"' : '') . ' />
							' . $label . '
						</label><br />';
}
$content .= '	</fieldset>
				<fieldset>
					<legend>Inclure une description</legend>
					<textarea style="width:100%;height:150px;" name="desc">' . io::htmlspecialchars(io::post('desc')) . '</textarea>
				</fieldset><br /><br />
				<input type="submit" class="admin_input_submit" value="' . $cms_language->getMessage(MESSAGE_PAGE_EXPORT_MODULE) . '" />
			</form>';
switch (io::post('action')) {
    case 'export':
        if (io::post('desc')) {
            $options['description'] = io::post('desc');
        }
        //set export parameters
        $export->setParameters($options);
        //force default language loading to overwrite user language because datas is more accurate in default language
        $oldLanguage = $cms_language->getCode();
        $cms_language = CMS_languagesCatalog::getDefaultLanguage(false);
        //export datas
        $exportDatas = $export->export($format);
        //reload user language
        $cms_language = CMS_languagesCatalog::getByCode($oldLanguage);
        switch ($format) {
            case 'php':
                $content .= '
				<br /><a name="exportDatas"></a>
				<fieldset>
开发者ID:davidmottet,项目名称:automne,代码行数:31,代码来源:export.php

示例9: dirname

<?php

require_once dirname(__FILE__) . '/../module.inc.php';
$contactFilterId = io::get('id');
$contactFilter = $api->contactfilter(array("method" => "VIEW", "ID" => $contactFilterId));
if ($contactFilter) {
    $contactFilter = $contactFilter->Data[0];
}
$submitted = io::post('submit');
$errors = array();
$deleted = false;
if ($submitted) {
    $contactFilterId = io::post('id');
    if (empty($errors)) {
        $response = $api->contactfilter(array('method' => 'DELETE', 'ID' => $contactFilterId));
        echo '<pre>';
        var_dump($api);
        echo '</pre>';
        if (isset($api->_response_code) && $api->_response_code === MailjetAPI::MAILJET_STATUS_CODE_OK_DELETE) {
            $deleted = true;
        }
    }
} else {
    if ($contactFilter) {
        $name = $contactFilter->Name;
        $description = $contactFilter->Description != '' ? $contactFilter->Description : '-';
        $expression = $contactFilter->Expression;
    }
}
?>
<!DOCTYPE html>
开发者ID:arthurgorjux,项目名称:mailjetAutomne,代码行数:31,代码来源:delete.php


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