mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
issue 2601 copy without a title.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11794 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
fef43c6edf
commit
5457426c7d
1 changed files with 21 additions and 3 deletions
|
|
@ -648,14 +648,19 @@
|
|||
return $this->stop('msg_empty_origin_layout');
|
||||
}
|
||||
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout = $oLayoutModel->getLayout($sourceArgs->layout_srl);
|
||||
|
||||
if(!$sourceArgs->title)
|
||||
{
|
||||
$sourceArgs->title = array($layout->title.'_'.$this->_makeRandomMid());
|
||||
}
|
||||
|
||||
if(!is_array($sourceArgs->title) || count($sourceArgs->title) == 0)
|
||||
{
|
||||
return $this->stop('msg_empty_target_layout');
|
||||
}
|
||||
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout = $oLayoutModel->getLayout($sourceArgs->layout_srl);
|
||||
|
||||
$output = $oLayoutModel->getLayoutRawData($sourceArgs->layout_srl, array('extra_vars'));
|
||||
$args->extra_vars = $output->extra_vars;
|
||||
$extra_vars = unserialize($args->extra_vars);
|
||||
|
|
@ -724,6 +729,19 @@
|
|||
}
|
||||
}
|
||||
|
||||
private function _makeRandomMid()
|
||||
{
|
||||
$time = time();
|
||||
$randomString = "";
|
||||
for($i=0;$i<4;$i++)
|
||||
{
|
||||
$doc = rand()%26+65;
|
||||
$randomString .= chr($doc);
|
||||
}
|
||||
|
||||
return $randomString.substr($time, -4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Layout file copy
|
||||
* @param $sourceLayoutSrl origin layout number
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue