3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2014
37 * Page for displaying Parent Information Section tabs
39 class CRM_Admin_Page_Persistent
extends CRM_Core_Page
{
42 * The action links that we need to display for the browse screen
47 private static $_stringActionLinks;
48 private static $_customizeActionLinks;
53 * @return array (reference) of action links
54 */ function &stringActionLinks() {
55 // check if variable _actionsLinks is populated
56 if (!isset(self
::$_stringActionLinks)) {
58 self
::$_stringActionLinks = array(
59 CRM_Core_Action
::UPDATE
=> array(
61 'url' => 'civicrm/admin/tplstrings/add',
62 'qs' => 'reset=1&action=update&id=%%id%%',
63 'title' => ts('Configure'),
67 return self
::$_stringActionLinks;
73 public function &customizeActionLinks() {
74 // check if variable _actionsLinks is populated
75 if (!isset(self
::$_customizeActionLinks)) {
77 self
::$_customizeActionLinks = array(
78 CRM_Core_Action
::UPDATE
=> array(
80 'url' => 'civicrm/admin/tplstrings/add',
81 'qs' => 'reset=1&action=update&id=%%id%%&config=1',
82 'title' => ts('Configure'),
86 return self
::$_customizeActionLinks;
90 * Run the basic page (run essentially starts execution for that page).
94 public function run() {
95 CRM_Utils_System
::setTitle(ts('DB Template Strings'));
107 public function browse() {
109 $this->assign('editClass', FALSE);
110 if (CRM_Core_Permission
::check('access CiviCRM')) {
111 $this->assign('editClass', TRUE);
115 $daoResult = new CRM_Core_DAO_Persistent();
117 $schoolValues = array();
118 while ($daoResult->fetch()) {
119 $values[$daoResult->id
] = array();
120 CRM_Core_DAO
::storeValues($daoResult, $values[$daoResult->id
]);
121 if ($daoResult->is_config
== 1) {
122 $values[$daoResult->id
]['action'] = CRM_Core_Action
::formLink(self
::customizeActionLinks(),
124 array('id' => $daoResult->id
),
127 'persistent.config.actions',
131 $values[$daoResult->id
]['data'] = implode(',', unserialize($daoResult->data
));
132 $configCustomization[$daoResult->id
] = $values[$daoResult->id
];
134 if ($daoResult->is_config
== 0) {
135 $values[$daoResult->id
]['action'] = CRM_Core_Action
::formLink(self
::stringActionLinks(),
137 array('id' => $daoResult->id
),
140 'persistent.row.actions',
144 $configStrings[$daoResult->id
] = $values[$daoResult->id
];
148 'configTemplates' => $configStrings,
149 'customizeTemplates' => $configCustomization,
151 $this->assign('rows', $rows);