public function __construct(Engine_Package_Manifest_Entity_Package $package, $selected = false)
 {
     //$this->_package = $package;
     $this->_packageGuid = $package->getGuid();
     $this->_packageKey = $package->getKey();
     $this->_selected = (bool) $selected;
 }
예제 #2
0
 public function addToArchive(Archive_Tar $archive)
 {
     // Add top level package manifest
     $archive->addString('package.json', $this->toString('json'));
     // Normal stuff
     parent::addToArchive($archive);
 }
예제 #3
0
 public function addPackage($package, $options = null)
 {
     if (!$package instanceof Engine_Package_Manifest_Entity_Package) {
         if (!isset($options['basePath'])) {
             $options['basePath'] = $this->getBasePath();
         }
         $package = new Engine_Package_Manifest_Entity_Package($package, $options);
     } else {
         if (is_array($options)) {
             $package->setOptions($options);
         }
     }
     $package->setBasePath($this->getBasePath());
     $name = self::fix_path($package->getPath());
     if ($this->_jitInstantiation) {
         $this->_structure[$name] = $package->toArray();
     } else {
         $this->_structure[$name] = $package;
     }
     return $this;
 }
예제 #4
0
파일: Abstract.php 프로젝트: robeendey/ce
 protected function _getPackageFiles(Engine_Package_Manifest_Entity_Package $package = null)
 {
     if (null === $package) {
         return array();
     }
     $files = $package->getFileStructure(true);
     return $files;
 }
예제 #5
0
    public function packageSelect(Engine_Package_Manifest_Entity_Package $package)
    {
        $key = $package->getKey();
        $guid = $package->getGuid();
        $safeKey = str_replace('.', '-', $key);
        $safeGuid = str_replace('.', '-', $guid);
        $basename = basename($package->getBasePath());
        ob_start();
        ?>
      <li class="file file-success package_<?php 
        echo $safeGuid;
        ?>
 package_<?php 
        echo $safeKey;
        ?>
">
        <span class="file-name">
          <span class="file-select">
            <input type="checkbox" name="packages[]" id="<?php 
        echo $safeKey;
        ?>
" value="<?php 
        echo $package->getKey();
        ?>
" checked="checked"/>
          </span>
          <label for="<?php 
        echo $safeKey;
        ?>
">
            <?php 
        echo $package->getKey();
        ?>
          </label>
        </span>
        <span class="file-info">
          <span class="file-package-info">
            <span class="file-package-info-title">
              <?php 
        if (!$package->getMeta()->getTitle()) {
            ?>
                <?php 
            echo $guid;
            ?>
              <?php 
        } else {
            ?>
                <?php 
            echo $package->getMeta()->getTitle();
            ?>
              <?php 
        }
        ?>
              v<?php 
        echo $package->getVersion();
        ?>
            </span>
            <?php 
        if ($package->getMeta()->getAuthors()) {
            ?>
              <span class="file-package-info-author">
                by
                <?php 
            echo join(', ', $package->getMeta()->getAuthors());
            ?>
              </span>
            <?php 
        }
        ?>
          </span>
        </span>
        <span class="file-package-remove">
          <a href="javascript:void(0);" onclick="removePackage('<?php 
        echo $basename;
        ?>
');">
            remove
          </a>
        </span>
      </li>
    <?php 
        return ob_get_clean();
    }