Logo Search packages:      
Sourcecode: acidbase version File versions  Download package

Cpdf::addObject ( id,
options = 'add' 
)

after an object has been created, it wil only show if it has been added, using this function.

Definition at line 2544 of file class.pdf.php.

References $options, and o_page().

                                      {
  // add the specified object to the page
  if (isset($this->looseObjects[$id]) && $this->currentContents!=$id){
    // then it is a valid object, and it is not being added to itself
    switch($options){
      case 'all':
        // then this object is to be added to this page (done in the next block) and 
        // all future new pages. 
        $this->addLooseObjects[$id]='all';
      case 'add':
        if (isset($this->objects[$this->currentContents]['onPage'])){
          // then the destination contents is the primary for the page
          // (though this object is actually added to that page)
          $this->o_page($this->objects[$this->currentContents]['onPage'],'content',$id);
        }
        break;
      case 'even':
        $this->addLooseObjects[$id]='even';
        $pageObjectId=$this->objects[$this->currentContents]['onPage'];
        if ($this->objects[$pageObjectId]['info']['pageNum']%2==0){
          $this->addObject($id); // hacky huh :)
        }
        break;
      case 'odd':
        $this->addLooseObjects[$id]='odd';
        $pageObjectId=$this->objects[$this->currentContents]['onPage'];
        if ($this->objects[$pageObjectId]['info']['pageNum']%2==1){
          $this->addObject($id); // hacky huh :)
        }
        break;
      case 'next':
        $this->addLooseObjects[$id]='all';
        break;
      case 'nexteven':
        $this->addLooseObjects[$id]='even';
        break;
      case 'nextodd':
        $this->addLooseObjects[$id]='odd';
        break;
    }
  }
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index