* Add ajaxprinttemplates function.

This commit is contained in:
wangyuting
2024-03-06 14:37:52 +08:00
parent 7622dfdd67
commit 5a45f4d024
3 changed files with 52 additions and 1 deletions
+30
View File
@@ -1158,4 +1158,34 @@ class user extends control
ob_end_clean();
echo (string)$rand;
}
/**
* Ajax print templates.
*
* @param string $type
* @param string $link
* @access public
* @return void
*/
public function ajaxPrintTemplates(string $type, string $link = '')
{
$this->view->link = $link;
$this->view->type = $type;
$this->view->templates = $this->user->getUserTemplates($type);
$this->display();
}
/**
* Save current template.
*
* @param string $type
* @access public
* @return string
*/
public function ajaxSaveOldTemplate(string $type)
{
$this->user->saveOldUserTemplate($type);
if(dao::isError()) echo js::error(dao::getError(), $full = false);
return print($this->fetch('user', 'ajaxPrintTemplates', "type=$type"));
}
}