Пример #1
0
 public function xhtml()
 {
     global $ID;
     $ns = getNS($ID);
     list($files, $subprojects) = Projects_file::project_files($ns);
     $generated = array();
     $source = array();
     foreach ($files as $id => $file) {
         if ($file->type() == 'source') {
             $source[$id] = $file;
         } elseif ($file->type() == 'generated') {
             $generated[$id] = $file;
         }
     }
     ksort($generated);
     ksort($source);
     sort($subprojects);
     echo '<h1>Source files</h1>' . DOKU_LF;
     echo '<ul>' . DOKU_LF;
     echo '<li>' . create_button('source') . '</li>' . DOKU_LF;
     foreach ($source as $id => $file) {
         echo '<li>' . html_wikilink($id) . ': ' . download_button($id) . ', ' . delete_button($id) . '</li>' . DOKU_LF;
     }
     echo '</ul>' . DOKU_LF;
     echo '<h1>Generated files</h1>' . DOKU_LF;
     echo '<ul>' . DOKU_LF;
     echo '<li>' . create_button('generated') . '</li>' . DOKU_LF;
     foreach ($generated as $id => $file) {
         $make = make_button($id, $file->status() == PROJECTS_MADE);
         echo '<li>' . html_wikilink($id) . ': ' . download_button($id) . ', ' . delete_button($id) . ', ' . $make . '</li>' . DOKU_LF;
     }
     echo '</ul>' . DOKU_LF;
     echo '<h1>Subprojects</h1>' . DOKU_LF;
     echo '<ul>' . DOKU_LF;
     echo '<li>' . create_button($ID, 'project') . '</li>' . DOKU_LF;
     foreach ($subprojects as $sub) {
         echo '<li><a href="' . wl($sub . ':', array('do' => 'manage_files')) . '">' . noNS($sub) . '</a></li>' . DOKU_LF;
     }
     echo '</ul>' . DOKU_LF;
     if ($ns) {
         $name = getNS($ns);
         $id = $name . ':';
         if (!$name) {
             $id = '/';
             $name = '/ (root)';
         }
         echo '<h1>Parent projects</h1>' . DOKU_LF;
         echo '<ul><li><a href="' . wl($id, array('do' => 'manage_files')) . '">' . $name . '</a></li></ul>' . DOKU_LF;
     }
 }
Пример #2
0
 public function __construct($parent, $file)
 {
     global $ID;
     global $REV;
     parent::__construct($parent, 'Summary');
     $list = $this->newElement('ul');
     $this->root->appendChild($list);
     $info = $this->newElement('li');
     $text = ': ' . $file->type() . ' file';
     $info->appendChild($this->loadElement(html_wikilink($ID)));
     $info->appendChild($this->newElement('span', array(), $text));
     $list->appendChild($info);
     $format = 'D M d, Y \\a\\t g:i:s a';
     if (date_default_timezone_get() == 'UTC') {
         $format .= ' e';
     }
     $date = $REV ? $REV : $file->modified_date();
     if (!$date) {
         $meta = Projects_file::file($file->id());
         $date = $meta ? $meta->modified_date() : time();
     }
     $updated = $this->newElement('li', array(), 'modified on: ' . date($format, $date));
     $list->appendChild($updated);
     $actions = $this->newElement('li', array(), "Actions: ");
     $list->appendChild($actions);
     $this->actions = $this->newElement('span');
     $actions->appendChild($this->actions);
     $this->newAction(manage_files_button($ID));
     if (!$REV) {
         $this->newAction(download_button($ID));
     }
     if (auth_quickaclcheck($ID) >= AUTH_DELETE) {
         $this->newAction(delete_button($ID));
     }
     $this->content = $this->newElement('div', array('id' => 'PROJECTS_content'));
     if ($file->is_making()) {
         $time = time() - $file->status()->started();
         $content = '<div id="PROJECTS_progress">The file has been generating for ' . self::format_time($time) . ': ' . kill_button($file->id(), FALSE) . DOKU_LF;
         foreach ($file->status()->made() as $made) {
             $content .= '<div class="success">' . html_wikilink($made) . '</div>' . DOKU_LF;
         }
         $content .= '<div class="notify">' . html_wikilink($file->status()->making()) . '</div>' . DOKU_LF;
         foreach ($file->status()->queue() as $queue) {
             $content .= '<div class="info">' . html_wikilink($queue) . '</div>' . DOKU_LF;
         }
         $this->setContent($content . '</div>');
     } else {
         if (is_array($file->status())) {
             $content = '<div>Error in file generation:' . DOKU_LF;
             foreach ($file->status() as $id => $errors) {
                 foreach ($errors as $error) {
                     $content .= '<div class="error">' . html_wikilink($id) . ': ' . $error . '</div>' . DOKU_LF;
                 }
             }
             $this->setContent($content . '</div>');
         }
     }
     $this->root->appendChild($this->content);
 }
/build/img/card.png"/><?php 
        }
        ?>
			</div>

		</header>
        <div class="membercardSmallContainer">
            <?php 
        get_template_part('parts/membercard-small');
        ?>
        </div>
		<div class="project__content"><?php 
        the_content();
        ?>
			<?php 
        download_button(get_the_ID());
        ?>
		</div>
		<?php 
        wp_link_pages();
        ?>
	<?php 
    }
} else {
    ?>

<?php 
    get_404_template();
    ?>

<?php