/** * If profile editing is disabled, but the current user can add members, * just link directly to the add action. * * @param string $action */ public function Link($action = null) { if (!$action && Member::currentUserID() && !$this->AllowProfileEditing && $this->CanAddMembers()) { $action = 'add'; } return parent::Link($action); }
/** * @param null $action * @return string */ public function Link($action = null) { if ((is_null($action) || is_bool($action)) && $this->getParent()) { return $this->getParent()->Link() . '#section-' . $this->URLSegment; } return parent::Link($action); }
public function Link($action = null) { if ($this->ID && $this->ID == Multisites::inst()->getCurrentSiteId()) { return parent::Link($action); } return Controller::join_links($this->RelativeLink($action)); }
/** * If profile editing is disabled, but the current user can add members, * just link directly to the add action. * * @param string $action */ public function Link($action = null) { if (!$action && Member::currentUserID() && !$this->AllowProfileEditing && $this->AllowAdding && singleton('Member')->canCreate()) { $action = 'add'; } return parent::Link($action); }
public function testPageURL() { $page = new Page(); $page->URLSegment = 'test'; $page->write(); $obj = new LinkFieldTest_DataObject(); $obj->Link->setPageID($page->ID); $obj->write(); $this->assertEquals($page->Link(), $obj->Link->URL); }
/** * Generate link to a search with the specific arguments. * * @see framework/core/model/SiteTree#Link($action) * * @return string */ public function Link($args = null) { $link = parent::Link(); if ($args) { if (is_array($args)) { $link .= "?" . http_build_query($args); } } return $link; }
public function Link() { $link = parent::Link(); $this->extend('updateLink', $link); return $link; }
/** * Return the normal link directly to this page. Once you visit this link, a 30x redirection * will take you to your final destination. */ function regularLink($action = null) { return parent::Link($action); }
/** * returns the original page link. This is needed by the breadcrumbs. When * a product detail view is requested, the default method self::Link() will * return a modified link to the products detail view. This controller handles * both (product group views and product detail views), so a product detail * view won't have a related parent to show in breadcrumbs. The controller * itself will be the parent, so there must be two different links for one * controller. * * @return string * * @see self::Link() * @author Sebastian Diel <*****@*****.**> * @since 17.02.2011 */ public function OriginalLink() { return parent::Link(null); }
/** * @param null $action * @return string */ public function Link($action = null) { if (!empty($this->ThirdPartyURL)) { return $this->ThirdPartyURL; } return parent::Link($action); }
/** * Get the URL for this Product, products that are not part of the SiteTree are * displayed by the {@link Product_Controller}. * * @see SiteTree::Link() * @see Product_Controller::show() * @return String */ function Link($action = null) { if ($this->ParentID > -1) { //return Controller::join_links(Director::baseURL() . 'product/', $this->URLSegment .'/'); return parent::Link($action); } return Controller::join_links(Director::baseURL() . 'product/', $this->RelativeLink($action)); }
/** * Link to the news article. If it has an external URL set, or a file, link to that instead. * * @param String $action * @return String */ public function Link($action = '') { if (strlen($this->ExternalURL) && !strlen($this->Content)) { // redirect away return $this->ExternalURL; } if ($this->InternalFile()->ID) { $file = $this->InternalFile(); return $file->Link($action); } return parent::Link($action); }
/** * Return the normal link directly to this page. Once you visit this link, a 30x redirection * will take you to your final destination. */ function regularLink() { return parent::Link(); }