Return a string to use as link text when this page appears in
        menus.
484400
def menu_text(self, request=None):
        """"""
        source_field_name = settings.PAGE_FIELD_FOR_MENU_ITEM_TEXT
        if(
            source_field_name != 'menu_text' and
            hasattr(self, source_field_name)
        ):
            return getattr(self, source_field_name)
        return self.title
958806
def snippetWithLink(self, url):
        
        link = self.soup.find("a", attrs={'href': url})
        if link:
            for p in link.parents:
                if p.name in ('p', 'div'):
                    return ' '.join(p.text.split()[0:30])
        return None
510401
def page_str(self):
        
        tmpl = '.. _%s:\n\n%s\n\n%s\n\n----\n\n%s'
        components = (
            self._ms_name, self._page_title, self._intro_text,
            self._member_defs
        )
        return tmpl % components
604737
def click_link_text(self, link_text, timeout=settings.SMALL_TIMEOUT):
        
        # If using phantomjs, might need to extract and open the link directly
        if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
            timeout = self.__get_new_timeout(timeout)
        if self.browser == 'phantomjs':
            if self.is_link_text_visible(link_text):
                element = self.wait_for_link_text_visible(
                    link_text, timeout=timeout)
                element.click()
                return
            self.open(self.__get_href_from_link_text(link_text))
            return
        if not self.is_link_text_present(link_text):
            self.wait_for_link_text_present(link_text, timeout=timeout)
        pre_action_url = self.get_current_url()
        try:
            element = self.wait_for_link_text_visible(
                link_text, timeout=0.2)
            self.__demo_mode_highlight_if_active(link_text, by=By.LINK_TEXT)
            try:
                element.click()
            except (StaleElementReferenceException, ENI_Exception):
                self.wait_for_ready_state_complete()
                time.sleep(0.05)
                element = self.wait_for_link_text_visible(
                    link_text, timeout=timeout)
                element.click()
        except Exception:
            found_css = False
            text_id = self.get_link_attribute(link_text, "id", False)
            if text_id:
                link_css = '[id="%s"]' % link_text
                found_css = True

            if not found_css:
                href = self.__get_href_from_link_text(link_text, False)
                if href:
                    if href.startswith('/') or page_utils.is_valid_url(href):
                        link_css = '[href="%s"]' % href
                        found_css = True

            if not found_css:
                ngclick = self.get_link_attribute(link_text, "ng-click", False)
                if ngclick:
                    link_css = '[ng-click="%s"]' % ngclick
                    found_css = True

            if not found_css:
                onclick = self.get_link_attribute(link_text, "onclick", False)
                if onclick:
                    link_css = '[onclick="%s"]' % onclick
                    found_css = True

            success = False
            if found_css:
                if self.is_element_visible(link_css):
                    self.click(link_css)
                    success = True
                else:
                    # The link text might be hidden under a dropdown menu
                    success = self.__click_dropdown_link_text(
                        link_text, link_css)

            if not success:
                element = self.wait_for_link_text_visible(
                    link_text, timeout=settings.MINI_TIMEOUT)
                element.click()

        if settings.WAIT_FOR_RSC_ON_CLICKS:
            self.wait_for_ready_state_complete()
        if self.demo_mode:
            if self.driver.current_url != pre_action_url:
                self.__demo_mode_pause_if_active()
            else:
                self.__demo_mode_pause_if_active(tiny=True)
899606
def render_link(self, template_pack=TEMPLATE_PACK, **kwargs):
        
        link_template = self.link_template % template_pack
        return render_to_string(link_template, {'link': self})
726887
def insertLink(page, lnk, mark = True):
    
    CheckParent(page)
    annot = getLinkText(page, lnk)
    if annot == "":
        raise ValueError("link kind not supported")

    page._addAnnot_FromString([annot])
    return
1221568
def create_link_button(self, text="None", uri="None"):
        
        link_btn = Gtk.LinkButton(uri, text)
        return link_btn
592939
public function setHref($menulink)
    {
        if ($menulink->url) {
            return $menulink->url;
        }
        if ($menulink->page) {
            return $menulink->page->uri();
        }

        return '/';
    }
1220199
def __click_dropdown_link_text(self, link_text, link_css):
        
        soup = self.get_beautiful_soup()
        drop_down_list = soup.select('[class*=dropdown]')
        for item in soup.select('[class*=HeaderMenu]'):
            drop_down_list.append(item)
        for item in soup.select('[class*=menu-item]'):
            drop_down_list.append(item)
        for item in soup.select('[class*=chevron]'):
            drop_down_list.append(item)
        csstype = link_css.split('[')[1].split('=')[0]
        for item in drop_down_list:
            if link_text in item.text.split('\n') and csstype in item.decode():
                dropdown_css = ""
                for css_class in item['class']:
                    dropdown_css += '.'
                    dropdown_css += css_class
                dropdown_css = item.name + dropdown_css
                matching_dropdowns = self.find_visible_elements(dropdown_css)
                for dropdown in matching_dropdowns:
                    # The same class names might be used for multiple dropdowns
                    try:
                        page_actions.hover_element_and_click(
                            self.driver, dropdown, link_text,
                            click_by=By.LINK_TEXT, timeout=0.2)
                        return True
                    except Exception:
                        pass
        return False
644089
def tablename_from_link(klass, link):
        
        arr = link.split("/")
        i = arr.index("table")
        tn = arr[i+1]
        return tn
1147735
def generate_menu():
    
    if db is not None:
        needs_rebuild = db.get('site:needs_rebuild')
    else:
        needs_rebuild = site.coil_needs_rebuild
    if needs_rebuild not in (u'0', u'-1', b'0', b'-1'):
        return ('</li><li><a href="{0}"><i class="fa fa-fw '
                'fa-warning"></i> <strong>Rebuild</strong></a></li>'.format(
                    url_for('rebuild')))
    else:
        return ('</li><li><a href="{0}"><i class="fa fa-fw '
                'fa-cog"></i> Rebuild</a></li>'.format(url_for('rebuild')))
535564
def text(self):
        
        if self.m_name == -1 or self.m_event != const.TEXT:
            return u''

        return self.sb[self.m_name]
455719
def menu text, &block
      #$log.debug "YYYY inside M: menu text #{text}  "
      m = Menu.new text, &block 
      add m
      return m
    end
1107349
def _object_type_html(self):
        

        if self.exists:
            return "<a href=\"%s\">%s</a>" % (self.url(), 
                                              self.content_type.name,)
        else:
            return "<s>%s</s>" % self.content_type.name
106449
def link_text(cls):
        
        link = cls.__name__
        if link.endswith('View'):
            link = link[:-4]
        return link
117466
private static String linkToHtml( Link l ){
		if( l == null ) {
			return "null";
		}

		StringBuilder result = new StringBuilder();

		result.append("<div class=\"Link\"><b class=\"Link\">Link:</b>" +
				l.getType() + ": \"" +
				convertTags( l.getText() )+ "\" -> \"" + convertTags( l.getTarget() ) +"\"");

		if( l.getParameters().size() != 0 ){
			for( String parameter: l.getParameters() ) {
				result.append("<br>\nPARAMETER: \""+convertTags( parameter )+"\"");
			}
		}

		result.append("</div>\n");

		return result.toString();
	}
832598
def get_html_link(self, obj):
        
        return "<a href='{}'>{}</a>".format(api.get_url(obj), api.get_id(obj))