Sistema de documentación y gestión de páginas Web para un entorno o proyecto Web.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
WMarkDown/PHP/Modules/WMarkDown.Modules.Includes.php

42 lines
1.5 KiB

<?php
namespace WMarkDown\Modules;
class Includes extends \WMarkDown\Abstracts\Modules{
private $menu = '';
private $title = '';
public function get_next_position($string){
if(
$this->more &&
$this->from < 0 &&
$this->more = preg_match('/\[\[include ([^\[\]]+)\]\]/', $string, $this->matches, PREG_OFFSET_CAPTURE)
)
$this->from = $this->matches[0][1];
}
public function process($string, $modules, $level){
$formatted = \WMarkDown\Modules::format($this->wmarkdown, $data = $this->wmarkdown->load_file($this->matches[1][0]), [], $modules, $modules->menu_level);
$this->html = (
'<article class="included" data-file="' . $this->matches[1][0] . '">' .
'<a name="' . preg_replace('/[^a-z\d]+/', "-", strtolower(substr($this->matches[1][0], 1))) . '"></a>' .
$formatted["content"] .
'</article>'
);
$this->menu = $formatted["menu"];
$this->title = $formatted["title"];
$this->length = strlen($this->matches[0][0]);
$this->to = $this->from + $this->length;
$this->content = $this->matches[1][0];
}
public function get_menu(){return "" . $this->menu;}
public function get_title(){return "" . $this->title;}
};