private function formatApiClass(Link $link)
 {
     $linkToClass = $this->getLinkToApiClass($link->getDestination());
     if (empty($linkToClass)) {
         return;
     }
     $description = $link->getDescription();
     $parts = explode("\\", $description);
     $description = end($parts);
     $link = sprintf('[%s](%s)', $description, $linkToClass);
     return $link;
 }
 private function formatInternalMethod(Link $link)
 {
     if (empty($this->scope->class)) {
         return;
     }
     $methodName = substr($link->getDestination(), 0, strlen($link->getDestination()) - 2);
     $methods = $this->scope->class->getMethods(true);
     if (empty($methodName) || !array_key_exists($methodName, $methods)) {
         return;
     }
     $linkToClass = $this->getLinkToApiClass($this->scope->class->getName());
     return sprintf('[%s](%s#%s)', $link->getDescription(), $linkToClass, strtolower($methodName));
 }
 private function formatInternalProperty(Link $link)
 {
     if (empty($this->scope->class)) {
         return;
     }
     $properties = $this->scope->class->getProperties(true);
     $propertyName = substr($link->getDestination(), 1);
     if (!$propertyName || !array_key_exists($propertyName, $properties)) {
         return;
     }
     $linkToClass = $this->getLinkToApiClass($this->scope->class->getName());
     return sprintf('[%s](%s#$%s)', $link->getDescription(), $linkToClass, strtolower($propertyName));
 }
 public function parse($comment)
 {
     if (preg_match_all('/{\\@link(.*?)}/', $comment, $matches)) {
         foreach ($matches[0] as $key => $rawLink) {
             $linkParser = new LinkParser($this->scope);
             $linkFormatted = $linkParser->parse($matches[1][$key]);
             $comment = str_replace($rawLink, $linkFormatted, $comment);
         }
     }
     if (preg_match_all('/{\\@hook(.*?)}/', $comment, $matches)) {
         foreach ($matches[0] as $key => $rawLink) {
             $link = new Link($matches[1][$key]);
             $anchor = strtolower(str_replace('.', '', $link->getDestination()));
             $linkFormatted = sprintf('[%s](/api-reference/events#%s)', $link->getDescription(), $anchor);
             $comment = str_replace($rawLink, $linkFormatted, $comment);
         }
     }
     return $comment;
 }
 private function formatInternalConstant(Link $link)
 {
     $constName = $link->getDestination();
     if (empty($this->scope->class) || empty($constName)) {
         return;
     }
     $constants = $this->scope->class->getConstants(true);
     if (!array_key_exists($constName, $constants)) {
         return;
     }
     $constant = $constants[$constName];
     if (!$constant) {
         return;
     }
     $description = $link->getDescription();
     if ($constant->getLongDesc()) {
         // we are displaying a link only to constants having a long description.
         $linkToClass = $this->getLinkToApiClass($this->scope->class->getName());
         return sprintf('`[%s](%s#%s)`', $description, $linkToClass, strtolower($constant));
     }
     return sprintf('`%s`', $description);
 }
Esempio n. 6
0
	                       <input type="text" disabled="disabled" value="<?php 
            echo $link->getCode();
            ?>
"/>
	                   </p>
	                   <p>
                            <label for="enlace">Enlace: </label>
                            <input id="enlace" type="text" name="enlace" value="<?php 
            echo $link->getUrl();
            ?>
" />
                       </p>
                       <p>
                            <label for="descripcion">Descripción</label>
                            <textarea id="descripcion" name="descripcion"><?php 
            echo $link->getDescription();
            ?>
</textarea>
                       </p>
                       <input type="hidden" name="accion" value="doedit" />
                       <input type="submit" value="Guardar">
	               </form>
	            <?php 
        } elseif ($_GET['accion'] == 'delete') {
            $link->delete();
            header("Location: index.php");
        }
    } else {
        ?>
            	<form action="#" method="post">
            		<p>
 public function formatting(Link $link)
 {
     return $this->formatExternalLink($link->getDestination(), $link->getDescription());
 }
Esempio n. 8
0
<?php

require_once "head.php";
include_once "menu.php";
$user_links = Usuario::getLinks($_SESSION['idusuario']);
$datarows = array();
foreach ($user_links as $user_link) {
    $l = new Link($user_link['id_link']);
    $clicks = $l->getClicks();
    $datarows[] = "['" . $l->getDescription() . "', " . $clicks['num'] . "]";
}
?>
  
     <!--Load the AJAX API-->
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">

      // Load the Visualization API and the piechart package.
      google.load('visualization', '1.0', {'packages':['corechart']});

      // Set a callback to run when the Google Visualization API is loaded.
      google.setOnLoadCallback(drawChart);
      
      // Callback that creates and populates a data table,
      // instantiates the pie chart, passes in the data and
      // draws it.
      function drawChart() {

        
        var data = google.visualization.arrayToDataTable([
            ['Enlaces', 'Nº de clicks'],
Esempio n. 9
0
 public function __construct($link)
 {
     parent::__construct('save');
     $language = OW::getLanguage()->getInstance();
     $this->link = $link;
     $urlField = new TextField('url');
     $urlField->setHasInvitation(true)->setInvitation('http://www.example.com');
     $this->addElement($urlField->setRequired(true)->addValidator(new UrlValidator())->setLabel($language->text('links', 'save_form_url_field_label'))->setValue($this->link->getUrl()));
     $titleField = new TextField('title');
     $this->addElement($titleField->setRequired(true)->setLabel($language->text('links', 'save_form_title_field_label'))->setValue($this->link->getTitle()));
     $descriptionTextArea = new WysiwygTextarea('description');
     $descriptionTextArea->setLabel($language->text('links', 'save_form_desc_field_label'));
     $descriptionTextArea->setValue($this->link->getDescription());
     $descriptionTextArea->setRequired(true);
     $this->addElement($descriptionTextArea);
     $tagService = BOL_TagService::getInstance();
     $tags = array();
     if (intval($this->link->getId()) > 0) {
         $arr = $tagService->findEntityTags($this->link->getId(), 'link');
         foreach (!empty($arr) ? $arr : array() as $dto) {
             $tags[] = $dto->getLabel();
         }
     }
     $tagsField = new TagsInputField('tags');
     $tagsField->setLabel($language->text('links', 'save_form_tags_field_label'));
     $tagsField->setValue($tags);
     $tagsField->setDelimiterChars(array('.'));
     $this->addElement($tagsField);
     //        $tagsField = new TagsField('tags', $tags);
     //        $this->addElement($tagsField->setLabel($language->text('links', 'save_form_tags_field_label')));
     $submit = new Submit('submit');
     $this->addElement($submit);
 }