当前位置: 首页>>代码示例>>PHP>>正文


PHP Templates::delete方法代码示例

本文整理汇总了PHP中Templates::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Templates::delete方法的具体用法?PHP Templates::delete怎么用?PHP Templates::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Templates的用法示例。


在下文中一共展示了Templates::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deleteAction

 function deleteAction()
 {
     $id = $this->_request->getParam('id', 0);
     $templates = new Templates();
     if ($this->_request->isPost()) {
         $confirm = $this->_request->getPost('confirm');
         $return_to = $this->_request->getParam('return_to', 0);
         if (!strcmp($confirm, 'Confirm') && $id > 0) {
             $templates->delete('id=' . $id);
             // remove all the viewers using this template
             $viewer_class = new Viewers();
             $viewer_class->delete('template_id' . $id);
         } elseif (!strcmp($return_to, 'view')) {
             $this->_redirect('/template/view/id/' . $id);
             return;
         }
         $this->_redirect('/template/list');
     } elseif ($id > 0) {
         $this->view->title = 'Confirm Deletion';
         $templates = new Templates();
         $template = $templates->fetchRow('id=' . $id);
         $this->view->template_name = $template->name;
         $form = new TemplateDeleteForm();
         $in_return_to = $this->_request->getParam('return_to', 0);
         if ($in_return_to) {
             $return_to = new PP_Form_Element_Hidden('return_to');
             $return_to->setValue($in_return_to);
             $form->addElement($return_to);
         }
         $form->confirm->setLabel('Confirm');
         $form->cancel->setLabel('Cancel');
         $this->view->form = $form;
     }
 }
开发者ID:ngroesz,项目名称:Photoplate,代码行数:34,代码来源:TemplateController.php

示例2: elseif

    $url_description = $GPXIN['description'];
    echo $Templates->create($url_netid, $url_gameid, $url_file_path, $url_description, $url_default);
} elseif ($url_do == 'save') {
    // Get this game ID
    $result_gid = @mysql_query("SELECT cfgid FROM templates WHERE id = '{$url_id}'");
    $row_gid = mysql_fetch_row($result_gid);
    $this_gameid = $row_gid[0];
    // If default, make all others not default
    if ($url_default) {
        @mysql_query("UPDATE templates SET is_default = '0' WHERE cfgid = '{$this_gameid}' AND netid = '{$url_netid}'") or die('Failed to update template settings (1)');
    }
    // Update values
    @mysql_query("UPDATE templates SET is_default = '{$url_default}',description = '{$url_descr}' WHERE id = '{$url_id}'") or die('Failed to update template settings (2)');
    echo 'success';
} elseif ($url_do == 'delete') {
    echo $Templates->delete($url_id);
} elseif ($url_do == 'checkdone') {
    require DOCROOT . '/includes/classes/network.php';
    $Network = new Network();
    // Get list of unfinished templates
    $result_unf = @mysql_query("SELECT id,netid,steam_percent,status FROM templates WHERE status = 'running' OR status = 'steam_running' ORDER BY id ASC");
    $total_rows = mysql_num_rows($result_unf);
    if ($total_rows > 1) {
        $total_rows = $total_rows - 1;
    }
    // Change for array counting
    $cntr = 1;
    $netids = array();
    $orig_netid = '';
    $tpl_list = '';
    if ($total_rows) {
开发者ID:milecar91,项目名称:GamePanelX-V3,代码行数:31,代码来源:template_actions.php


注:本文中的Templates::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。