本文整理汇总了PHP中Site::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Site::getName方法的具体用法?PHP Site::getName怎么用?PHP Site::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Site
的用法示例。
在下文中一共展示了Site::getName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addSiteToArchive
/**
* Creates an entry in the site archive table, to enable auditing of
* deletion. Authorisation must have already been performed and the values come from
* an existing object and so are assumed to be valid. May not work if unregistered
* users are ever allowed to delete things.
* @param \Site $site
* @param \User $user
*/
public function addSiteToArchive(\Site $site, \User $user)
{
$archievedSite = new \ArchivedSite();
$archievedSite->setCertStatus($site->getCertificationStatus()->getName());
$archievedSite->setCountry($site->getCountry()->getName());
$archievedSite->setDeletedBy($user->getCertificateDn());
$archievedSite->setName($site->getName());
$archievedSite->setOriginalCreationDate($site->getCreationDate());
$archievedSite->setParentNgi($site->getNgi()->getName());
$archievedSite->setScopes($site->getScopeNamesAsString());
$archievedSite->setV4PrimaryKey($site->getPrimaryKey());
$archievedSite->setInfrastructure($site->getInfrastructure()->getName());
$this->em->persist($archievedSite);
}
示例2: submit
function submit(\Site $site, \User $user = null)
{
//Only administrators can delete sites, double check user is an administrator
checkUserIsAdmin();
//save name to display later
$params['Name'] = $site->getName();
//remove Site
try {
\Factory::getSiteService()->deleteSite($site, $user);
} catch (\Exception $e) {
show_view('error.php', $e->getMessage());
die;
}
show_view('/site/deleted_site.php', $params);
}
示例3: FormSiteGeneral
function FormSiteGeneral(&$template, $siteAdmin = null, $action = null)
{
parent::Form($template, $action);
// site selected for mod, display site info in form input
if (!is_null($siteAdmin)) {
$siteSelect = new Site($siteAdmin);
$this->valueName = $siteSelect->getName();
$urls = $siteSelect->getUrls();
$this->valueMainUrl = $urls[0];
$this->valueLogo = $siteSelect->getLogo();
$this->idPdf = $siteSelect->getIdPdf();
$this->pathTheme = $siteSelect->getPathTheme();
$params = $siteSelect->getParams();
$this->valueRecordGet = $params['params_choice'];
$this->valueVariableNames = $params['params_names'];
$this->siteAdmin = $siteAdmin;
}
}
示例4: copySite
public function copySite(Site $s, $new_name, $seconds = 10)
{
if (!is_numeric($seconds) || !$seconds > 0) {
throw new e\UnacceptableValueException(S_SPAN . c\M::UNACCEPTABLE_SECONDS . E_SPAN);
}
$this->service->siteCopy($s->getId(), $s->getName(), $new_name);
// wait until it is done
sleep($seconds);
if ($this->service->isSuccessful()) {
return $this;
}
throw new e\SiteCreationFailureException(S_SPAN . c\M::SITE_CREATION_FAILURE . E_SPAN . $this->service->getMessage());
}
示例5: needConfirmation
function needConfirmation($type, $idDependOnType)
{
$confirmed = $this->request->getConfirmedState();
if ($confirmed == 1) {
return true;
} else {
switch ($type) {
case 'site':
$o_site = new Site($idDependOnType);
$subStr = sprintf($GLOBALS['lang']['generique_siteno'], '<b>"' . $o_site->getName() . '"</b>');
break;
case 'newsletter':
$subStr = sprintf($GLOBALS['lang']['generique_newsletterno'], '<b>"' . $this->site->getNewsletterName($idDependOnType) . '"</b>');
break;
case 'partner':
$subStr = sprintf($GLOBALS['lang']['generique_partnerno'], '<b>"' . $this->site->getPartnerNameFromId($idDependOnType) . '"</b>');
break;
case 'user':
$subStr = sprintf($GLOBALS['lang']['generique_user'], '<b>"' . $idDependOnType . '"</b>');
break;
case 'pdf':
$pdfDb = new PdfConfigDb($this->site->id);
$o_pdf = $pdfDb->getPdf($idDependOnType);
$subStr = sprintf($GLOBALS['lang']['generique_pdfno'], '<b>"' . $o_pdf->pdfName . '"</b>');
break;
}
$this->tpl->assign('message', sprintf($GLOBALS['lang']['admin_deleteconfirm'], $subStr));
$this->tpl->assign("confirmation", $type);
// flag smarty
$this->tpl->template = "admin/ask_confirmation.tpl";
return false;
}
}
示例6: display
function display()
{
$viewAllDetail = false;
$paramAll = getRequestVar('all', 0, 'int');
if ($paramAll == 1) {
$viewAllDetail = true;
}
$period = $this->request->getPeriod();
$idSite = $this->request->getSiteId();
$idSite = getRequestVar('site', -1, 'int');
/*
$rssHash = Request :: getRssHash();
if ($rssHash == "xxx") {
$urlStartGraph = "";
} else {
$urlStartGraph = PHPMV_URL; //Request::getCurrentCompletePath();
$urlStartGraph .= "/index.php?site=".$idSite."&rss_hash=".$rssHash;
$urlStartGraph .= "&date=".getRequestVar("date", date("Y-m-d"), "string")."&period=".$period."&mod=view_graph";
}
*/
$pdf = new GenerePDF("P", "mm");
/*
$pdf->AddFont("DejaVuSans", "", "DejaVuSans.php");
$pdf->AddFont("DejaVuSans", "B", "DejaVuSans.php");
$pdf->AddFont("DejaVuSans", "I", "DejaVuSans.php");
$pdf->AddFont("DejaVuSans", "BI", "DejaVuSans.php");
$pdf->phpmvFont = "DejaVuSans";
*/
/*
$pdf->AddFont("SILEOT", "", "SILEOT.php");
$pdf->AddFont("SILEOT", "B", "SILEOT.php");
$pdf->AddFont("SILEOT", "I", "SILEOT.php");
$pdf->AddFont("SILEOT", "BI", "SILEOT.php");
$pdf->phpmvFont = "SILEOT";
*/
$pdf->currentModule = $this;
if ($idSite > 0) {
$site = new Site($idSite);
$pdf->currentSite = $site;
} else {
$pdf->currentSite = null;
}
$pdf->period = $period;
$pdf->literalDate = getLiteralDate($period, $this->request->getDate());
if (isset($GLOBALS["lang"]["text_dir"])) {
$pdf->direction = $GLOBALS["lang"]["text_dir"];
} else {
$pdf->direction = "ltr";
}
//$pdf->direction = "rtl";
// Set PDF propertes data
if ($idSite != -1) {
$titre = "Statistics of " . $site->getName();
} else {
$titre = $pdf->pmvTranslate("summary_title");
}
$pdf->SetTitle($titre);
$pdf->SetAuthor("phpMyVisites");
$pdf->SetCreator($pdf->pmvTranslate("head_titre"));
$pdf->SetKeywords($pdf->pmvTranslate("head_keywords"));
$pdf->SetSubject($pdf->pmvTranslate("logo_description"));
$pdf->SetFont($pdf->phpmvFont, "", 8);
$pdf->SetLineWidth(0.1);
// *******************************************************
// Sites Summary
// *******************************************************
$pdf->titrePage1 = "summary_title";
$pdf->AddPage();
$pdf->setSitesSummaryStatistics();
if ($idSite > 0) {
$zoom = $this->data->getVisitsStatistics();
if (!isset($zoom["nb_vis"])) {
$txtNoVisit = $pdf->pmvTranslate("aucunvisiteur_titre");
$pdf->Ln();
$pdf->Ln();
$pdf->SetFont($pdf->phpmvFont, "", 14);
$pdf->SetTextColor(255, 0, 0);
$w = $pdf->GetStringWidth($txtNoVisit) + 6;
$pdf->SetX((210 - $w) / 2);
$pdf->Cell($w, 8, $txtNoVisit, "", 0, "C", 0);
} else {
// Summary Link
$pdf->setStyleSummaryLink();
$pdf->Ln();
$linkP1 = $pdf->AddLink();
$pdf->SetX(50);
$pdf->Cell(80, PDF_DEFAULT_ROW_HEIGHT, $pdf->pmvTranslate("visites_titre"), "0", "", "L", 0, $linkP1);
$pdf->Ln();
$linkP2 = $pdf->AddLink();
$pdf->SetX(50);
$pdf->Cell(80, PDF_DEFAULT_ROW_HEIGHT, $pdf->pmvTranslate("frequence_titre"), "0", "", "L", 0, $linkP2);
$pdf->Ln();
$linkP3 = $pdf->AddLink();
$pdf->SetX(50);
$pdf->Cell(80, PDF_DEFAULT_ROW_HEIGHT, $pdf->pmvTranslate("pagesvues_titre"), "0", "", "L", 0, $linkP3);
$pdf->Ln();
$linkP4 = $pdf->AddLink();
$pdf->SetX(50);
$pdf->Cell(80, PDF_DEFAULT_ROW_HEIGHT, $pdf->pmvTranslate("suivi_titre"), "0", "", "L", 0, $linkP4);
$pdf->Ln();
//.........这里部分代码省略.........
示例7: setDefaultSite
public function setDefaultSite(Site $site = NULL)
{
if (isset($site)) {
$this->getProperty()->defaultSiteId = $site->getId();
$this->getProperty()->defaultSiteName = $site->getName();
} else {
$this->getProperty()->defaultSiteId = NULL;
$this->getProperty()->defaultSiteName = NULL;
}
return $this;
}
示例8: testGetName
/**
* @covers pgn\tags\Site::getName
*/
public function testGetName()
{
$expected = 'Site';
$result = $this->object->getName();
$this->assertEquals($expected, $result);
}
示例9: display
function display()
{
$viewAllDetail = false;
$paramAll = getRequestVar('all', 0, 'int');
if ($paramAll == 1) {
$viewAllDetail = true;
}
$period = $this->request->getPeriod();
$idSite = $this->request->getSiteId();
$idSite = getRequestVar('site', -1, 'int');
$idPdf = getRequestVar('idPdf', -2, 'int');
//$pdf = new GenerePDF("P", "mm");
$pdf = new GenerePDF('P', 'mm', 'A4', true, "UTF-8");
// patch by HonestQiao
if ($GLOBALS['lang']['lang_iso'] == 'zh') {
$pdf->phpmvFont = "GB";
$pdf->AddGBFont();
}
// patch by HonestQiao
if (isset($GLOBALS["lang"]["text_dir"])) {
$pdf->direction = $GLOBALS["lang"]["text_dir"];
} else {
$pdf->direction = "ltr";
}
// ENGLISH
/* SPECIFIC TCPDF
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = "UTF-16";
$l['a_meta_dir'] = $pdf->direction;
$l['a_meta_language'] = "jp";
// TRANSLATIONS --------------------------------------
$l['w_page'] = "page";
$pdf->setLanguageArray($l); //set language items
*/
// fin specifique TCPDF
//
$pdf->currentModule = $this;
if ($idSite > 0) {
$site = new Site($idSite);
$pdf->currentSite = $site;
} else {
$pdf->currentSite = null;
}
$pdf->period = $period;
$pdf->date = $this->request->getDate();
$pdf->literalDate = getLiteralDate($period, $this->request->getDate());
// Set PDF propertes data
if ($idSite != -1) {
$titre = "Statistics of " . $site->getName();
} else {
$titre = $pdf->pmvTranslate("summary_title");
}
$pdf->SetTitle($titre);
$pdf->SetAuthor("phpMyVisites");
$pdf->SetCreator($pdf->pmvTranslate("head_titre"));
$pdf->SetKeywords($pdf->pmvTranslate("head_keywords"));
$pdf->SetSubject($pdf->pmvTranslate("logo_description"));
$pdf->SetFont($pdf->phpmvFont, "", 8);
$pdf->SetLineWidth(0.1);
$firstPageOk = false;
if ($idSite <= 0) {
// *******************************************************
// Sites Summary
// *******************************************************
$pdf->titrePage1 = "summary_title";
$pdf->AddPage();
$firstPageOk = true;
$pdf->setSitesSummaryStatistics();
$pdf->Ln();
} else {
$zoom = $this->data->getVisitsStatistics();
if (!isset($zoom["nb_vis"])) {
$pdf->titrePage1 = "summary_title";
$pdf->AddPage();
$firstPageOk = true;
$txtNoVisit = $pdf->pmvTranslate("aucunvisiteur_titre");
$pdf->setErrorMessage($txtNoVisit);
} else {
$confPf = new PdfConfigDb($idSite, true);
if ($idPdf == -2) {
// No PDF
// Get default site pdf
$idPdf = $site->getIdPdf();
}
$paramShowPdf = $confPf->getPdf($idPdf);
if ($paramShowPdf == null) {
//print("take defaut<br>");
$paramShowPdf = $confPf->getDefaultPdf();
} else {
$paramShowPdf = $paramShowPdf->pdfParam;
}
$confShowPdf = $confPf->getChoixPdf();
$pdfLink = array();
// Create all links object
foreach ($paramShowPdf as $keyTab => $info) {
//.........这里部分代码省略.........