本文整理匯總了PHP中content::getTemplate方法的典型用法代碼示例。如果您正苦於以下問題:PHP content::getTemplate方法的具體用法?PHP content::getTemplate怎麽用?PHP content::getTemplate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類content
的用法示例。
在下文中一共展示了content::getTemplate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: content
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require_once '../../admin-includes/admin.base.inc.php';
require_once '../../admin-includes/admin.security_ajax.inc.php';
$content = new content();
// TO DO - security later - e.g. is this user allowed
$userID = $_SESSION['userID'];
if (isset($_POST['action'])) {
////////////////////////////////////////////////////
// getTemplate Get template from the content BY ID
////////////////////////////////////////////////////
if ($_POST['action'] == 'getTemplate') {
if (isset($_POST['nodeID']) && is_int((int) $_POST['nodeID']) && isset($_POST['languageID']) && is_int((int) $_POST['languageID'])) {
$foundRecord = $content->getTemplate((int) $_POST['nodeID'], (int) $_POST['languageID']);
if ($foundRecord !== true) {
echo json_encode(array('result' => false, 'msg' => 'No template available in the database'));
exit;
} else {
echo json_encode(array('result' => $foundRecord, 'msg' => 'Template found!', 'results' => $content->template, 'sectionInstances' => $content->sectionInstances, 'tabs' => $content->tabs, 'sections' => $content->sections));
exit;
}
} else {
echo json_encode(array('result' => false, 'msg' => 'AJAX Validation failed'));
exit;
}
}
////////////////////////////////////////////////////
// loadContent Content BY ID
////////////////////////////////////////////////////