~xibo-maintainers/xibo/brorsen

« back to all changes in this revision

Viewing changes to server/lib/data/layout.data.class.php

  • Committer: Dan Garner
  • Date: 2012-09-16 15:06:03 UTC
  • mfrom: (249.2.6 server-140rc1)
  • Revision ID: dan@xibo.org.uk-20120916150603-n8juk1anzq243fgz
MergedĀ lp:~dangarner/xibo/server-140rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
494
494
 
495
495
                // Update the permissions for the new media record
496
496
                $mediaSecurity->Copy($oldMediaId, $mediaId);
 
497
 
 
498
                // Copied the media node, so set the ID
 
499
                $mediaNode->setAttribute('id', $mediaId);
 
500
 
 
501
                // Also need to set the options node
 
502
                // Get the stored as value of the new node
 
503
                if (!$fileName = $this->db->GetSingleValue(sprintf("SELECT StoredAs FROM media WHERE MediaID = %d", $mediaId), 'StoredAs', _STRING))
 
504
                    return $this->SetError(25000, __('Unable to stored value of newly copied media'));
 
505
 
 
506
                $newNode = $this->DomXml->createElement('uri', $fileName);
 
507
 
 
508
                // Find the old node
 
509
                $uriNodes = $mediaNode->getElementsByTagName('uri');
 
510
                $uriNode = $uriNodes->item(0);
 
511
 
 
512
                // Replace it
 
513
                $uriNode->parentNode->replaceChild($newNode, $uriNode);
497
514
            }
498
515
 
499
516
            // Add the database link for this media record
509
526
 
510
527
            // Set this LKID on the media node
511
528
            $mediaNode->setAttribute('lkid', $lkId);
512
 
            $mediaNode->setAttribute('id', $mediaId);
513
529
        }
514
530
 
515
531
        Debug::LogEntry($this->db, 'audit', 'Finished looping through media nodes', 'layout', 'Copy');