public static function GetByName($p_name) { global $g_ado_db; $sql = "SELECT * FROM URLTypes WHERE Name=" . $g_ado_db->escape($p_name); $row = $g_ado_db->GetRow($sql); if ($row && is_array($row)) { $urlType = new UrlType(); $urlType->fetch($row); return $urlType; } else { return null; } }
require_once($GLOBALS['g_campsiteDir'].'/classes/Phorum_setting.php'); require_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/camp_html.php"); camp_load_translation_strings("api"); // Check permissions if (!$g_user->hasPermission('ManagePub')) { camp_html_display_error(getGS("You do not have the right to add publications.")); exit; } $languages = Language::GetLanguages(null, null, null, array(), array(), true); $defaultLanguage = array_pop(Language::GetLanguages(null, camp_session_get('TOL_Language', 'en'), null, array(), array(), true)); $urlTypes = UrlType::GetUrlTypes(); $allTemplates = Template::GetAllTemplates(null, true, true, true); $timeUnits = TimeUnit::GetTimeUnits(camp_session_get('TOL_Language', 'en')); $shortNameUrlType = UrlType::GetByName('short names'); $aliases = array(); $crumbs = array(); $crumbs[] = array(getGS("Publications"), "/$ADMIN/pub/"); $crumbs[] = array(getGS("Add new publication"), ""); echo camp_html_breadcrumbs($crumbs); include_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/javascript_common.php"); ?> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons" style="padding-top: 5px;"> <TR> <TD><A HREF="/<?php echo $ADMIN; ?>/pub/"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/left_arrow.png" BORDER="0"></A></TD> <TD><A HREF="/<?php echo $ADMIN; ?>/pub/"><B><?php putGS("Publication List"); ?></B></A></TD> </TR>
?> /is_shown.png" border="0"> <?php } else { ?> <img src="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?> /is_hidden.png" border="0"> <?php } ?> </TD> <TD align="center"> <?php $urlTypeObj = new UrlType($pub->getUrlTypeId()); p(htmlspecialchars($urlTypeObj->getName())); ?> </TD> <TD ALIGN="CENTER"> <A HREF="/<?php p($ADMIN); ?> /pub/edit.php?Pub=<?php p($pub->getPublicationId()); ?> "><img src="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?> /configure.png" alt="<?php
// Check permissions if (!$g_user->hasPermission('ManagePub')) { camp_html_display_error(getGS("You do not have the right to edit publication information.")); exit; } $f_publication_id = Input::Get('Pub', 'int'); $TOL_Language = camp_session_get('TOL_Language', 'en'); if (!Input::IsValid()) { camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), $_SERVER['REQUEST_URI']); exit; } $languages = Language::GetLanguages(null, null, null, array(), array(), true); $urlTypes = UrlType::GetUrlTypes(); $allTemplates = Template::GetAllTemplates(null, true, true, true); $timeUnits = TimeUnit::GetTimeUnits($TOL_Language); $publicationObj = new Publication($f_publication_id); $aliases = Alias::GetAliases(null, $f_publication_id); $forum = new Phorum_forum($publicationObj->getForumId()); $pubTimeUnit = new TimeUnit($publicationObj->getTimeUnit(), $publicationObj->getLanguageId()); if (!$pubTimeUnit->exists()) { $pubTimeUnit = new TimeUnit($publicationObj->getTimeUnit(), 1); } include_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/javascript_common.php"); echo camp_html_content_top(getGS("Configure publication"), array("Pub" => $publicationObj)); ?>