Exemplo n.º 1
0
<?php

ModulaiseController::printComment("Print first HTML snippets");
ModulaiseController::printPane(PANE_HTML_FOOT_FIRST);
ModulaiseController::printComment("Import FOOT JavaScript");
ModulaiseController::printPane(PANE_JS_FOOT);
ModulaiseController::printComment("Print last HTML snippets");
ModulaiseController::printPane(PANE_HTML_FOOT_LAST);
?>
</body>
</html>
 /**
  * Initilizes the pane content for this module
  */
 private function initializePaneContent()
 {
     if (!$this->paneContent->initialize($this->moduleId)) {
         ModulaiseController::printComment("\n\nERROR:\nModule could not initialized " . $this->moduleId . "\n\n");
     }
 }
Exemplo n.º 3
0
<?php

ModulaiseController::printComment("Include the JavaScripts");
ModulaiseController::printComment("Include last HTML snippets");
?>


<?php 
ModulaiseController::printPane(PANE_HTML_FOOT_FIRST);
ModulaiseController::printPane(PANE_JS_FOOT);
ModulaiseController::printPane(PANE_HTML_FOOT_LAST);
?>

</body>
</html>
 /**
  * Checks if a pane has content, if it has true is returned
  */
 public function paneHasContent($paneId)
 {
     if (!isset($this->content[$paneId])) {
         return false;
     }
     $returnValue = false;
     $debug = false;
     if ($debug === true) {
         ModulaiseController::printComment("\n\n" . get_class() . "->printPane(): " . print_r($this->content[$paneId]) . "\n\n");
     }
     // now sort according to $priority keys
     ksort($this->content[$paneId]);
     if ($debug === true) {
         ModulaiseController::printComment("\n\n" . get_class() . "->printPane(): " . print_r($this->content[$paneId]) . "\n\n");
     }
     foreach ($this->content[$paneId] as $priorityId) {
         foreach ($priorityId as $snippet) {
             if (strlen(trim($snippet)) != 0) {
                 $returnValue = true;
             }
         }
     }
     return $returnValue;
 }
 /**
  * Get's a directory as an array
  */
 public static function getDirectoryAsArray($directory, $return = ALL_FILES)
 {
     $debug = false;
     if (is_dir($directory)) {
         // Initialize array
         $dirArray = array();
         // open this directory
         $handle = opendir($directory) or die("\n\nERROR! Can't open directory " . $directory . "\n\n");
         // get each entry
         while ($resource = readdir($handle)) {
             // discard hidden files and files starting with DELIMITER
             if (substr($resource, 0, 1) != "." && substr($resource, 0, 1) != DELIMITER) {
                 // Decide what files to include
                 switch ($return) {
                     case ALL_FILES:
                         $dirArray[] = $resource;
                         break;
                     case ONLY_FILES:
                         if (is_file($directory . DIRECTORY_SEPARATOR . $resource)) {
                             $dirArray[] = $resource;
                             if ($debug) {
                                 ModulaiseController::printComment("\n\n" . get_class() . ": ONLY_FILES is_file(" . $directory . DIRECTORY_SEPARATOR . $resource . ") =  " . is_file($directory . DIRECTORY_SEPARATOR . $resource) . "\n\n");
                             }
                         }
                         break;
                     case ONLY_DIRECTORIES:
                         if (is_dir($directory . DIRECTORY_SEPARATOR . $resource)) {
                             $dirArray[] = $resource;
                             if ($debug) {
                                 ModulaiseController::printComment("\n\n" . get_class() . ": ONLY_DIRECTORIES is_dir(" . $directory . DIRECTORY_SEPARATOR . $resource . ") =  " . is_dir($directory . DIRECTORY_SEPARATOR . $resource) . "\n\n");
                             }
                         }
                         break;
                 }
             }
         }
         // close directory
         closedir($handle);
         // sort 'em
         sort($dirArray);
         return $dirArray;
     } else {
         return array();
     }
 }