本文整理汇总了PHP中Alias::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Alias::getId方法的具体用法?PHP Alias::getId怎么用?PHP Alias::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alias
的用法示例。
在下文中一共展示了Alias::getId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Alias
if ($aliasUpdate->execute()) {
echo "Alias deleted Successfully.";
}
} else {
//new or Update
//ensure it is available!
$alias = new Alias($conn);
$alias->setAlias($fileAlias);
$numAliases = sizeof($alias->getObjectsLikeThis());
if ($numAliases == 0) {
if ($file->getAliasID() == 0) {
$alias->setPointer($file->getId());
$alias->setType('file');
if ($alias->save() > 0) {
//echo "Alias Saved";
$fileUpdate->setAliasID($alias->getId());
}
} else {
$aliasUpdate = "UPDATE `alias` set `alias` = :NEWALIAS where `id` = :ALIASID";
$aliasUpdate = $conn->prepare($aliasUpdate);
$aliasUpdate->bindParam(':NEWALIAS', $fileAlias);
$aliasUpdate->bindParam(':ALIASID', $file->getAliasID());
$fileUpdate->setAliasID($file->getAliasID());
if ($aliasUpdate->execute() > 0) {
//echo "Alias updated Successfully.";
}
}
} else {
echo "Alias '" . $fileAlias . "' already exists!";
$fileUpdate->setAliasID($file->getAliasID());
}
示例2: Alias
$alias = new Alias($conn);
$fileAlias = issetOrBlank($_POST['file-alias']);
if (!startsWith($fileAlias, "/")) {
$fileAlias = "/" . $fileAlias;
}
$alias->setAlias($fileAlias);
//must start with '/'
//check if alias already exists first
//pa( $alias->getObjectsLikeThis() );
//echo sizeof( $alias->getObjectsLikeThis() );
$numAliases = sizeof($alias->getObjectsLikeThis());
$alias->setPointer($file->getId());
$alias->setType("file");
if ($alias->getAlias() != "/" && $numAliases == 0 && $alias->save() > 0) {
echo '<h1>Alias created OK!</h1>';
$file->setAliasID($alias->getId());
if ($file->save() > 0) {
echo '<p>File Updated</p>';
}
} else {
if ($numAliases > 0) {
echo '<p>The Alias: ' . $alias->getAlias() . ' already exists</p>';
} else {
if ($alias->getAlias() == "/") {
echo '<p>Alias cannot be saved as /</p>';
//shouldnt occur
} else {
echo '<p>Couldnt save...</p>';
}
}
}
示例3: getGS
exit;
}
$backLink = "/{$ADMIN}/pub/add.php";
if (empty($f_name)) {
camp_html_add_msg(getGS('You must fill in the $1 field.', '<B>' . getGS('Name') . '</B>'));
}
if (empty($f_default_alias)) {
camp_html_add_msg(getGS('You must fill in the $1 field.', '<B>' . getGS('Site') . '</B>'));
}
if (camp_html_has_msgs()) {
camp_html_goto_page($backLink);
}
camp_is_alias_conflicting($f_default_alias);
camp_is_publication_conflicting($f_name);
if (camp_html_has_msgs()) {
camp_html_goto_page($backLink);
}
$alias = new Alias();
$alias->create(array('Name' => $f_default_alias));
$publicationObj = new Publication();
$columns = array('Name' => $f_name, 'IdDefaultAlias' => $alias->getId(), 'IdDefaultLanguage' => $f_language, 'IdURLType' => $f_url_type, 'TimeUnit' => $f_time_unit, 'PaidTime' => $f_paid, 'TrialTime' => $f_trial, 'UnitCost' => $f_unit_cost, 'UnitCostAllLang' => $f_unit_cost_all_lang, 'Currency' => $f_currency, 'comments_enabled' => $f_comments_enabled, 'comments_article_default_enabled' => $f_comments_article_default, 'comments_subscribers_moderated' => $f_comments_subscribers_moderated, 'comments_public_moderated' => $f_comments_public_moderated, 'comments_public_enabled' => $f_comments_public_enabled, 'comments_captcha_enabled' => $f_comments_captcha_enabled, 'comments_spam_blocking_enabled' => $f_comments_spam_blocking_enabled, 'comments_moderator_to' => $f_comments_moderator_to, 'comments_moderator_from' => $f_comments_moderator_from, 'seo' => serialize($f_seo));
$created = $publicationObj->create($columns);
if ($created) {
$alias->setPublicationId($publicationObj->getPublicationId());
camp_html_add_msg("Publication created.", "ok");
camp_html_goto_page("/{$ADMIN}/pub/edit.php?Pub=" . $publicationObj->getPublicationId());
} else {
$alias->delete();
camp_html_add_msg(getGS('The publication could not be added.'));
camp_html_goto_page($backLink);
}
示例4: Alias
if (camp_html_has_msgs()) {
camp_html_goto_page($backLink);
}
camp_is_alias_conflicting($f_default_alias);
camp_is_publication_conflicting($f_name);
if (camp_html_has_msgs()) {
camp_html_goto_page($backLink);
}
$alias = new Alias();
$alias->create(array('Name' => $f_default_alias));
$publicationObj = new Publication();
$columns = array('Name' => $f_name,
'IdDefaultAlias'=> $alias->getId(),
'IdDefaultLanguage' => $f_language,
'IdURLType' => $f_url_type,
'url_error_tpl_id' => $f_url_error_tpl_id,
'TimeUnit' => $f_time_unit,
'PaidTime' => $f_paid,
'TrialTime' => $f_trial,
'UnitCost' => $f_unit_cost,
'UnitCostAllLang' => $f_unit_cost_all_lang,
'Currency' => $f_currency,
'comments_enabled' => $f_comments_enabled,
'comments_article_default_enabled'=> $f_comments_article_default,
'comments_subscribers_moderated' => $f_comments_subscribers_moderated,
'comments_public_moderated' => $f_comments_public_moderated,
'comments_captcha_enabled' => $f_comments_captcha_enabled,
'comments_spam_blocking_enabled' => $f_comments_spam_blocking_enabled,
示例5: parseAlias
function parseAlias($intAliasId, $strCommand)
{
global $_PATHS, $_CLEAN_POST, $_CONF, $objLang, $objLiveUser;
$objTpl = new HTML_Template_IT($_PATHS['templates']);
$objTpl->loadTemplatefile("alias.tpl.htm");
$blnError = false;
switch ($strCommand) {
case CMD_LIST:
case CMD_ADD:
case CMD_EDIT:
//*** Post the profile form if submitted.
if (count($_CLEAN_POST) > 0 && !empty($_CLEAN_POST['dispatch']) && $_CLEAN_POST['dispatch'] == "editAlias") {
//*** The element form has been posted.
//*** Check sanitized input.
if (is_null($_CLEAN_POST["frm_active"])) {
$blnError = true;
}
if (is_null($_CLEAN_POST["frm_alias"])) {
$blnError = true;
}
if (is_null($_CLEAN_POST["frm_language"])) {
$blnError = true;
}
if (is_null($_CLEAN_POST["frm_element"])) {
$blnError = true;
}
if (is_null($_CLEAN_POST["dispatch"])) {
$blnError = true;
}
if ($blnError === true) {
//*** Display global error.
$objTpl->setVariable("FORM_ACTIVE_VALUE", $_POST["frm_active"] == "on" ? "checked=\"checked\"" : "");
$objTpl->setVariable("FORM_ALIAS_VALUE", $_POST["frm_alias"]);
$objTpl->setVariable("ERROR_ALIAS_MAIN", $objLang->get("main", "formerror"));
} else {
//*** Input is valid. Save the alias.
if ($strCommand == CMD_EDIT) {
$objAlias = Alias::selectByPK($intAliasId);
} else {
$objAlias = new Alias();
}
$objAlias->setAccountId($_CONF['app']['account']->getId());
$objAlias->setActive($_POST["frm_active"] == "on" ? 1 : 0);
$objAlias->setLanguageId(empty($_CLEAN_POST["frm_language"]) ? 0 : $_CLEAN_POST["frm_language"]);
$objAlias->setAlias($_CLEAN_POST["frm_alias"]);
$objAlias->setUrl($_CLEAN_POST["frm_element"]);
$objAlias->save();
header("Location: " . Request::getURI() . "/?cid=" . NAV_PCMS_ALIASES);
exit;
}
}
//*** Initiate child element loop.
$objAliases = Alias::selectSorted();
$totalCount = 0;
$listCount = 0;
$intPosition = request("pos");
$intPosition = !empty($intPosition) && is_numeric($intPosition) ? $intPosition : 0;
$intPosition = floor($intPosition / $_SESSION["listCount"]) * $_SESSION["listCount"];
//*** Find total count.
foreach ($objAliases as $objAlias) {
$strAlias = $objAlias->getAlias();
if (!empty($strAlias)) {
$totalCount++;
}
}
$objAliases->seek($intPosition);
$objLanguages = ContentLanguage::select();
foreach ($objAliases as $objAlias) {
$strAlias = $objAlias->getAlias();
if (!empty($strAlias)) {
$strUrl = $objAlias->getUrl();
if (is_numeric($strUrl)) {
$objElement = Element::selectByPk($strUrl);
if (is_object($objElement)) {
$strUrlHref = "?eid={$strUrl}&cmd=" . CMD_EDIT . "&cid=" . NAV_PCMS_ELEMENTS;
$strUrl = Element::recursivePath($strUrl);
} else {
$strUrlHref = "?cid=" . NAV_PCMS_ALIASES;
$strUrl = "<b>" . $objLang->get("aliasUnavailable", "label") . "</b>";
}
}
$objTpl->setCurrentBlock("multiview-item");
$objTpl->setVariable("MULTIITEM_VALUE", $objAlias->getId());
$objTpl->setVariable("BUTTON_REMOVE_HREF", "javascript:Alias.remove({$objAlias->getId()});");
$objTpl->setVariable("BUTTON_REMOVE", $objLang->get("delete", "button"));
$objTpl->setVariable("MULTIITEM_HREF", "?cid=" . NAV_PCMS_ALIASES . "&eid={$objAlias->getId()}&cmd=" . CMD_EDIT);
$objTpl->setVariable("MULTIITEM_TYPE_CLASS", "alias");
$objTpl->setVariable("MULTIITEM_ALIAS", $objAlias->getAlias());
$objTpl->setVariable("MULTIITEM_POINTS_TO", $objLang->get("pointsTo", "label"));
$objTpl->setVariable("MULTIITEM_URL", $strUrl);
$objTpl->setVariable("MULTIITEM_URL_HREF", $strUrlHref);
if ($objLanguages->count() > 1) {
if ($objAlias->getLanguageId() > 0) {
$strLanguage = ContentLanguage::selectByPK($objAlias->getLanguageId())->getName();
$objTpl->setVariable("MULTIITEM_LANGUAGE", sprintf($objLang->get("forLanguage", "label"), $strLanguage));
} else {
$objTpl->setVariable("MULTIITEM_LANGUAGE", $objLang->get("forAllLanguages", "label"));
}
} else {
$objTpl->setVariable("MULTIITEM_LANGUAGE", "");
//.........这里部分代码省略.........