@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | $updateMsg = ''; |
| 12 | 12 | |
| 13 | 13 | if (isset($_POST['listSubmitted'])) { |
| 14 | - $updateMsg .= '<span class="text-success" id="updated">' . $_lang['sort_updated'] . '</span>'; |
|
| 14 | + $updateMsg .= '<span class="text-success" id="updated">'.$_lang['sort_updated'].'</span>'; |
|
| 15 | 15 | $tbl = $modx->getFullTableName('site_plugin_events'); |
| 16 | 16 | |
| 17 | 17 | foreach ($_POST as $listName => $listValue) { |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | $modx->clearCache('full'); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | -$rs = $modx->db->select("sysevt.name as evtname, sysevt.id as evtid, pe.pluginid, plugs.name, pe.priority, plugs.disabled", $modx->getFullTableName('system_eventnames') . " sysevt |
|
| 38 | - INNER JOIN " . $modx->getFullTableName('site_plugin_events') . " pe ON pe.evtid = sysevt.id |
|
| 39 | - INNER JOIN " . $modx->getFullTableName('site_plugins') . " plugs ON plugs.id = pe.pluginid", '', 'sysevt.name,pe.priority'); |
|
| 37 | +$rs = $modx->db->select("sysevt.name as evtname, sysevt.id as evtid, pe.pluginid, plugs.name, pe.priority, plugs.disabled", $modx->getFullTableName('system_eventnames')." sysevt |
|
| 38 | + INNER JOIN " . $modx->getFullTableName('site_plugin_events')." pe ON pe.evtid = sysevt.id |
|
| 39 | + INNER JOIN " . $modx->getFullTableName('site_plugins')." plugs ON plugs.id = pe.pluginid", '', 'sysevt.name,pe.priority'); |
|
| 40 | 40 | |
| 41 | 41 | $insideUl = 0; |
| 42 | 42 | $preEvt = ''; |
@@ -47,17 +47,17 @@ discard block |
||
| 47 | 47 | if ($preEvt !== $plugins['evtid']) { |
| 48 | 48 | $sortables[] = $plugins['evtid']; |
| 49 | 49 | $sortableList .= $insideUl ? '</ul></div>' : ''; |
| 50 | - $sortableList .= '<div class="form-group clearfix"><strong>' . $plugins['evtname'] . '</strong><ul id="' . $plugins['evtid'] . '" class="sortableList">'; |
|
| 50 | + $sortableList .= '<div class="form-group clearfix"><strong>'.$plugins['evtname'].'</strong><ul id="'.$plugins['evtid'].'" class="sortableList">'; |
|
| 51 | 51 | $insideUl = 1; |
| 52 | 52 | } |
| 53 | - $sortableList .= '<li id="item_' . $plugins['pluginid'] . '"' . ($plugins['disabled'] ? ' class="disabledPlugin"' : '') . '><i class="fa fa-plug"></i> ' . $plugins['name'] . ($plugins['disabled'] ? ' (hide)' : '') . '</li>'; |
|
| 53 | + $sortableList .= '<li id="item_'.$plugins['pluginid'].'"'.($plugins['disabled'] ? ' class="disabledPlugin"' : '').'><i class="fa fa-plug"></i> '.$plugins['name'].($plugins['disabled'] ? ' (hide)' : '').'</li>'; |
|
| 54 | 54 | $preEvt = $plugins['evtid']; |
| 55 | 55 | } |
| 56 | 56 | if ($insideUl) { |
| 57 | 57 | $sortableList .= '</ul></div>'; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | -require_once(MODX_MANAGER_PATH . 'includes/header.inc.php'); |
|
| 60 | +require_once(MODX_MANAGER_PATH.'includes/header.inc.php'); |
|
| 61 | 61 | ?> |
| 62 | 62 | |
| 63 | 63 | <script type="text/javascript"> |
@@ -2,13 +2,13 @@ discard block |
||
| 2 | 2 | /** |
| 3 | 3 | * Class for MODx Categories Manager |
| 4 | 4 | */ |
| 5 | -if( !is_object( $modx ) |
|
| 6 | - || $modx->isBackend() === false ) |
|
| 5 | +if (!is_object($modx) |
|
| 6 | + || $modx->isBackend() === false) |
|
| 7 | 7 | { |
| 8 | 8 | die('Please use the MODx Backend.'); |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | -require_once realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'Categories.php'; |
|
| 11 | +require_once realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'Categories.php'; |
|
| 12 | 12 | |
| 13 | 13 | class Module_Categories_Manager extends Categories |
| 14 | 14 | { |
@@ -37,19 +37,19 @@ discard block |
||
| 37 | 37 | * @return mixed return the parameter value if exists, otherwise false |
| 38 | 38 | * @param string $key Paramter-key |
| 39 | 39 | */ |
| 40 | - function get( $key ) |
|
| 40 | + function get($key) |
|
| 41 | 41 | { |
| 42 | 42 | global $modx; |
| 43 | 43 | |
| 44 | - if( isset( $this->params[$key] ) ) |
|
| 44 | + if (isset($this->params[$key])) |
|
| 45 | 45 | { |
| 46 | 46 | return $this->params[$key]; |
| 47 | 47 | } |
| 48 | - elseif( isset( $modx->config[$key] ) ) |
|
| 48 | + elseif (isset($modx->config[$key])) |
|
| 49 | 49 | { |
| 50 | 50 | return $modx->config[$key]; |
| 51 | 51 | } |
| 52 | - elseif( isset( $modx->event->params[$key] ) ) |
|
| 52 | + elseif (isset($modx->event->params[$key])) |
|
| 53 | 53 | { |
| 54 | 54 | return $modx->event->params[$key]; |
| 55 | 55 | } |
@@ -57,15 +57,15 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
| 60 | - function addMessage( $message, $namespace = 'default' ) |
|
| 60 | + function addMessage($message, $namespace = 'default') |
|
| 61 | 61 | { |
| 62 | 62 | $this->params['messages'][$namespace][] = $message; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
| 66 | - function getMessages( $namespace = 'default' ) |
|
| 66 | + function getMessages($namespace = 'default') |
|
| 67 | 67 | { |
| 68 | - if( isset( $this->params['messages'][$namespace] ) ) |
|
| 68 | + if (isset($this->params['messages'][$namespace])) |
|
| 69 | 69 | { |
| 70 | 70 | return $this->params['messages'][$namespace]; |
| 71 | 71 | } |
@@ -73,16 +73,16 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
| 76 | - function renderView( $view_name, $data = array() ) |
|
| 76 | + function renderView($view_name, $data = array()) |
|
| 77 | 77 | { |
| 78 | 78 | global $_lang, $_style; |
| 79 | 79 | |
| 80 | - $filename = trim( $view_name ) . '.tpl.phtml'; |
|
| 81 | - $file = self::get('views_dir') . $filename; |
|
| 80 | + $filename = trim($view_name).'.tpl.phtml'; |
|
| 81 | + $file = self::get('views_dir').$filename; |
|
| 82 | 82 | $view = & $this; |
| 83 | 83 | |
| 84 | - if( is_file( $file ) |
|
| 85 | - && is_readable( $file ) ) |
|
| 84 | + if (is_file($file) |
|
| 85 | + && is_readable($file)) |
|
| 86 | 86 | { |
| 87 | 87 | include $file; |
| 88 | 88 | } |
@@ -96,21 +96,21 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - function updateElement( $element, $element_id, $category_id ) |
|
| 99 | + function updateElement($element, $element_id, $category_id) |
|
| 100 | 100 | { |
| 101 | 101 | |
| 102 | 102 | $_update = array( |
| 103 | - 'id' => (int)$element_id, |
|
| 104 | - 'category' => (int)$category_id |
|
| 103 | + 'id' => (int) $element_id, |
|
| 104 | + 'category' => (int) $category_id |
|
| 105 | 105 | ); |
| 106 | 106 | |
| 107 | 107 | $this->db->update( |
| 108 | 108 | $_update, |
| 109 | 109 | $this->db_tbl[$element], |
| 110 | - "`id` = '" . (int)$element_id . "'" |
|
| 110 | + "`id` = '".(int) $element_id."'" |
|
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | - if( $this->db->getAffectedRows() === 1 ) |
|
| 113 | + if ($this->db->getAffectedRows() === 1) |
|
| 114 | 114 | { |
| 115 | 115 | return true; |
| 116 | 116 | } |
@@ -118,10 +118,10 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
| 121 | - function txt( $txt ) |
|
| 121 | + function txt($txt) |
|
| 122 | 122 | { |
| 123 | 123 | global $_lang; |
| 124 | - if(isset($_lang[$txt])) return $_lang[$txt]; |
|
| 124 | + if (isset($_lang[$txt])) return $_lang[$txt]; |
|
| 125 | 125 | return $txt; |
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | \ No newline at end of file |
@@ -3,8 +3,7 @@ discard block |
||
| 3 | 3 | * Class for MODx Categories Manager |
| 4 | 4 | */ |
| 5 | 5 | if( !is_object( $modx ) |
| 6 | - || $modx->isBackend() === false ) |
|
| 7 | -{ |
|
| 6 | + || $modx->isBackend() === false ) { |
|
| 8 | 7 | die('Please use the MODx Backend.'); |
| 9 | 8 | } |
| 10 | 9 | |
@@ -41,16 +40,11 @@ discard block |
||
| 41 | 40 | { |
| 42 | 41 | global $modx; |
| 43 | 42 | |
| 44 | - if( isset( $this->params[$key] ) ) |
|
| 45 | - { |
|
| 43 | + if( isset( $this->params[$key] ) ) { |
|
| 46 | 44 | return $this->params[$key]; |
| 47 | - } |
|
| 48 | - elseif( isset( $modx->config[$key] ) ) |
|
| 49 | - { |
|
| 45 | + } elseif( isset( $modx->config[$key] ) ) { |
|
| 50 | 46 | return $modx->config[$key]; |
| 51 | - } |
|
| 52 | - elseif( isset( $modx->event->params[$key] ) ) |
|
| 53 | - { |
|
| 47 | + } elseif( isset( $modx->event->params[$key] ) ) { |
|
| 54 | 48 | return $modx->event->params[$key]; |
| 55 | 49 | } |
| 56 | 50 | return false; |
@@ -65,8 +59,7 @@ discard block |
||
| 65 | 59 | |
| 66 | 60 | function getMessages( $namespace = 'default' ) |
| 67 | 61 | { |
| 68 | - if( isset( $this->params['messages'][$namespace] ) ) |
|
| 69 | - { |
|
| 62 | + if( isset( $this->params['messages'][$namespace] ) ) { |
|
| 70 | 63 | return $this->params['messages'][$namespace]; |
| 71 | 64 | } |
| 72 | 65 | return false; |
@@ -82,12 +75,9 @@ discard block |
||
| 82 | 75 | $view = & $this; |
| 83 | 76 | |
| 84 | 77 | if( is_file( $file ) |
| 85 | - && is_readable( $file ) ) |
|
| 86 | - { |
|
| 78 | + && is_readable( $file ) ) { |
|
| 87 | 79 | include $file; |
| 88 | - } |
|
| 89 | - else |
|
| 90 | - { |
|
| 80 | + } else { |
|
| 91 | 81 | echo sprintf( |
| 92 | 82 | 'View "%s<strong>%s</strong>" not found.', |
| 93 | 83 | self::get('views_dir'), |
@@ -110,8 +100,7 @@ discard block |
||
| 110 | 100 | "`id` = '" . (int)$element_id . "'" |
| 111 | 101 | ); |
| 112 | 102 | |
| 113 | - if( $this->db->getAffectedRows() === 1 ) |
|
| 114 | - { |
|
| 103 | + if( $this->db->getAffectedRows() === 1 ) { |
|
| 115 | 104 | return true; |
| 116 | 105 | } |
| 117 | 106 | return false; |
@@ -121,7 +110,9 @@ discard block |
||
| 121 | 110 | function txt( $txt ) |
| 122 | 111 | { |
| 123 | 112 | global $_lang; |
| 124 | - if(isset($_lang[$txt])) return $_lang[$txt]; |
|
| 113 | + if(isset($_lang[$txt])) { |
|
| 114 | + return $_lang[$txt]; |
|
| 115 | + } |
|
| 125 | 116 | return $txt; |
| 126 | 117 | } |
| 127 | 118 | } |
| 128 | 119 | \ No newline at end of file |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | { |
| 7 | 7 | var $db = ''; |
| 8 | 8 | var $db_tbl = array(); |
| 9 | - var $elements = array( 'templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules' ); |
|
| 9 | + var $elements = array('templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules'); |
|
| 10 | 10 | |
| 11 | 11 | function __construct() |
| 12 | 12 | { |
@@ -15,9 +15,9 @@ discard block |
||
| 15 | 15 | $this->db = & $modx->db; |
| 16 | 16 | $this->db_tbl['categories'] = $modx->getFullTableName('categories'); |
| 17 | 17 | |
| 18 | - foreach( $this->elements as $element ) |
|
| 18 | + foreach ($this->elements as $element) |
|
| 19 | 19 | { |
| 20 | - $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element ); |
|
| 20 | + $this->db_tbl[$element] = $modx->getFullTableName('site_'.$element); |
|
| 21 | 21 | } |
| 22 | 22 | } |
| 23 | 23 | |
@@ -37,44 +37,44 @@ discard block |
||
| 37 | 37 | ) |
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | - if( !empty( $categories ) ) |
|
| 40 | + if (!empty($categories)) |
|
| 41 | 41 | { |
| 42 | 42 | return $categories; |
| 43 | 43 | } |
| 44 | 44 | return false; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - function getCategory( $search, $where = 'category' ) |
|
| 47 | + function getCategory($search, $where = 'category') |
|
| 48 | 48 | { |
| 49 | 49 | $category = $this->db->getRow( |
| 50 | 50 | $this->db->select( |
| 51 | 51 | '*', |
| 52 | 52 | $this->db_tbl['categories'], |
| 53 | - "`" . $where . "` = '" . $search . "'" |
|
| 53 | + "`".$where."` = '".$search."'" |
|
| 54 | 54 | ) |
| 55 | 55 | ); |
| 56 | 56 | return $category; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - function getCategoryValue( $value, $search, $where = 'category' ) |
|
| 59 | + function getCategoryValue($value, $search, $where = 'category') |
|
| 60 | 60 | { |
| 61 | 61 | $_value = $this->db->getValue( |
| 62 | 62 | $this->db->select( |
| 63 | - '`' . $value . '`', |
|
| 63 | + '`'.$value.'`', |
|
| 64 | 64 | $this->db_tbl['categories'], |
| 65 | - "`" . $where . "` = '" . $search . "'" |
|
| 65 | + "`".$where."` = '".$search."'" |
|
| 66 | 66 | ) |
| 67 | 67 | ); |
| 68 | 68 | return $_value; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - function getAssignedElements( $category_id, $element ) |
|
| 71 | + function getAssignedElements($category_id, $element) |
|
| 72 | 72 | { |
| 73 | - if( in_array( $element, $this->elements, true ) ) |
|
| 73 | + if (in_array($element, $this->elements, true)) |
|
| 74 | 74 | { |
| 75 | 75 | |
| 76 | 76 | $fields = '`name`,`description`'; |
| 77 | - if( $element === 'templates' ) |
|
| 77 | + if ($element === 'templates') |
|
| 78 | 78 | { |
| 79 | 79 | $fields = '`templatename`,`description`'; |
| 80 | 80 | } |
@@ -85,15 +85,15 @@ discard block |
||
| 85 | 85 | $this->db->select( |
| 86 | 86 | $fields, |
| 87 | 87 | $this->db_tbl[$element], |
| 88 | - "`category` = '" . $category_id . "'" |
|
| 88 | + "`category` = '".$category_id."'" |
|
| 89 | 89 | ) |
| 90 | 90 | ); |
| 91 | 91 | |
| 92 | 92 | // correct the name of templates |
| 93 | - if( $element === 'templates' ) |
|
| 93 | + if ($element === 'templates') |
|
| 94 | 94 | { |
| 95 | 95 | $_elements_count = count($elements); |
| 96 | - for( $i=0; $i < $_elements_count; $i++ ) |
|
| 96 | + for ($i = 0; $i < $_elements_count; $i++) |
|
| 97 | 97 | { |
| 98 | 98 | $elements[$i]['name'] = $elements[$i]['templatename']; |
| 99 | 99 | } |
@@ -103,60 +103,60 @@ discard block |
||
| 103 | 103 | return false; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - function getAllAssignedElements( $category_id ) |
|
| 106 | + function getAllAssignedElements($category_id) |
|
| 107 | 107 | { |
| 108 | 108 | $elements = array(); |
| 109 | - foreach( $this->elements as $element ) |
|
| 109 | + foreach ($this->elements as $element) |
|
| 110 | 110 | { |
| 111 | - $elements[$element] = $this->getAssignedElements( $category_id, $element ); |
|
| 111 | + $elements[$element] = $this->getAssignedElements($category_id, $element); |
|
| 112 | 112 | } |
| 113 | 113 | return $elements; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - function deleteCategory( $category_id ) |
|
| 116 | + function deleteCategory($category_id) |
|
| 117 | 117 | { |
| 118 | 118 | $_update = array('category' => 0); |
| 119 | - foreach( $this->elements as $element ) |
|
| 119 | + foreach ($this->elements as $element) |
|
| 120 | 120 | { |
| 121 | 121 | $this->db->update( |
| 122 | 122 | $_update, |
| 123 | 123 | $this->db_tbl[$element], |
| 124 | - "`category` = '" . $category_id . "'" |
|
| 124 | + "`category` = '".$category_id."'" |
|
| 125 | 125 | ); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | $this->db->delete( |
| 129 | 129 | $this->db_tbl['categories'], |
| 130 | - "`id` = '" . $category_id . "'" |
|
| 130 | + "`id` = '".$category_id."'" |
|
| 131 | 131 | ); |
| 132 | 132 | |
| 133 | - if( $this->db->getAffectedRows() === 1 ) |
|
| 133 | + if ($this->db->getAffectedRows() === 1) |
|
| 134 | 134 | { |
| 135 | 135 | return true; |
| 136 | 136 | } |
| 137 | 137 | return false; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - function updateCategory( $category_id, $data = array() ) |
|
| 140 | + function updateCategory($category_id, $data = array()) |
|
| 141 | 141 | { |
| 142 | - if( empty( $data ) |
|
| 143 | - || empty( $category_id ) ) |
|
| 142 | + if (empty($data) |
|
| 143 | + || empty($category_id)) |
|
| 144 | 144 | { |
| 145 | 145 | return false; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | $_update = array( |
| 149 | - 'category' => $this->db->escape( $data['category'] ), |
|
| 150 | - 'rank' => (int)$data['rank'] |
|
| 149 | + 'category' => $this->db->escape($data['category']), |
|
| 150 | + 'rank' => (int) $data['rank'] |
|
| 151 | 151 | ); |
| 152 | 152 | |
| 153 | 153 | $this->db->update( |
| 154 | 154 | $_update, |
| 155 | 155 | $this->db_tbl['categories'], |
| 156 | - "`id` = '" . (int)$category_id . "'" |
|
| 156 | + "`id` = '".(int) $category_id."'" |
|
| 157 | 157 | ); |
| 158 | 158 | |
| 159 | - if( $this->db->getAffectedRows() === 1 ) |
|
| 159 | + if ($this->db->getAffectedRows() === 1) |
|
| 160 | 160 | { |
| 161 | 161 | return true; |
| 162 | 162 | } |
@@ -164,16 +164,16 @@ discard block |
||
| 164 | 164 | return false; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - function addCategory( $category_name, $category_rank ) |
|
| 167 | + function addCategory($category_name, $category_rank) |
|
| 168 | 168 | { |
| 169 | - if( $this->isCategoryExists( $category_name ) ) |
|
| 169 | + if ($this->isCategoryExists($category_name)) |
|
| 170 | 170 | { |
| 171 | 171 | return false; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | $_insert = array( |
| 175 | - 'category' => $this->db->escape( $category_name ), |
|
| 176 | - 'rank' => (int)$category_rank |
|
| 175 | + 'category' => $this->db->escape($category_name), |
|
| 176 | + 'rank' => (int) $category_rank |
|
| 177 | 177 | ); |
| 178 | 178 | |
| 179 | 179 | $this->db->insert( |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $this->db_tbl['categories'] |
| 182 | 182 | ); |
| 183 | 183 | |
| 184 | - if( $this->db->getAffectedRows() === 1 ) |
|
| 184 | + if ($this->db->getAffectedRows() === 1) |
|
| 185 | 185 | { |
| 186 | 186 | return $this->db->getInsertId(); |
| 187 | 187 | } |
@@ -190,19 +190,19 @@ discard block |
||
| 190 | 190 | return false; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - function isCategoryExists( $category_name ) |
|
| 193 | + function isCategoryExists($category_name) |
|
| 194 | 194 | { |
| 195 | - $category = $this->db->escape( $category_name ); |
|
| 195 | + $category = $this->db->escape($category_name); |
|
| 196 | 196 | |
| 197 | 197 | $category_id = $this->db->getValue( |
| 198 | 198 | $this->db->select( |
| 199 | 199 | '`id`', |
| 200 | 200 | $this->db_tbl['categories'], |
| 201 | - "`category` = '" . $category . "'" |
|
| 201 | + "`category` = '".$category."'" |
|
| 202 | 202 | ) |
| 203 | 203 | ); |
| 204 | 204 | |
| 205 | - if( $this->db->getAffectedRows() === 1 ) |
|
| 205 | + if ($this->db->getAffectedRows() === 1) |
|
| 206 | 206 | { |
| 207 | 207 | return $category_id; |
| 208 | 208 | } |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | $this->db = & $modx->db; |
| 16 | 16 | $this->db_tbl['categories'] = $modx->getFullTableName('categories'); |
| 17 | 17 | |
| 18 | - foreach( $this->elements as $element ) |
|
| 19 | - { |
|
| 18 | + foreach( $this->elements as $element ) { |
|
| 20 | 19 | $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element ); |
| 21 | 20 | } |
| 22 | 21 | } |
@@ -37,8 +36,7 @@ discard block |
||
| 37 | 36 | ) |
| 38 | 37 | ); |
| 39 | 38 | |
| 40 | - if( !empty( $categories ) ) |
|
| 41 | - { |
|
| 39 | + if( !empty( $categories ) ) { |
|
| 42 | 40 | return $categories; |
| 43 | 41 | } |
| 44 | 42 | return false; |
@@ -70,12 +68,10 @@ discard block |
||
| 70 | 68 | |
| 71 | 69 | function getAssignedElements( $category_id, $element ) |
| 72 | 70 | { |
| 73 | - if( in_array( $element, $this->elements, true ) ) |
|
| 74 | - { |
|
| 71 | + if( in_array( $element, $this->elements, true ) ) { |
|
| 75 | 72 | |
| 76 | 73 | $fields = '`name`,`description`'; |
| 77 | - if( $element === 'templates' ) |
|
| 78 | - { |
|
| 74 | + if( $element === 'templates' ) { |
|
| 79 | 75 | $fields = '`templatename`,`description`'; |
| 80 | 76 | } |
| 81 | 77 | |
@@ -90,11 +86,9 @@ discard block |
||
| 90 | 86 | ); |
| 91 | 87 | |
| 92 | 88 | // correct the name of templates |
| 93 | - if( $element === 'templates' ) |
|
| 94 | - { |
|
| 89 | + if( $element === 'templates' ) { |
|
| 95 | 90 | $_elements_count = count($elements); |
| 96 | - for( $i=0; $i < $_elements_count; $i++ ) |
|
| 97 | - { |
|
| 91 | + for( $i=0; $i < $_elements_count; $i++ ) { |
|
| 98 | 92 | $elements[$i]['name'] = $elements[$i]['templatename']; |
| 99 | 93 | } |
| 100 | 94 | } |
@@ -106,8 +100,7 @@ discard block |
||
| 106 | 100 | function getAllAssignedElements( $category_id ) |
| 107 | 101 | { |
| 108 | 102 | $elements = array(); |
| 109 | - foreach( $this->elements as $element ) |
|
| 110 | - { |
|
| 103 | + foreach( $this->elements as $element ) { |
|
| 111 | 104 | $elements[$element] = $this->getAssignedElements( $category_id, $element ); |
| 112 | 105 | } |
| 113 | 106 | return $elements; |
@@ -116,8 +109,7 @@ discard block |
||
| 116 | 109 | function deleteCategory( $category_id ) |
| 117 | 110 | { |
| 118 | 111 | $_update = array('category' => 0); |
| 119 | - foreach( $this->elements as $element ) |
|
| 120 | - { |
|
| 112 | + foreach( $this->elements as $element ) { |
|
| 121 | 113 | $this->db->update( |
| 122 | 114 | $_update, |
| 123 | 115 | $this->db_tbl[$element], |
@@ -130,8 +122,7 @@ discard block |
||
| 130 | 122 | "`id` = '" . $category_id . "'" |
| 131 | 123 | ); |
| 132 | 124 | |
| 133 | - if( $this->db->getAffectedRows() === 1 ) |
|
| 134 | - { |
|
| 125 | + if( $this->db->getAffectedRows() === 1 ) { |
|
| 135 | 126 | return true; |
| 136 | 127 | } |
| 137 | 128 | return false; |
@@ -140,8 +131,7 @@ discard block |
||
| 140 | 131 | function updateCategory( $category_id, $data = array() ) |
| 141 | 132 | { |
| 142 | 133 | if( empty( $data ) |
| 143 | - || empty( $category_id ) ) |
|
| 144 | - { |
|
| 134 | + || empty( $category_id ) ) { |
|
| 145 | 135 | return false; |
| 146 | 136 | } |
| 147 | 137 | |
@@ -156,8 +146,7 @@ discard block |
||
| 156 | 146 | "`id` = '" . (int)$category_id . "'" |
| 157 | 147 | ); |
| 158 | 148 | |
| 159 | - if( $this->db->getAffectedRows() === 1 ) |
|
| 160 | - { |
|
| 149 | + if( $this->db->getAffectedRows() === 1 ) { |
|
| 161 | 150 | return true; |
| 162 | 151 | } |
| 163 | 152 | |
@@ -166,8 +155,7 @@ discard block |
||
| 166 | 155 | |
| 167 | 156 | function addCategory( $category_name, $category_rank ) |
| 168 | 157 | { |
| 169 | - if( $this->isCategoryExists( $category_name ) ) |
|
| 170 | - { |
|
| 158 | + if( $this->isCategoryExists( $category_name ) ) { |
|
| 171 | 159 | return false; |
| 172 | 160 | } |
| 173 | 161 | |
@@ -181,8 +169,7 @@ discard block |
||
| 181 | 169 | $this->db_tbl['categories'] |
| 182 | 170 | ); |
| 183 | 171 | |
| 184 | - if( $this->db->getAffectedRows() === 1 ) |
|
| 185 | - { |
|
| 172 | + if( $this->db->getAffectedRows() === 1 ) { |
|
| 186 | 173 | return $this->db->getInsertId(); |
| 187 | 174 | } |
| 188 | 175 | |
@@ -202,8 +189,7 @@ discard block |
||
| 202 | 189 | ) |
| 203 | 190 | ); |
| 204 | 191 | |
| 205 | - if( $this->db->getAffectedRows() === 1 ) |
|
| 206 | - { |
|
| 192 | + if( $this->db->getAffectedRows() === 1 ) { |
|
| 207 | 193 | return $category_id; |
| 208 | 194 | } |
| 209 | 195 | return false; |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) |
| 23 | 23 | { |
| 24 | - $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); |
|
| 24 | + $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | foreach( $cm->getCategories() as $category ) |
@@ -106,14 +106,14 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | if( empty( $category ) ) |
| 108 | 108 | { |
| 109 | - $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); |
|
| 110 | - return; |
|
| 109 | + $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); |
|
| 110 | + return; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | if( $cm->isCategoryExists( $category ) ) |
| 114 | 114 | { |
| 115 | - $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); |
|
| 116 | - return; |
|
| 115 | + $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); |
|
| 116 | + return; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | if( $cm->addCategory( $category, $rank ) !== 0 ) |
@@ -287,8 +287,8 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | if( empty( $cm->new_translations ) ) |
| 289 | 289 | { |
| 290 | - //$_REQUEST['webfxtab_manage-categories-pane'] = 0; |
|
| 291 | - // unset( $_COOKIE['webfxtab_manage-categories-pane'] ); |
|
| 292 | - // setcookie('webfxtab_manage-categories-pane', 0); |
|
| 290 | + //$_REQUEST['webfxtab_manage-categories-pane'] = 0; |
|
| 291 | + // unset( $_COOKIE['webfxtab_manage-categories-pane'] ); |
|
| 292 | + // setcookie('webfxtab_manage-categories-pane', 0); |
|
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | \ No newline at end of file |
@@ -2,16 +2,16 @@ discard block |
||
| 2 | 2 | /** |
| 3 | 3 | * Ajax Requests |
| 4 | 4 | */ |
| 5 | -if(IN_MANAGER_MODE != "true") { |
|
| 5 | +if (IN_MANAGER_MODE != "true") { |
|
| 6 | 6 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) |
|
| 9 | +if (isset($_REQUEST[$cm->get('request_key')]['ajax'])) |
|
| 10 | 10 | { |
| 11 | 11 | $_data = $_REQUEST[$cm->get('request_key')]; |
| 12 | 12 | $output = ''; |
| 13 | 13 | $task = $_data['task']; |
| 14 | - switch( $task ) |
|
| 14 | + switch ($task) |
|
| 15 | 15 | { |
| 16 | 16 | /** |
| 17 | 17 | * get categories |
@@ -19,19 +19,19 @@ discard block |
||
| 19 | 19 | case 'categorize_load_elements': |
| 20 | 20 | $elements = $_data['elements']; |
| 21 | 21 | |
| 22 | - if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) |
|
| 22 | + if ($uncategorized_elements = $cm->getAssignedElements(0, $_data['elements'])) |
|
| 23 | 23 | { |
| 24 | 24 | $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - foreach( $cm->getCategories() as $category ) |
|
| 27 | + foreach ($cm->getCategories() as $category) |
|
| 28 | 28 | { |
| 29 | - $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] ); |
|
| 29 | + $category['elements'] = $cm->getAssignedElements($category['id'], $_data['elements']); |
|
| 30 | 30 | $output .= $cm->renderView('chunks/categorize/category', $category); |
| 31 | 31 | } |
| 32 | 32 | break; |
| 33 | 33 | } |
| 34 | - exit( $output ); |
|
| 34 | + exit($output); |
|
| 35 | 35 | } |
| 36 | 36 | /** |
| 37 | 37 | * Categorize elements |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476 |
| 42 | 42 | * |
| 43 | 43 | */ |
| 44 | -if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) |
|
| 44 | +if (isset($_POST[$cm->get('request_key')]['categorize']['submit'])) |
|
| 45 | 45 | { |
| 46 | 46 | $_data = $_POST[$cm->get('request_key')]['categorize']; |
| 47 | 47 | $_changes = 0; |
@@ -54,15 +54,15 @@ discard block |
||
| 54 | 54 | 'categorize' |
| 55 | 55 | ); |
| 56 | 56 | |
| 57 | - if( !isset( $_data['elements'] ) ) |
|
| 57 | + if (!isset($_data['elements'])) |
|
| 58 | 58 | { |
| 59 | - $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' ); |
|
| 59 | + $cm->addMessage($cm->txt('cm_unknown_error'), 'categorize'); |
|
| 60 | 60 | return; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - foreach( $_data['elements'] as $element_id => $data ) |
|
| 63 | + foreach ($_data['elements'] as $element_id => $data) |
|
| 64 | 64 | { |
| 65 | - if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) |
|
| 65 | + if ($cm->updateElement($_data['elementsgroup'], $element_id, $data['category_id'])) |
|
| 66 | 66 | { |
| 67 | 67 | $cm->addMessage( |
| 68 | 68 | sprintf( |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - if( $_changes === 0 ) |
|
| 81 | + if ($_changes === 0) |
|
| 82 | 82 | { |
| 83 | - $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' ); |
|
| 83 | + $cm->addMessage($cm->txt('cm_no_categorization'), 'categorize'); |
|
| 84 | 84 | return; |
| 85 | 85 | } |
| 86 | 86 | else |
@@ -98,29 +98,29 @@ discard block |
||
| 98 | 98 | /** |
| 99 | 99 | * Add a new category |
| 100 | 100 | */ |
| 101 | -if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) |
|
| 101 | +if (isset($_POST[$cm->get('request_key')]['add']['submit'])) |
|
| 102 | 102 | { |
| 103 | 103 | $_data = $_POST[$cm->get('request_key')]['add']['data']; |
| 104 | - $category = trim( html_entity_decode($_data['name']) ); |
|
| 104 | + $category = trim(html_entity_decode($_data['name'])); |
|
| 105 | 105 | $rank = (int) $_data['rank']; |
| 106 | 106 | |
| 107 | - if( empty( $category ) ) |
|
| 107 | + if (empty($category)) |
|
| 108 | 108 | { |
| 109 | - $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); |
|
| 109 | + $cm->addMessage($cm->txt('cm_enter_name_for_category'), 'add'); |
|
| 110 | 110 | return; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - if( $cm->isCategoryExists( $category ) ) |
|
| 113 | + if ($cm->isCategoryExists($category)) |
|
| 114 | 114 | { |
| 115 | - $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); |
|
| 115 | + $cm->addMessage(sprintf($cm->txt('cm_category_x_exists'), $category), 'add'); |
|
| 116 | 116 | return; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - if( $cm->addCategory( $category, $rank ) !== 0 ) |
|
| 119 | + if ($cm->addCategory($category, $rank) !== 0) |
|
| 120 | 120 | { |
| 121 | 121 | $cm->addMessage( |
| 122 | 122 | sprintf( |
| 123 | - $cm->txt( 'cm_category_x_saved_at_position_y' ), |
|
| 123 | + $cm->txt('cm_category_x_saved_at_position_y'), |
|
| 124 | 124 | $category, |
| 125 | 125 | $rank |
| 126 | 126 | ), |
@@ -129,26 +129,26 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | else |
| 131 | 131 | { |
| 132 | - $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' ); |
|
| 132 | + $cm->addMessage($cm->txt('cm_unknown_error'), 'add'); |
|
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
| 137 | 137 | * Sort categories |
| 138 | 138 | */ |
| 139 | -if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) |
|
| 139 | +if (isset($_POST[$cm->get('request_key')]['sort']['submit'])) |
|
| 140 | 140 | { |
| 141 | 141 | $categories = $_POST[$cm->get('request_key')]['sort']['data']; |
| 142 | 142 | $_changes = 0; |
| 143 | 143 | |
| 144 | - foreach( $categories as $category_id => $_data ) |
|
| 144 | + foreach ($categories as $category_id => $_data) |
|
| 145 | 145 | { |
| 146 | 146 | $data = array( |
| 147 | - 'category' => urldecode( $_data['category'] ), |
|
| 147 | + 'category' => urldecode($_data['category']), |
|
| 148 | 148 | 'rank' => $_data['rank'] |
| 149 | 149 | ); |
| 150 | 150 | |
| 151 | - if( $cm->updateCategory( $category_id, $data ) ) |
|
| 151 | + if ($cm->updateCategory($category_id, $data)) |
|
| 152 | 152 | { |
| 153 | 153 | $cm->addMessage( |
| 154 | 154 | sprintf( |
@@ -162,9 +162,9 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if( $_changes === 0 ) |
|
| 165 | + if ($_changes === 0) |
|
| 166 | 166 | { |
| 167 | - $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort'); |
|
| 167 | + $cm->addMessage($cm->txt('cm_no_changes'), 'sort'); |
|
| 168 | 168 | } |
| 169 | 169 | else |
| 170 | 170 | { |
@@ -181,21 +181,21 @@ discard block |
||
| 181 | 181 | /** |
| 182 | 182 | * Edit categories |
| 183 | 183 | */ |
| 184 | -if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) |
|
| 184 | +if (isset($_POST[$cm->get('request_key')]['edit']['submit'])) |
|
| 185 | 185 | { |
| 186 | 186 | $categories = $_POST[$cm->get('request_key')]['edit']['data']; |
| 187 | 187 | $_changes = 0; |
| 188 | 188 | |
| 189 | - foreach( $categories as $category_id => $_data ) |
|
| 189 | + foreach ($categories as $category_id => $_data) |
|
| 190 | 190 | { |
| 191 | - if( isset( $_data['delete'] ) ) |
|
| 191 | + if (isset($_data['delete'])) |
|
| 192 | 192 | { |
| 193 | - if( $cm->deleteCategory( $category_id ) ) |
|
| 193 | + if ($cm->deleteCategory($category_id)) |
|
| 194 | 194 | { |
| 195 | 195 | $cm->addMessage( |
| 196 | 196 | sprintf( |
| 197 | 197 | $cm->txt('cm_category_x_deleted'), |
| 198 | - urldecode( $_data['origin'] ) |
|
| 198 | + urldecode($_data['origin']) |
|
| 199 | 199 | ), |
| 200 | 200 | 'edit' |
| 201 | 201 | ); |
@@ -205,16 +205,16 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | $data = array( |
| 208 | - 'category' => trim( html_entity_decode( $_data['category'] ) ), |
|
| 208 | + 'category' => trim(html_entity_decode($_data['category'])), |
|
| 209 | 209 | 'rank' => $_data['rank'] |
| 210 | 210 | ); |
| 211 | 211 | |
| 212 | - if( $cm->updateCategory( $category_id, $data ) ) |
|
| 212 | + if ($cm->updateCategory($category_id, $data)) |
|
| 213 | 213 | { |
| 214 | 214 | $cm->addMessage( |
| 215 | 215 | sprintf( |
| 216 | 216 | $cm->txt('cm_category_x_renamed_to_y'), |
| 217 | - urldecode( $_data['origin'] ), |
|
| 217 | + urldecode($_data['origin']), |
|
| 218 | 218 | $data['category'] |
| 219 | 219 | ), |
| 220 | 220 | 'edit' |
@@ -223,26 +223,26 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - if( $_changes === 0 ) |
|
| 226 | + if ($_changes === 0) |
|
| 227 | 227 | { |
| 228 | - $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit'); |
|
| 228 | + $cm->addMessage($cm->txt('cm_no_changes'), 'edit'); |
|
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /** |
| 233 | 233 | * Delete singel category by $_GET |
| 234 | 234 | */ |
| 235 | -if( isset( $_GET[$cm->get('request_key')]['delete'] ) |
|
| 236 | - && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) |
|
| 235 | +if (isset($_GET[$cm->get('request_key')]['delete']) |
|
| 236 | + && !empty($_GET[$cm->get('request_key')]['delete'])) |
|
| 237 | 237 | { |
| 238 | - $category_id = (int)$_GET[$cm->get('request_key')]['delete']; |
|
| 238 | + $category_id = (int) $_GET[$cm->get('request_key')]['delete']; |
|
| 239 | 239 | |
| 240 | - if( $cm->deleteCategory( $category_id ) ) |
|
| 240 | + if ($cm->deleteCategory($category_id)) |
|
| 241 | 241 | { |
| 242 | 242 | $cm->addMessage( |
| 243 | 243 | sprintf( |
| 244 | 244 | $cm->txt('cm_category_x_deleted'), |
| 245 | - urldecode( $_GET[$cm->get('request_key')]['category'] ) |
|
| 245 | + urldecode($_GET[$cm->get('request_key')]['category']) |
|
| 246 | 246 | ), |
| 247 | 247 | 'edit' |
| 248 | 248 | ); |
@@ -251,15 +251,15 @@ discard block |
||
| 251 | 251 | /** |
| 252 | 252 | * Translate phrases |
| 253 | 253 | */ |
| 254 | -if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) |
|
| 254 | +if (isset($_POST[$cm->get('request_key')]['translate']['submit'])) |
|
| 255 | 255 | { |
| 256 | 256 | $translations = $_POST[$cm->get('request_key')]['translate']['data']; |
| 257 | 257 | |
| 258 | - foreach( $translations as $native_phrase => $translation ) |
|
| 258 | + foreach ($translations as $native_phrase => $translation) |
|
| 259 | 259 | { |
| 260 | - $native_phrase = urldecode( $native_phrase ); |
|
| 260 | + $native_phrase = urldecode($native_phrase); |
|
| 261 | 261 | |
| 262 | - if( empty( $translation ) ) |
|
| 262 | + if (empty($translation)) |
|
| 263 | 263 | { |
| 264 | 264 | $translation = $native_phrase; |
| 265 | 265 | |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | //$cm->c('Translator')->setType('phrase'); |
| 276 | - $cm->c('Translator')->addTranslation( $native_phrase, $translation, 'phrase' ); |
|
| 276 | + $cm->c('Translator')->addTranslation($native_phrase, $translation, 'phrase'); |
|
| 277 | 277 | |
| 278 | 278 | $cm->addMessage( |
| 279 | 279 | sprintf( |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | ); |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | - if( empty( $cm->new_translations ) ) |
|
| 288 | + if (empty($cm->new_translations)) |
|
| 289 | 289 | { |
| 290 | 290 | //$_REQUEST['webfxtab_manage-categories-pane'] = 0; |
| 291 | 291 | // unset( $_COOKIE['webfxtab_manage-categories-pane'] ); |
@@ -6,26 +6,22 @@ discard block |
||
| 6 | 6 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) |
|
| 10 | -{ |
|
| 9 | +if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) { |
|
| 11 | 10 | $_data = $_REQUEST[$cm->get('request_key')]; |
| 12 | 11 | $output = ''; |
| 13 | 12 | $task = $_data['task']; |
| 14 | - switch( $task ) |
|
| 15 | - { |
|
| 13 | + switch( $task ) { |
|
| 16 | 14 | /** |
| 17 | 15 | * get categories |
| 18 | 16 | */ |
| 19 | 17 | case 'categorize_load_elements': |
| 20 | 18 | $elements = $_data['elements']; |
| 21 | 19 | |
| 22 | - if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) |
|
| 23 | - { |
|
| 20 | + if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) { |
|
| 24 | 21 | $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); |
| 25 | 22 | } |
| 26 | 23 | |
| 27 | - foreach( $cm->getCategories() as $category ) |
|
| 28 | - { |
|
| 24 | + foreach( $cm->getCategories() as $category ) { |
|
| 29 | 25 | $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] ); |
| 30 | 26 | $output .= $cm->renderView('chunks/categorize/category', $category); |
| 31 | 27 | } |
@@ -41,8 +37,7 @@ discard block |
||
| 41 | 37 | * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476 |
| 42 | 38 | * |
| 43 | 39 | */ |
| 44 | -if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) |
|
| 45 | -{ |
|
| 40 | +if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) { |
|
| 46 | 41 | $_data = $_POST[$cm->get('request_key')]['categorize']; |
| 47 | 42 | $_changes = 0; |
| 48 | 43 | |
@@ -54,16 +49,13 @@ discard block |
||
| 54 | 49 | 'categorize' |
| 55 | 50 | ); |
| 56 | 51 | |
| 57 | - if( !isset( $_data['elements'] ) ) |
|
| 58 | - { |
|
| 52 | + if( !isset( $_data['elements'] ) ) { |
|
| 59 | 53 | $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' ); |
| 60 | 54 | return; |
| 61 | 55 | } |
| 62 | 56 | |
| 63 | - foreach( $_data['elements'] as $element_id => $data ) |
|
| 64 | - { |
|
| 65 | - if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) |
|
| 66 | - { |
|
| 57 | + foreach( $_data['elements'] as $element_id => $data ) { |
|
| 58 | + if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) { |
|
| 67 | 59 | $cm->addMessage( |
| 68 | 60 | sprintf( |
| 69 | 61 | $cm->txt('cm_x_assigned_to_category_y'), |
@@ -78,13 +70,10 @@ discard block |
||
| 78 | 70 | } |
| 79 | 71 | } |
| 80 | 72 | |
| 81 | - if( $_changes === 0 ) |
|
| 82 | - { |
|
| 73 | + if( $_changes === 0 ) { |
|
| 83 | 74 | $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' ); |
| 84 | 75 | return; |
| 85 | - } |
|
| 86 | - else |
|
| 87 | - { |
|
| 76 | + } else { |
|
| 88 | 77 | $cm->addMessage( |
| 89 | 78 | sprintf( |
| 90 | 79 | $cm->txt('cm_x_changes_made'), |
@@ -98,26 +87,22 @@ discard block |
||
| 98 | 87 | /** |
| 99 | 88 | * Add a new category |
| 100 | 89 | */ |
| 101 | -if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) |
|
| 102 | -{ |
|
| 90 | +if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) { |
|
| 103 | 91 | $_data = $_POST[$cm->get('request_key')]['add']['data']; |
| 104 | 92 | $category = trim( html_entity_decode($_data['name']) ); |
| 105 | 93 | $rank = (int) $_data['rank']; |
| 106 | 94 | |
| 107 | - if( empty( $category ) ) |
|
| 108 | - { |
|
| 95 | + if( empty( $category ) ) { |
|
| 109 | 96 | $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); |
| 110 | 97 | return; |
| 111 | 98 | } |
| 112 | 99 | |
| 113 | - if( $cm->isCategoryExists( $category ) ) |
|
| 114 | - { |
|
| 100 | + if( $cm->isCategoryExists( $category ) ) { |
|
| 115 | 101 | $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); |
| 116 | 102 | return; |
| 117 | 103 | } |
| 118 | 104 | |
| 119 | - if( $cm->addCategory( $category, $rank ) !== 0 ) |
|
| 120 | - { |
|
| 105 | + if( $cm->addCategory( $category, $rank ) !== 0 ) { |
|
| 121 | 106 | $cm->addMessage( |
| 122 | 107 | sprintf( |
| 123 | 108 | $cm->txt( 'cm_category_x_saved_at_position_y' ), |
@@ -126,9 +111,7 @@ discard block |
||
| 126 | 111 | ), |
| 127 | 112 | 'add' |
| 128 | 113 | ); |
| 129 | - } |
|
| 130 | - else |
|
| 131 | - { |
|
| 114 | + } else { |
|
| 132 | 115 | $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' ); |
| 133 | 116 | } |
| 134 | 117 | } |
@@ -136,20 +119,17 @@ discard block |
||
| 136 | 119 | /** |
| 137 | 120 | * Sort categories |
| 138 | 121 | */ |
| 139 | -if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) |
|
| 140 | -{ |
|
| 122 | +if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) { |
|
| 141 | 123 | $categories = $_POST[$cm->get('request_key')]['sort']['data']; |
| 142 | 124 | $_changes = 0; |
| 143 | 125 | |
| 144 | - foreach( $categories as $category_id => $_data ) |
|
| 145 | - { |
|
| 126 | + foreach( $categories as $category_id => $_data ) { |
|
| 146 | 127 | $data = array( |
| 147 | 128 | 'category' => urldecode( $_data['category'] ), |
| 148 | 129 | 'rank' => $_data['rank'] |
| 149 | 130 | ); |
| 150 | 131 | |
| 151 | - if( $cm->updateCategory( $category_id, $data ) ) |
|
| 152 | - { |
|
| 132 | + if( $cm->updateCategory( $category_id, $data ) ) { |
|
| 153 | 133 | $cm->addMessage( |
| 154 | 134 | sprintf( |
| 155 | 135 | $cm->txt('cm_category_x_moved_to_position_y'), |
@@ -162,12 +142,9 @@ discard block |
||
| 162 | 142 | } |
| 163 | 143 | } |
| 164 | 144 | |
| 165 | - if( $_changes === 0 ) |
|
| 166 | - { |
|
| 145 | + if( $_changes === 0 ) { |
|
| 167 | 146 | $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort'); |
| 168 | - } |
|
| 169 | - else |
|
| 170 | - { |
|
| 147 | + } else { |
|
| 171 | 148 | $cm->addMessage( |
| 172 | 149 | sprintf( |
| 173 | 150 | $cm->txt('cm_x_changes_made'), |
@@ -181,17 +158,13 @@ discard block |
||
| 181 | 158 | /** |
| 182 | 159 | * Edit categories |
| 183 | 160 | */ |
| 184 | -if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) |
|
| 185 | -{ |
|
| 161 | +if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) { |
|
| 186 | 162 | $categories = $_POST[$cm->get('request_key')]['edit']['data']; |
| 187 | 163 | $_changes = 0; |
| 188 | 164 | |
| 189 | - foreach( $categories as $category_id => $_data ) |
|
| 190 | - { |
|
| 191 | - if( isset( $_data['delete'] ) ) |
|
| 192 | - { |
|
| 193 | - if( $cm->deleteCategory( $category_id ) ) |
|
| 194 | - { |
|
| 165 | + foreach( $categories as $category_id => $_data ) { |
|
| 166 | + if( isset( $_data['delete'] ) ) { |
|
| 167 | + if( $cm->deleteCategory( $category_id ) ) { |
|
| 195 | 168 | $cm->addMessage( |
| 196 | 169 | sprintf( |
| 197 | 170 | $cm->txt('cm_category_x_deleted'), |
@@ -209,8 +182,7 @@ discard block |
||
| 209 | 182 | 'rank' => $_data['rank'] |
| 210 | 183 | ); |
| 211 | 184 | |
| 212 | - if( $cm->updateCategory( $category_id, $data ) ) |
|
| 213 | - { |
|
| 185 | + if( $cm->updateCategory( $category_id, $data ) ) { |
|
| 214 | 186 | $cm->addMessage( |
| 215 | 187 | sprintf( |
| 216 | 188 | $cm->txt('cm_category_x_renamed_to_y'), |
@@ -223,8 +195,7 @@ discard block |
||
| 223 | 195 | } |
| 224 | 196 | } |
| 225 | 197 | |
| 226 | - if( $_changes === 0 ) |
|
| 227 | - { |
|
| 198 | + if( $_changes === 0 ) { |
|
| 228 | 199 | $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit'); |
| 229 | 200 | } |
| 230 | 201 | } |
@@ -233,12 +204,10 @@ discard block |
||
| 233 | 204 | * Delete singel category by $_GET |
| 234 | 205 | */ |
| 235 | 206 | if( isset( $_GET[$cm->get('request_key')]['delete'] ) |
| 236 | - && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) |
|
| 237 | -{ |
|
| 207 | + && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) { |
|
| 238 | 208 | $category_id = (int)$_GET[$cm->get('request_key')]['delete']; |
| 239 | 209 | |
| 240 | - if( $cm->deleteCategory( $category_id ) ) |
|
| 241 | - { |
|
| 210 | + if( $cm->deleteCategory( $category_id ) ) { |
|
| 242 | 211 | $cm->addMessage( |
| 243 | 212 | sprintf( |
| 244 | 213 | $cm->txt('cm_category_x_deleted'), |
@@ -251,16 +220,13 @@ discard block |
||
| 251 | 220 | /** |
| 252 | 221 | * Translate phrases |
| 253 | 222 | */ |
| 254 | -if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) |
|
| 255 | -{ |
|
| 223 | +if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) { |
|
| 256 | 224 | $translations = $_POST[$cm->get('request_key')]['translate']['data']; |
| 257 | 225 | |
| 258 | - foreach( $translations as $native_phrase => $translation ) |
|
| 259 | - { |
|
| 226 | + foreach( $translations as $native_phrase => $translation ) { |
|
| 260 | 227 | $native_phrase = urldecode( $native_phrase ); |
| 261 | 228 | |
| 262 | - if( empty( $translation ) ) |
|
| 263 | - { |
|
| 229 | + if( empty( $translation ) ) { |
|
| 264 | 230 | $translation = $native_phrase; |
| 265 | 231 | |
| 266 | 232 | $cm->addMessage( |
@@ -285,8 +251,7 @@ discard block |
||
| 285 | 251 | ); |
| 286 | 252 | } |
| 287 | 253 | |
| 288 | - if( empty( $cm->new_translations ) ) |
|
| 289 | - { |
|
| 254 | + if( empty( $cm->new_translations ) ) { |
|
| 290 | 255 | //$_REQUEST['webfxtab_manage-categories-pane'] = 0; |
| 291 | 256 | // unset( $_COOKIE['webfxtab_manage-categories-pane'] ); |
| 292 | 257 | // setcookie('webfxtab_manage-categories-pane', 0); |
@@ -1,32 +1,32 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if(IN_MANAGER_MODE != "true") { |
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 4 | 4 | } |
| 5 | 5 | if(!$modx->hasPermission('web_access_permissions')) { |
| 6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | // find all document groups, for the select :) |
| 10 | 10 | $rs = $modx->db->select('*', $modx->getFullTableName('documentgroup_names'), '', 'name'); |
| 11 | 11 | if($modx->db->getRecordCount($rs) < 1) { |
| 12 | - $docgroupselector = "[no groups to add]"; |
|
| 12 | + $docgroupselector = "[no groups to add]"; |
|
| 13 | 13 | } else { |
| 14 | - $docgroupselector = '<select name="docgroup">' . "\n"; |
|
| 15 | - while($row = $modx->db->getRow($rs)) { |
|
| 16 | - $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
| 17 | - } |
|
| 18 | - $docgroupselector .= "</select>\n"; |
|
| 14 | + $docgroupselector = '<select name="docgroup">' . "\n"; |
|
| 15 | + while($row = $modx->db->getRow($rs)) { |
|
| 16 | + $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
| 17 | + } |
|
| 18 | + $docgroupselector .= "</select>\n"; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $rs = $modx->db->select('*', $modx->getFullTableName('webgroup_names'), '', 'name'); |
| 22 | 22 | if($modx->db->getRecordCount($rs) < 1) { |
| 23 | - $usrgroupselector = '[no user groups]'; |
|
| 23 | + $usrgroupselector = '[no user groups]'; |
|
| 24 | 24 | } else { |
| 25 | - $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
| 26 | - while($row = $modx->db->getRow($rs)) { |
|
| 27 | - $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
| 28 | - } |
|
| 29 | - $usrgroupselector .= "</select>\n"; |
|
| 25 | + $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
| 26 | + while($row = $modx->db->getRow($rs)) { |
|
| 27 | + $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
| 28 | + } |
|
| 29 | + $usrgroupselector .= "</select>\n"; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | ?> |
@@ -88,24 +88,24 @@ discard block |
||
| 88 | 88 | </form> |
| 89 | 89 | </div> |
| 90 | 90 | <?php |
| 91 | - $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames |
|
| 91 | + $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames |
|
| 92 | 92 | LEFT JOIN " . $modx->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id |
| 93 | 93 | LEFT JOIN " . $modx->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); |
| 94 | - if($modx->db->getRecordCount($rs) < 1) { |
|
| 95 | - ?> |
|
| 94 | + if($modx->db->getRecordCount($rs) < 1) { |
|
| 95 | + ?> |
|
| 96 | 96 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
| 97 | 97 | <?php |
| 98 | - } else { |
|
| 99 | - ?> |
|
| 98 | + } else { |
|
| 99 | + ?> |
|
| 100 | 100 | <div class="form-group"> |
| 101 | 101 | <?php |
| 102 | - $pid = ''; |
|
| 103 | - while($row = $modx->db->getRow($rs)) { |
|
| 104 | - if($pid != $row['id']) { |
|
| 105 | - if($pid != '') { |
|
| 106 | - echo '</div><div class="form-group">'; |
|
| 107 | - } |
|
| 108 | - ?> |
|
| 102 | + $pid = ''; |
|
| 103 | + while($row = $modx->db->getRow($rs)) { |
|
| 104 | + if($pid != $row['id']) { |
|
| 105 | + if($pid != '') { |
|
| 106 | + echo '</div><div class="form-group">'; |
|
| 107 | + } |
|
| 108 | + ?> |
|
| 109 | 109 | <form method="post" action="index.php" name="accesspermissions"> |
| 110 | 110 | <input type="hidden" name="a" value="92" /> |
| 111 | 111 | <input type="hidden" name="groupid" value="<?= $row['id'] ?>" /> |
@@ -120,21 +120,21 @@ discard block |
||
| 120 | 120 | </form> |
| 121 | 121 | <?= $_lang['web_access_permissions_users_in_group'] ?> |
| 122 | 122 | <?php |
| 123 | - } |
|
| 124 | - if(!$row['user_id']) { |
|
| 125 | - ?> |
|
| 123 | + } |
|
| 124 | + if(!$row['user_id']) { |
|
| 125 | + ?> |
|
| 126 | 126 | <i><?= $_lang['access_permissions_no_users_in_group'] ?></i> |
| 127 | 127 | <?php |
| 128 | - $pid = $row['id']; |
|
| 129 | - continue; |
|
| 130 | - } |
|
| 131 | - ?> |
|
| 128 | + $pid = $row['id']; |
|
| 129 | + continue; |
|
| 130 | + } |
|
| 131 | + ?> |
|
| 132 | 132 | <?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=88&id=<?= $row['user_id'] ?>"><?= $row['user_name'] ?></a> |
| 133 | 133 | <?php |
| 134 | - $pid = $row['id']; |
|
| 135 | - } |
|
| 136 | - } |
|
| 137 | - ?> |
|
| 134 | + $pid = $row['id']; |
|
| 135 | + } |
|
| 136 | + } |
|
| 137 | + ?> |
|
| 138 | 138 | </div> |
| 139 | 139 | </div> |
| 140 | 140 | </div> |
@@ -159,24 +159,24 @@ discard block |
||
| 159 | 159 | </form> |
| 160 | 160 | </div> |
| 161 | 161 | <?php |
| 162 | - $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames |
|
| 162 | + $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames |
|
| 163 | 163 | LEFT JOIN " . $modx->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id |
| 164 | 164 | LEFT JOIN " . $modx->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); |
| 165 | - if($modx->db->getRecordCount($rs) < 1) { |
|
| 166 | - ?> |
|
| 165 | + if($modx->db->getRecordCount($rs) < 1) { |
|
| 166 | + ?> |
|
| 167 | 167 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
| 168 | 168 | <?php |
| 169 | - } else { |
|
| 170 | - ?> |
|
| 169 | + } else { |
|
| 170 | + ?> |
|
| 171 | 171 | <div class="form-group"> |
| 172 | 172 | <?php |
| 173 | - $pid = ''; |
|
| 174 | - while($row = $modx->db->getRow($rs)) { |
|
| 175 | - if($pid != $row['id']) { |
|
| 176 | - if($pid != '') { |
|
| 177 | - echo '</div><div class="form-group">'; |
|
| 178 | - } |
|
| 179 | - ?> |
|
| 173 | + $pid = ''; |
|
| 174 | + while($row = $modx->db->getRow($rs)) { |
|
| 175 | + if($pid != $row['id']) { |
|
| 176 | + if($pid != '') { |
|
| 177 | + echo '</div><div class="form-group">'; |
|
| 178 | + } |
|
| 179 | + ?> |
|
| 180 | 180 | <form method="post" action="index.php" name="accesspermissions"> |
| 181 | 181 | <input type="hidden" name="a" value="92" /> |
| 182 | 182 | <input type="hidden" name="groupid" value="<?= $row['id'] ?>" /> |
@@ -191,21 +191,21 @@ discard block |
||
| 191 | 191 | </form> |
| 192 | 192 | <?= $_lang['access_permissions_resources_in_group'] ?> |
| 193 | 193 | <?php |
| 194 | - } |
|
| 195 | - if(!$row['doc_id']) { |
|
| 196 | - ?> |
|
| 194 | + } |
|
| 195 | + if(!$row['doc_id']) { |
|
| 196 | + ?> |
|
| 197 | 197 | <i><?= $_lang['access_permissions_no_resources_in_group'] ?></i> |
| 198 | 198 | <?php |
| 199 | - $pid = $row['id']; |
|
| 200 | - continue; |
|
| 201 | - } |
|
| 202 | - ?> |
|
| 199 | + $pid = $row['id']; |
|
| 200 | + continue; |
|
| 201 | + } |
|
| 202 | + ?> |
|
| 203 | 203 | <?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=3&id=<?= $row['doc_id'] ?>" title="<?= $modx->htmlspecialchars($row['doc_title']) ?>"><?= $row['doc_id'] ?></a> |
| 204 | 204 | <?php |
| 205 | - $pid = $row['id']; |
|
| 206 | - } |
|
| 207 | - } |
|
| 208 | - ?> |
|
| 205 | + $pid = $row['id']; |
|
| 206 | + } |
|
| 207 | + } |
|
| 208 | + ?> |
|
| 209 | 209 | </div> |
| 210 | 210 | </div> |
| 211 | 211 | </div> |
@@ -217,15 +217,15 @@ discard block |
||
| 217 | 217 | <div class="container container-body"> |
| 218 | 218 | <p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p> |
| 219 | 219 | <?php |
| 220 | - $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames |
|
| 220 | + $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames |
|
| 221 | 221 | LEFT JOIN " . $modx->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id |
| 222 | 222 | LEFT JOIN " . $modx->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); |
| 223 | - if($modx->db->getRecordCount($rs) < 1) { |
|
| 224 | - ?> |
|
| 223 | + if($modx->db->getRecordCount($rs) < 1) { |
|
| 224 | + ?> |
|
| 225 | 225 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
| 226 | 226 | <?php |
| 227 | - } else { |
|
| 228 | - ?> |
|
| 227 | + } else { |
|
| 228 | + ?> |
|
| 229 | 229 | <div class="form-group"> |
| 230 | 230 | <b><?= $_lang["access_permissions_group_link"] ?></b> |
| 231 | 231 | <form method="post" action="index.php" name="accesspermissions"> |
@@ -241,38 +241,38 @@ discard block |
||
| 241 | 241 | <hr> |
| 242 | 242 | <ul> |
| 243 | 243 | <?php |
| 244 | - $pid = ''; |
|
| 245 | - while($row = $modx->db->getRow($rs)) { |
|
| 246 | - if($row['id'] != $pid) { |
|
| 247 | - if($pid != '') { |
|
| 248 | - echo '</ul></li>'; |
|
| 249 | - } // close previous one |
|
| 250 | - ?> |
|
| 244 | + $pid = ''; |
|
| 245 | + while($row = $modx->db->getRow($rs)) { |
|
| 246 | + if($row['id'] != $pid) { |
|
| 247 | + if($pid != '') { |
|
| 248 | + echo '</ul></li>'; |
|
| 249 | + } // close previous one |
|
| 250 | + ?> |
|
| 251 | 251 | <li><b><?= $row['name'] ?></b></li> |
| 252 | 252 | <?php |
| 253 | - if(!$row['dg_id']) { |
|
| 254 | - echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
| 255 | - $pid = ''; |
|
| 256 | - continue; |
|
| 257 | - } else { |
|
| 258 | - echo '<ul>'; |
|
| 259 | - } |
|
| 260 | - } |
|
| 261 | - if(!$row['dg_id']) { |
|
| 262 | - continue; |
|
| 263 | - } |
|
| 264 | - ?> |
|
| 253 | + if(!$row['dg_id']) { |
|
| 254 | + echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
| 255 | + $pid = ''; |
|
| 256 | + continue; |
|
| 257 | + } else { |
|
| 258 | + echo '<ul>'; |
|
| 259 | + } |
|
| 260 | + } |
|
| 261 | + if(!$row['dg_id']) { |
|
| 262 | + continue; |
|
| 263 | + } |
|
| 264 | + ?> |
|
| 265 | 265 | <li><?= $row['dg_name'] ?> |
| 266 | 266 | <small><i>(<a class="text-danger" href="index.php?a=92&coupling=<?= $row['link_id'] ?>&operation=remove_document_group_from_user_group"><?= $_lang['remove'] ?></a>)</i></small> |
| 267 | 267 | </li> |
| 268 | 268 | <?php |
| 269 | - $pid = $row['id']; |
|
| 270 | - } |
|
| 271 | - ?> |
|
| 269 | + $pid = $row['id']; |
|
| 270 | + } |
|
| 271 | + ?> |
|
| 272 | 272 | </ul> |
| 273 | 273 | <?php |
| 274 | - } |
|
| 275 | - ?> |
|
| 274 | + } |
|
| 275 | + ?> |
|
| 276 | 276 | </div> |
| 277 | 277 | </div> |
| 278 | 278 | |
@@ -1,30 +1,30 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") { |
|
| 2 | +if (IN_MANAGER_MODE != "true") { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('web_access_permissions')) { |
|
| 5 | +if (!$modx->hasPermission('web_access_permissions')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | // find all document groups, for the select :) |
| 10 | 10 | $rs = $modx->db->select('*', $modx->getFullTableName('documentgroup_names'), '', 'name'); |
| 11 | -if($modx->db->getRecordCount($rs) < 1) { |
|
| 11 | +if ($modx->db->getRecordCount($rs) < 1) { |
|
| 12 | 12 | $docgroupselector = "[no groups to add]"; |
| 13 | 13 | } else { |
| 14 | - $docgroupselector = '<select name="docgroup">' . "\n"; |
|
| 15 | - while($row = $modx->db->getRow($rs)) { |
|
| 16 | - $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
| 14 | + $docgroupselector = '<select name="docgroup">'."\n"; |
|
| 15 | + while ($row = $modx->db->getRow($rs)) { |
|
| 16 | + $docgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n"; |
|
| 17 | 17 | } |
| 18 | 18 | $docgroupselector .= "</select>\n"; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $rs = $modx->db->select('*', $modx->getFullTableName('webgroup_names'), '', 'name'); |
| 22 | -if($modx->db->getRecordCount($rs) < 1) { |
|
| 22 | +if ($modx->db->getRecordCount($rs) < 1) { |
|
| 23 | 23 | $usrgroupselector = '[no user groups]'; |
| 24 | 24 | } else { |
| 25 | - $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
| 26 | - while($row = $modx->db->getRow($rs)) { |
|
| 27 | - $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
| 25 | + $usrgroupselector = '<select name="usergroup">'."\n"; |
|
| 26 | + while ($row = $modx->db->getRow($rs)) { |
|
| 27 | + $usrgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n"; |
|
| 28 | 28 | } |
| 29 | 29 | $usrgroupselector .= "</select>\n"; |
| 30 | 30 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | <div class="alert alert-info"><?= $_lang['access_permissions_introtext'] ?></div> |
| 61 | 61 | </div> |
| 62 | 62 | |
| 63 | -<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">' . $_lang['access_permissions_off'] . '</div>' : '') ?></div> |
|
| 63 | +<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">'.$_lang['access_permissions_off'].'</div>' : '') ?></div> |
|
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | <div class="tab-pane" id="wuapPane"> |
@@ -88,10 +88,10 @@ discard block |
||
| 88 | 88 | </form> |
| 89 | 89 | </div> |
| 90 | 90 | <?php |
| 91 | - $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames |
|
| 92 | - LEFT JOIN " . $modx->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id |
|
| 93 | - LEFT JOIN " . $modx->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); |
|
| 94 | - if($modx->db->getRecordCount($rs) < 1) { |
|
| 91 | + $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names')." AS groupnames |
|
| 92 | + LEFT JOIN " . $modx->getFullTableName('web_groups')." AS groups ON groups.webgroup = groupnames.id |
|
| 93 | + LEFT JOIN " . $modx->getFullTableName('web_users')." AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); |
|
| 94 | + if ($modx->db->getRecordCount($rs) < 1) { |
|
| 95 | 95 | ?> |
| 96 | 96 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
| 97 | 97 | <?php |
@@ -100,9 +100,9 @@ discard block |
||
| 100 | 100 | <div class="form-group"> |
| 101 | 101 | <?php |
| 102 | 102 | $pid = ''; |
| 103 | - while($row = $modx->db->getRow($rs)) { |
|
| 104 | - if($pid != $row['id']) { |
|
| 105 | - if($pid != '') { |
|
| 103 | + while ($row = $modx->db->getRow($rs)) { |
|
| 104 | + if ($pid != $row['id']) { |
|
| 105 | + if ($pid != '') { |
|
| 106 | 106 | echo '</div><div class="form-group">'; |
| 107 | 107 | } |
| 108 | 108 | ?> |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | <?= $_lang['web_access_permissions_users_in_group'] ?> |
| 122 | 122 | <?php |
| 123 | 123 | } |
| 124 | - if(!$row['user_id']) { |
|
| 124 | + if (!$row['user_id']) { |
|
| 125 | 125 | ?> |
| 126 | 126 | <i><?= $_lang['access_permissions_no_users_in_group'] ?></i> |
| 127 | 127 | <?php |
@@ -159,10 +159,10 @@ discard block |
||
| 159 | 159 | </form> |
| 160 | 160 | </div> |
| 161 | 161 | <?php |
| 162 | - $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames |
|
| 163 | - LEFT JOIN " . $modx->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id |
|
| 164 | - LEFT JOIN " . $modx->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); |
|
| 165 | - if($modx->db->getRecordCount($rs) < 1) { |
|
| 162 | + $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names')." AS dgnames |
|
| 163 | + LEFT JOIN " . $modx->getFullTableName('document_groups')." AS dg ON dg.document_group = dgnames.id |
|
| 164 | + LEFT JOIN " . $modx->getFullTableName('site_content')." AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); |
|
| 165 | + if ($modx->db->getRecordCount($rs) < 1) { |
|
| 166 | 166 | ?> |
| 167 | 167 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
| 168 | 168 | <?php |
@@ -171,9 +171,9 @@ discard block |
||
| 171 | 171 | <div class="form-group"> |
| 172 | 172 | <?php |
| 173 | 173 | $pid = ''; |
| 174 | - while($row = $modx->db->getRow($rs)) { |
|
| 175 | - if($pid != $row['id']) { |
|
| 176 | - if($pid != '') { |
|
| 174 | + while ($row = $modx->db->getRow($rs)) { |
|
| 175 | + if ($pid != $row['id']) { |
|
| 176 | + if ($pid != '') { |
|
| 177 | 177 | echo '</div><div class="form-group">'; |
| 178 | 178 | } |
| 179 | 179 | ?> |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | <?= $_lang['access_permissions_resources_in_group'] ?> |
| 193 | 193 | <?php |
| 194 | 194 | } |
| 195 | - if(!$row['doc_id']) { |
|
| 195 | + if (!$row['doc_id']) { |
|
| 196 | 196 | ?> |
| 197 | 197 | <i><?= $_lang['access_permissions_no_resources_in_group'] ?></i> |
| 198 | 198 | <?php |
@@ -217,10 +217,10 @@ discard block |
||
| 217 | 217 | <div class="container container-body"> |
| 218 | 218 | <p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p> |
| 219 | 219 | <?php |
| 220 | - $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames |
|
| 221 | - LEFT JOIN " . $modx->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id |
|
| 222 | - LEFT JOIN " . $modx->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); |
|
| 223 | - if($modx->db->getRecordCount($rs) < 1) { |
|
| 220 | + $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names')." AS groupnames |
|
| 221 | + LEFT JOIN " . $modx->getFullTableName('webgroup_access')." AS groupacc ON groupacc.webgroup = groupnames.id |
|
| 222 | + LEFT JOIN " . $modx->getFullTableName('documentgroup_names')." AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); |
|
| 223 | + if ($modx->db->getRecordCount($rs) < 1) { |
|
| 224 | 224 | ?> |
| 225 | 225 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
| 226 | 226 | <?php |
@@ -242,23 +242,23 @@ discard block |
||
| 242 | 242 | <ul> |
| 243 | 243 | <?php |
| 244 | 244 | $pid = ''; |
| 245 | - while($row = $modx->db->getRow($rs)) { |
|
| 246 | - if($row['id'] != $pid) { |
|
| 247 | - if($pid != '') { |
|
| 245 | + while ($row = $modx->db->getRow($rs)) { |
|
| 246 | + if ($row['id'] != $pid) { |
|
| 247 | + if ($pid != '') { |
|
| 248 | 248 | echo '</ul></li>'; |
| 249 | 249 | } // close previous one |
| 250 | 250 | ?> |
| 251 | 251 | <li><b><?= $row['name'] ?></b></li> |
| 252 | 252 | <?php |
| 253 | - if(!$row['dg_id']) { |
|
| 254 | - echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
| 253 | + if (!$row['dg_id']) { |
|
| 254 | + echo '<i>'.$_lang['no_groups_found'].'</i></li>'; |
|
| 255 | 255 | $pid = ''; |
| 256 | 256 | continue; |
| 257 | 257 | } else { |
| 258 | 258 | echo '<ul>'; |
| 259 | 259 | } |
| 260 | 260 | } |
| 261 | - if(!$row['dg_id']) { |
|
| 261 | + if (!$row['dg_id']) { |
|
| 262 | 262 | continue; |
| 263 | 263 | } |
| 264 | 264 | ?> |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if(IN_MANAGER_MODE != "true") {
|
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
|
| 3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
|
| 4 | 4 | } |
| 5 | 5 | if(!$modx->hasPermission('view_eventlog')) {
|
| 6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | // Get table Names (alphabetical) |
@@ -16,14 +16,14 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | // get and save search string |
| 18 | 18 | if($_REQUEST['op'] == 'reset') {
|
| 19 | - $sqlQuery = $query = ''; |
|
| 20 | - $_PAGE['vs']['search'] = ''; |
|
| 19 | + $sqlQuery = $query = ''; |
|
| 20 | + $_PAGE['vs']['search'] = ''; |
|
| 21 | 21 | } else {
|
| 22 | - $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
|
| 23 | - if(!is_numeric($sqlQuery)) {
|
|
| 24 | - $sqlQuery = $modx->db->escape($query); |
|
| 25 | - } |
|
| 26 | - $_PAGE['vs']['search'] = $query; |
|
| 22 | + $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
|
| 23 | + if(!is_numeric($sqlQuery)) {
|
|
| 24 | + $sqlQuery = $modx->db->escape($query); |
|
| 25 | + } |
|
| 26 | + $_PAGE['vs']['search'] = $query; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | // get & save listmode |
@@ -125,33 +125,33 @@ discard block |
||
| 125 | 125 | <div class="row"> |
| 126 | 126 | <div class="table-responsive"> |
| 127 | 127 | <?php |
| 128 | - $ds = $modx->db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el
|
|
| 128 | + $ds = $modx->db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el
|
|
| 129 | 129 | LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0
|
| 130 | 130 | LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC");
|
| 131 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
| 132 | - $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
|
|
| 133 | - $grd->pagerClass = ''; |
|
| 134 | - $grd->pageClass = 'page-item'; |
|
| 135 | - $grd->selPageClass = 'page-item active'; |
|
| 136 | - $grd->noRecordMsg = $_lang['no_records_found']; |
|
| 137 | - $grd->cssClass = "table data nowrap"; |
|
| 138 | - $grd->columnHeaderClass = "tableHeader"; |
|
| 139 | - $grd->itemClass = "tableItem"; |
|
| 140 | - $grd->altItemClass = "tableAltItem"; |
|
| 141 | - $grd->fields = "type,source,createdon,eventid,username"; |
|
| 142 | - $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; |
|
| 143 | - $grd->colWidths = "1%,,1%,1%,1%"; |
|
| 144 | - $grd->colAligns = "center,,,center,center"; |
|
| 145 | - $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
|
| 146 | - if($listmode == '1') {
|
|
| 147 | - $grd->pageSize = 0; |
|
| 148 | - } |
|
| 149 | - if($_REQUEST['op'] == 'reset') {
|
|
| 150 | - $grd->pageNumber = 1; |
|
| 151 | - } |
|
| 152 | - // render grid |
|
| 153 | - echo $grd->render(); |
|
| 154 | - ?> |
|
| 131 | + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
| 132 | + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
|
|
| 133 | + $grd->pagerClass = ''; |
|
| 134 | + $grd->pageClass = 'page-item'; |
|
| 135 | + $grd->selPageClass = 'page-item active'; |
|
| 136 | + $grd->noRecordMsg = $_lang['no_records_found']; |
|
| 137 | + $grd->cssClass = "table data nowrap"; |
|
| 138 | + $grd->columnHeaderClass = "tableHeader"; |
|
| 139 | + $grd->itemClass = "tableItem"; |
|
| 140 | + $grd->altItemClass = "tableAltItem"; |
|
| 141 | + $grd->fields = "type,source,createdon,eventid,username"; |
|
| 142 | + $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; |
|
| 143 | + $grd->colWidths = "1%,,1%,1%,1%"; |
|
| 144 | + $grd->colAligns = "center,,,center,center"; |
|
| 145 | + $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
|
| 146 | + if($listmode == '1') {
|
|
| 147 | + $grd->pageSize = 0; |
|
| 148 | + } |
|
| 149 | + if($_REQUEST['op'] == 'reset') {
|
|
| 150 | + $grd->pageNumber = 1; |
|
| 151 | + } |
|
| 152 | + // render grid |
|
| 153 | + echo $grd->render(); |
|
| 154 | + ?> |
|
| 155 | 155 | </div> |
| 156 | 156 | </div> |
| 157 | 157 | </div> |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") {
|
|
| 2 | +if (IN_MANAGER_MODE != "true") {
|
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('view_eventlog')) {
|
|
| 5 | +if (!$modx->hasPermission('view_eventlog')) {
|
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -15,12 +15,12 @@ discard block |
||
| 15 | 15 | $modx->manager->initPageViewState(); |
| 16 | 16 | |
| 17 | 17 | // get and save search string |
| 18 | -if($_REQUEST['op'] == 'reset') {
|
|
| 18 | +if ($_REQUEST['op'] == 'reset') {
|
|
| 19 | 19 | $sqlQuery = $query = ''; |
| 20 | 20 | $_PAGE['vs']['search'] = ''; |
| 21 | 21 | } else {
|
| 22 | 22 | $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
| 23 | - if(!is_numeric($sqlQuery)) {
|
|
| 23 | + if (!is_numeric($sqlQuery)) {
|
|
| 24 | 24 | $sqlQuery = $modx->db->escape($query); |
| 25 | 25 | } |
| 26 | 26 | $_PAGE['vs']['search'] = $query; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $_PAGE['vs']['lm'] = $listmode; |
| 32 | 32 | |
| 33 | 33 | // context menu |
| 34 | -include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; |
|
| 34 | +include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php"; |
|
| 35 | 35 | $cm = new ContextMenu("cntxm", 150);
|
| 36 | 36 | $cm->addItem($_lang['view_log'], "js:menuAction(1)", $_style['actions_preview']); |
| 37 | 37 | $cm->addSeparator(); |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | <?php |
| 128 | 128 | $ds = $modx->db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el
|
| 129 | 129 | LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0
|
| 130 | - LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC");
|
|
| 131 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
| 130 | + LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "".(is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '')."(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC");
|
|
| 131 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; |
|
| 132 | 132 | $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
|
| 133 | 133 | $grd->pagerClass = ''; |
| 134 | 134 | $grd->pageClass = 'page-item'; |
@@ -139,14 +139,14 @@ discard block |
||
| 139 | 139 | $grd->itemClass = "tableItem"; |
| 140 | 140 | $grd->altItemClass = "tableAltItem"; |
| 141 | 141 | $grd->fields = "type,source,createdon,eventid,username"; |
| 142 | - $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; |
|
| 142 | + $grd->columns = $_lang['type']." ,".$_lang['source']." ,".$_lang['date']." ,".$_lang['event_id']." ,".$_lang['sysinfo_userid']; |
|
| 143 | 143 | $grd->colWidths = "1%,,1%,1%,1%"; |
| 144 | 144 | $grd->colAligns = "center,,,center,center"; |
| 145 | - $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
|
| 146 | - if($listmode == '1') {
|
|
| 145 | + $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang['click_to_context']."'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='".$_lang['click_to_view_details']."'>[+source+]</a>||date: ".$modx->toDateFormat(null, 'formatOnly').' %I:%M %p'; |
|
| 146 | + if ($listmode == '1') {
|
|
| 147 | 147 | $grd->pageSize = 0; |
| 148 | 148 | } |
| 149 | - if($_REQUEST['op'] == 'reset') {
|
|
| 149 | + if ($_REQUEST['op'] == 'reset') {
|
|
| 150 | 150 | $grd->pageNumber = 1; |
| 151 | 151 | } |
| 152 | 152 | // render grid |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") {
|
|
| 2 | +if(IN_MANAGER_MODE != "true") { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('view_eventlog')) {
|
|
| 5 | +if(!$modx->hasPermission('view_eventlog')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -15,12 +15,12 @@ discard block |
||
| 15 | 15 | $modx->manager->initPageViewState(); |
| 16 | 16 | |
| 17 | 17 | // get and save search string |
| 18 | -if($_REQUEST['op'] == 'reset') {
|
|
| 18 | +if($_REQUEST['op'] == 'reset') { |
|
| 19 | 19 | $sqlQuery = $query = ''; |
| 20 | 20 | $_PAGE['vs']['search'] = ''; |
| 21 | -} else {
|
|
| 21 | +} else { |
|
| 22 | 22 | $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
| 23 | - if(!is_numeric($sqlQuery)) {
|
|
| 23 | + if(!is_numeric($sqlQuery)) { |
|
| 24 | 24 | $sqlQuery = $modx->db->escape($query); |
| 25 | 25 | } |
| 26 | 26 | $_PAGE['vs']['search'] = $query; |
@@ -143,10 +143,10 @@ discard block |
||
| 143 | 143 | $grd->colWidths = "1%,,1%,1%,1%"; |
| 144 | 144 | $grd->colAligns = "center,,,center,center"; |
| 145 | 145 | $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
| 146 | - if($listmode == '1') {
|
|
| 146 | + if($listmode == '1') { |
|
| 147 | 147 | $grd->pageSize = 0; |
| 148 | 148 | } |
| 149 | - if($_REQUEST['op'] == 'reset') {
|
|
| 149 | + if($_REQUEST['op'] == 'reset') { |
|
| 150 | 150 | $grd->pageNumber = 1; |
| 151 | 151 | } |
| 152 | 152 | // render grid |
@@ -1,21 +1,21 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if(IN_MANAGER_MODE != "true") { |
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | switch($modx->manager->action) { |
| 7 | - case 16: |
|
| 8 | - if(!$modx->hasPermission('edit_template')) { |
|
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | - } |
|
| 11 | - break; |
|
| 12 | - case 19: |
|
| 13 | - if(!$modx->hasPermission('new_template')) { |
|
| 14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | - } |
|
| 16 | - break; |
|
| 17 | - default: |
|
| 18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | + case 16: |
|
| 8 | + if(!$modx->hasPermission('edit_template')) { |
|
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | + } |
|
| 11 | + break; |
|
| 12 | + case 19: |
|
| 13 | + if(!$modx->hasPermission('new_template')) { |
|
| 14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | + } |
|
| 16 | + break; |
|
| 17 | + default: |
|
| 18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | // check to see the snippet editor isn't locked |
| 26 | 26 | if($lockedEl = $modx->elementIsLocked(1, $id)) { |
| 27 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); |
|
| 27 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); |
|
| 28 | 28 | } |
| 29 | 29 | // end check for lock |
| 30 | 30 | |
@@ -33,23 +33,23 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $content = array(); |
| 35 | 35 | if(!empty($id)) { |
| 36 | - $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); |
|
| 37 | - $content = $modx->db->getRow($rs); |
|
| 38 | - if(!$content) { |
|
| 39 | - $modx->webAlertAndQuit("No database record has been found for this template."); |
|
| 40 | - } |
|
| 41 | - |
|
| 42 | - $_SESSION['itemname'] = $content['templatename']; |
|
| 43 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
| 44 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 45 | - } |
|
| 36 | + $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); |
|
| 37 | + $content = $modx->db->getRow($rs); |
|
| 38 | + if(!$content) { |
|
| 39 | + $modx->webAlertAndQuit("No database record has been found for this template."); |
|
| 40 | + } |
|
| 41 | + |
|
| 42 | + $_SESSION['itemname'] = $content['templatename']; |
|
| 43 | + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
| 44 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 45 | + } |
|
| 46 | 46 | } else { |
| 47 | - $_SESSION['itemname'] = $_lang["new_template"]; |
|
| 48 | - $content['category'] = intval($_REQUEST['catid']); |
|
| 47 | + $_SESSION['itemname'] = $_lang["new_template"]; |
|
| 48 | + $content['category'] = intval($_REQUEST['catid']); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | if($modx->manager->hasFormValues()) { |
| 52 | - $modx->manager->loadFormValues(); |
|
| 52 | + $modx->manager->loadFormValues(); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | $content = array_merge($content, $_POST); |
@@ -98,12 +98,12 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | <form name="mutate" method="post" action="index.php"> |
| 100 | 100 | <?php |
| 101 | - // invoke OnTempFormPrerender event |
|
| 102 | - $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); |
|
| 103 | - if(is_array($evtOut)) { |
|
| 104 | - echo implode("", $evtOut); |
|
| 105 | - } |
|
| 106 | - ?> |
|
| 101 | + // invoke OnTempFormPrerender event |
|
| 102 | + $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); |
|
| 103 | + if(is_array($evtOut)) { |
|
| 104 | + echo implode("", $evtOut); |
|
| 105 | + } |
|
| 106 | + ?> |
|
| 107 | 107 | <input type="hidden" name="a" value="20"> |
| 108 | 108 | <input type="hidden" name="id" value="<?= $_REQUEST['id'] ?>"> |
| 109 | 109 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | <label class="col-md-3 col-lg-2"> |
| 134 | 134 | <?= $_lang['template_name'] ?> |
| 135 | 135 | <?php if($id == $modx->config['default_template']) { |
| 136 | - echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>'; |
|
| 137 | - } ?> |
|
| 136 | + echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>'; |
|
| 137 | + } ?> |
|
| 138 | 138 | </label> |
| 139 | 139 | <div class="col-md-9 col-lg-10"> |
| 140 | 140 | <div class="form-control-name clearfix"> |
@@ -162,11 +162,11 @@ discard block |
||
| 162 | 162 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
| 163 | 163 | <option> </option> |
| 164 | 164 | <?php |
| 165 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 166 | - foreach(getCategories() as $n => $v) { |
|
| 167 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>"; |
|
| 168 | - } |
|
| 169 | - ?> |
|
| 165 | + include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 166 | + foreach(getCategories() as $n => $v) { |
|
| 167 | + echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>"; |
|
| 168 | + } |
|
| 169 | + ?> |
|
| 170 | 170 | </select> |
| 171 | 171 | </div> |
| 172 | 172 | </div> |
@@ -197,38 +197,38 @@ discard block |
||
| 197 | 197 | <input type="submit" name="save" style="display:none"> |
| 198 | 198 | |
| 199 | 199 | <?php |
| 200 | - $selectedTvs = array(); |
|
| 201 | - if(!isset($_POST['assignedTv'])) { |
|
| 202 | - $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv |
|
| 200 | + $selectedTvs = array(); |
|
| 201 | + if(!isset($_POST['assignedTv'])) { |
|
| 202 | + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv |
|
| 203 | 203 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid |
| 204 | 204 | LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC" // workaround for correct sort of none-existing ranks |
| 205 | - ); |
|
| 206 | - while($row = $modx->db->getRow($rs)) { |
|
| 207 | - $selectedTvs[$row['tvid']] = $row; |
|
| 208 | - } |
|
| 209 | - $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC |
|
| 210 | - } |
|
| 211 | - |
|
| 212 | - $unselectedTvs = array(); |
|
| 213 | - $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv |
|
| 205 | + ); |
|
| 206 | + while($row = $modx->db->getRow($rs)) { |
|
| 207 | + $selectedTvs[$row['tvid']] = $row; |
|
| 208 | + } |
|
| 209 | + $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC |
|
| 210 | + } |
|
| 211 | + |
|
| 212 | + $unselectedTvs = array(); |
|
| 213 | + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv |
|
| 214 | 214 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid |
| 215 | 215 | LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption"); |
| 216 | - while($row = $modx->db->getRow($rs)) { |
|
| 217 | - $unselectedTvs[$row['tvid']] = $row; |
|
| 218 | - } |
|
| 219 | - |
|
| 220 | - // Catch checkboxes if form not validated |
|
| 221 | - if(isset($_POST['assignedTv'])) { |
|
| 222 | - $selectedTvs = array(); |
|
| 223 | - foreach($_POST['assignedTv'] as $tvid) { |
|
| 224 | - if(isset($unselectedTvs[$tvid])) { |
|
| 225 | - $selectedTvs[$tvid] = $unselectedTvs[$tvid]; |
|
| 226 | - } |
|
| 227 | - }; |
|
| 228 | - } |
|
| 229 | - |
|
| 230 | - $total = count($selectedTvs); |
|
| 231 | - ?> |
|
| 216 | + while($row = $modx->db->getRow($rs)) { |
|
| 217 | + $unselectedTvs[$row['tvid']] = $row; |
|
| 218 | + } |
|
| 219 | + |
|
| 220 | + // Catch checkboxes if form not validated |
|
| 221 | + if(isset($_POST['assignedTv'])) { |
|
| 222 | + $selectedTvs = array(); |
|
| 223 | + foreach($_POST['assignedTv'] as $tvid) { |
|
| 224 | + if(isset($unselectedTvs[$tvid])) { |
|
| 225 | + $selectedTvs[$tvid] = $unselectedTvs[$tvid]; |
|
| 226 | + } |
|
| 227 | + }; |
|
| 228 | + } |
|
| 229 | + |
|
| 230 | + $total = count($selectedTvs); |
|
| 231 | + ?> |
|
| 232 | 232 | </div> |
| 233 | 233 | |
| 234 | 234 | <div class="tab-page" id="tabAssignedTVs"> |
@@ -238,65 +238,65 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | <div class="container container-body"> |
| 240 | 240 | <?php |
| 241 | - if($total > 0) { |
|
| 242 | - echo '<p>' . $_lang['template_tv_msg'] . '</p>'; |
|
| 243 | - } |
|
| 244 | - if($modx->hasPermission('save_template') && $total > 1 && $id) { |
|
| 245 | - echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&id=%s">%s</a></div>', $id, $_lang['template_tv_edit']); |
|
| 246 | - } |
|
| 247 | - |
|
| 248 | - // Selected TVs |
|
| 249 | - $tvList = ''; |
|
| 250 | - if($total > 0) { |
|
| 251 | - $tvList .= '<ul>'; |
|
| 252 | - foreach($selectedTvs as $row) { |
|
| 253 | - $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
| 254 | - $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
| 255 | - $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
|
| 256 | - } |
|
| 257 | - $tvList .= '</ul>'; |
|
| 258 | - |
|
| 259 | - } else { |
|
| 260 | - echo $_lang['template_no_tv']; |
|
| 261 | - } |
|
| 262 | - echo $tvList; |
|
| 263 | - |
|
| 264 | - // Unselected TVs |
|
| 265 | - $tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>'; |
|
| 266 | - $preCat = ''; |
|
| 267 | - $insideUl = 0; |
|
| 268 | - while($row = array_shift($unselectedTvs)) { |
|
| 269 | - if(isset($selectedTvs[$row['tvid']])) { |
|
| 270 | - continue; |
|
| 271 | - } // Skip selected |
|
| 272 | - $row['category'] = stripslashes($row['category']); //pixelchutes |
|
| 273 | - if($preCat !== $row['category']) { |
|
| 274 | - $tvList .= $insideUl ? '</ul>' : ''; |
|
| 275 | - $tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
| 276 | - $insideUl = 1; |
|
| 277 | - } |
|
| 278 | - |
|
| 279 | - $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
| 280 | - $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
| 281 | - $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
|
| 282 | - $tvList .= '</li>'; |
|
| 283 | - |
|
| 284 | - $preCat = $row['category']; |
|
| 285 | - } |
|
| 286 | - $tvList .= $insideUl ? '</ul>' : ''; |
|
| 287 | - $tvList .= '</ul>'; |
|
| 288 | - echo $tvList; |
|
| 289 | - |
|
| 290 | - ?> |
|
| 241 | + if($total > 0) { |
|
| 242 | + echo '<p>' . $_lang['template_tv_msg'] . '</p>'; |
|
| 243 | + } |
|
| 244 | + if($modx->hasPermission('save_template') && $total > 1 && $id) { |
|
| 245 | + echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&id=%s">%s</a></div>', $id, $_lang['template_tv_edit']); |
|
| 246 | + } |
|
| 247 | + |
|
| 248 | + // Selected TVs |
|
| 249 | + $tvList = ''; |
|
| 250 | + if($total > 0) { |
|
| 251 | + $tvList .= '<ul>'; |
|
| 252 | + foreach($selectedTvs as $row) { |
|
| 253 | + $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
| 254 | + $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
| 255 | + $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
|
| 256 | + } |
|
| 257 | + $tvList .= '</ul>'; |
|
| 258 | + |
|
| 259 | + } else { |
|
| 260 | + echo $_lang['template_no_tv']; |
|
| 261 | + } |
|
| 262 | + echo $tvList; |
|
| 263 | + |
|
| 264 | + // Unselected TVs |
|
| 265 | + $tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>'; |
|
| 266 | + $preCat = ''; |
|
| 267 | + $insideUl = 0; |
|
| 268 | + while($row = array_shift($unselectedTvs)) { |
|
| 269 | + if(isset($selectedTvs[$row['tvid']])) { |
|
| 270 | + continue; |
|
| 271 | + } // Skip selected |
|
| 272 | + $row['category'] = stripslashes($row['category']); //pixelchutes |
|
| 273 | + if($preCat !== $row['category']) { |
|
| 274 | + $tvList .= $insideUl ? '</ul>' : ''; |
|
| 275 | + $tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
| 276 | + $insideUl = 1; |
|
| 277 | + } |
|
| 278 | + |
|
| 279 | + $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
| 280 | + $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
| 281 | + $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
|
| 282 | + $tvList .= '</li>'; |
|
| 283 | + |
|
| 284 | + $preCat = $row['category']; |
|
| 285 | + } |
|
| 286 | + $tvList .= $insideUl ? '</ul>' : ''; |
|
| 287 | + $tvList .= '</ul>'; |
|
| 288 | + echo $tvList; |
|
| 289 | + |
|
| 290 | + ?> |
|
| 291 | 291 | </div> |
| 292 | 292 | </div> |
| 293 | 293 | |
| 294 | 294 | <?php |
| 295 | - // invoke OnTempFormRender event |
|
| 296 | - $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); |
|
| 297 | - if(is_array($evtOut)) { |
|
| 298 | - echo implode("", $evtOut); |
|
| 299 | - } |
|
| 300 | - ?> |
|
| 295 | + // invoke OnTempFormRender event |
|
| 296 | + $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); |
|
| 297 | + if(is_array($evtOut)) { |
|
| 298 | + echo implode("", $evtOut); |
|
| 299 | + } |
|
| 300 | + ?> |
|
| 301 | 301 | </div> |
| 302 | 302 | </form> |
@@ -4,18 +4,18 @@ |
||
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | switch($modx->manager->action) { |
| 7 | - case 16: |
|
| 8 | - if(!$modx->hasPermission('edit_template')) { |
|
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | - } |
|
| 11 | - break; |
|
| 12 | - case 19: |
|
| 13 | - if(!$modx->hasPermission('new_template')) { |
|
| 14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | - } |
|
| 16 | - break; |
|
| 17 | - default: |
|
| 18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | + case 16: |
|
| 8 | + if(!$modx->hasPermission('edit_template')) { |
|
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | + } |
|
| 11 | + break; |
|
| 12 | + case 19: |
|
| 13 | + if(!$modx->hasPermission('new_template')) { |
|
| 14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | + } |
|
| 16 | + break; |
|
| 17 | + default: |
|
| 18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") { |
|
| 2 | +if (IN_MANAGER_MODE != "true") { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -switch($modx->manager->action) { |
|
| 6 | +switch ($modx->manager->action) { |
|
| 7 | 7 | case 16: |
| 8 | - if(!$modx->hasPermission('edit_template')) { |
|
| 8 | + if (!$modx->hasPermission('edit_template')) { |
|
| 9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 10 | 10 | } |
| 11 | 11 | break; |
| 12 | 12 | case 19: |
| 13 | - if(!$modx->hasPermission('new_template')) { |
|
| 13 | + if (!$modx->hasPermission('new_template')) { |
|
| 14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 15 | 15 | } |
| 16 | 16 | break; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $tbl_site_templates = $modx->getFullTableName('site_templates'); |
| 24 | 24 | |
| 25 | 25 | // check to see the snippet editor isn't locked |
| 26 | -if($lockedEl = $modx->elementIsLocked(1, $id)) { |
|
| 26 | +if ($lockedEl = $modx->elementIsLocked(1, $id)) { |
|
| 27 | 27 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); |
| 28 | 28 | } |
| 29 | 29 | // end check for lock |
@@ -32,15 +32,15 @@ discard block |
||
| 32 | 32 | $modx->lockElement(1, $id); |
| 33 | 33 | |
| 34 | 34 | $content = array(); |
| 35 | -if(!empty($id)) { |
|
| 35 | +if (!empty($id)) { |
|
| 36 | 36 | $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); |
| 37 | 37 | $content = $modx->db->getRow($rs); |
| 38 | - if(!$content) { |
|
| 38 | + if (!$content) { |
|
| 39 | 39 | $modx->webAlertAndQuit("No database record has been found for this template."); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $_SESSION['itemname'] = $content['templatename']; |
| 43 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
| 43 | + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
| 44 | 44 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 45 | 45 | } |
| 46 | 46 | } else { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $content['category'] = intval($_REQUEST['catid']); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | -if($modx->manager->hasFormValues()) { |
|
| 51 | +if ($modx->manager->hasFormValues()) { |
|
| 52 | 52 | $modx->manager->loadFormValues(); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | // Add lock-element JS-Script |
| 59 | 59 | $lockElementId = $id; |
| 60 | 60 | $lockElementType = 1; |
| 61 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
| 61 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
| 62 | 62 | ?> |
| 63 | 63 | <script type="text/javascript"> |
| 64 | 64 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | <?php |
| 101 | 101 | // invoke OnTempFormPrerender event |
| 102 | 102 | $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); |
| 103 | - if(is_array($evtOut)) { |
|
| 103 | + if (is_array($evtOut)) { |
|
| 104 | 104 | echo implode("", $evtOut); |
| 105 | 105 | } |
| 106 | 106 | ?> |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
| 110 | 110 | |
| 111 | 111 | <h1> |
| 112 | - <i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i> |
|
| 112 | + <i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'].'<small>('.$content['id'].')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i> |
|
| 113 | 113 | </h1> |
| 114 | 114 | |
| 115 | 115 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -132,15 +132,15 @@ discard block |
||
| 132 | 132 | <div class="row form-row"> |
| 133 | 133 | <label class="col-md-3 col-lg-2"> |
| 134 | 134 | <?= $_lang['template_name'] ?> |
| 135 | - <?php if($id == $modx->config['default_template']) { |
|
| 136 | - echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>'; |
|
| 135 | + <?php if ($id == $modx->config['default_template']) { |
|
| 136 | + echo '<small class="form-text text-danger">'.mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset).'</small>'; |
|
| 137 | 137 | } ?> |
| 138 | 138 | </label> |
| 139 | 139 | <div class="col-md-9 col-lg-10"> |
| 140 | 140 | <div class="form-control-name clearfix"> |
| 141 | 141 | <input name="templatename" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['templatename']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;"> |
| 142 | - <?php if($modx->hasPermission('save_role')): ?> |
|
| 143 | - <label class="custom-control" title="<?= $_lang['lock_template'] . "\n" . $_lang['lock_template_msg'] ?>" tooltip> |
|
| 142 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
| 143 | + <label class="custom-control" title="<?= $_lang['lock_template']."\n".$_lang['lock_template_msg'] ?>" tooltip> |
|
| 144 | 144 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
| 145 | 145 | <i class="fa fa-lock"></i> |
| 146 | 146 | </label> |
@@ -162,9 +162,9 @@ discard block |
||
| 162 | 162 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
| 163 | 163 | <option> </option> |
| 164 | 164 | <?php |
| 165 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 166 | - foreach(getCategories() as $n => $v) { |
|
| 167 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>"; |
|
| 165 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 166 | + foreach (getCategories() as $n => $v) { |
|
| 167 | + echo "<option value='".$v['id']."'".($content["category"] == $v["id"] ? " selected='selected'" : "").">".$modx->htmlspecialchars($v["category"])."</option>"; |
|
| 168 | 168 | } |
| 169 | 169 | ?> |
| 170 | 170 | </select> |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | </div> |
| 178 | 178 | </div> |
| 179 | 179 | </div> |
| 180 | - <?php if($modx->hasPermission('save_role')): ?> |
|
| 180 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
| 181 | 181 | <div class="form-group"> |
| 182 | 182 | <label> |
| 183 | 183 | <input name="selectable" type="checkbox"<?= ($selectable == 1 ? ' checked="checked"' : '') ?> /> <?= $_lang['template_selectable'] ?></label> |
@@ -198,30 +198,30 @@ discard block |
||
| 198 | 198 | |
| 199 | 199 | <?php |
| 200 | 200 | $selectedTvs = array(); |
| 201 | - if(!isset($_POST['assignedTv'])) { |
|
| 201 | + if (!isset($_POST['assignedTv'])) { |
|
| 202 | 202 | $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv |
| 203 | 203 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid |
| 204 | 204 | LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC" // workaround for correct sort of none-existing ranks |
| 205 | 205 | ); |
| 206 | - while($row = $modx->db->getRow($rs)) { |
|
| 206 | + while ($row = $modx->db->getRow($rs)) { |
|
| 207 | 207 | $selectedTvs[$row['tvid']] = $row; |
| 208 | 208 | } |
| 209 | - $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC |
|
| 209 | + $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | $unselectedTvs = array(); |
| 213 | 213 | $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv |
| 214 | 214 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid |
| 215 | 215 | LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption"); |
| 216 | - while($row = $modx->db->getRow($rs)) { |
|
| 216 | + while ($row = $modx->db->getRow($rs)) { |
|
| 217 | 217 | $unselectedTvs[$row['tvid']] = $row; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | // Catch checkboxes if form not validated |
| 221 | - if(isset($_POST['assignedTv'])) { |
|
| 221 | + if (isset($_POST['assignedTv'])) { |
|
| 222 | 222 | $selectedTvs = array(); |
| 223 | - foreach($_POST['assignedTv'] as $tvid) { |
|
| 224 | - if(isset($unselectedTvs[$tvid])) { |
|
| 223 | + foreach ($_POST['assignedTv'] as $tvid) { |
|
| 224 | + if (isset($unselectedTvs[$tvid])) { |
|
| 225 | 225 | $selectedTvs[$tvid] = $unselectedTvs[$tvid]; |
| 226 | 226 | } |
| 227 | 227 | }; |
@@ -238,20 +238,20 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | <div class="container container-body"> |
| 240 | 240 | <?php |
| 241 | - if($total > 0) { |
|
| 242 | - echo '<p>' . $_lang['template_tv_msg'] . '</p>'; |
|
| 241 | + if ($total > 0) { |
|
| 242 | + echo '<p>'.$_lang['template_tv_msg'].'</p>'; |
|
| 243 | 243 | } |
| 244 | - if($modx->hasPermission('save_template') && $total > 1 && $id) { |
|
| 244 | + if ($modx->hasPermission('save_template') && $total > 1 && $id) { |
|
| 245 | 245 | echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&id=%s">%s</a></div>', $id, $_lang['template_tv_edit']); |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | // Selected TVs |
| 249 | 249 | $tvList = ''; |
| 250 | - if($total > 0) { |
|
| 250 | + if ($total > 0) { |
|
| 251 | 251 | $tvList .= '<ul>'; |
| 252 | - foreach($selectedTvs as $row) { |
|
| 253 | - $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
| 254 | - $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
| 252 | + foreach ($selectedTvs as $row) { |
|
| 253 | + $desc = !empty($row['tvdescription']) ? ' <small>('.$row['tvdescription'].')</small>' : ''; |
|
| 254 | + $locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : ""; |
|
| 255 | 255 | $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
| 256 | 256 | } |
| 257 | 257 | $tvList .= '</ul>'; |
@@ -262,22 +262,22 @@ discard block |
||
| 262 | 262 | echo $tvList; |
| 263 | 263 | |
| 264 | 264 | // Unselected TVs |
| 265 | - $tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>'; |
|
| 265 | + $tvList = '<hr/><p>'.$_lang['template_notassigned_tv'].'</p><ul>'; |
|
| 266 | 266 | $preCat = ''; |
| 267 | 267 | $insideUl = 0; |
| 268 | - while($row = array_shift($unselectedTvs)) { |
|
| 269 | - if(isset($selectedTvs[$row['tvid']])) { |
|
| 268 | + while ($row = array_shift($unselectedTvs)) { |
|
| 269 | + if (isset($selectedTvs[$row['tvid']])) { |
|
| 270 | 270 | continue; |
| 271 | 271 | } // Skip selected |
| 272 | 272 | $row['category'] = stripslashes($row['category']); //pixelchutes |
| 273 | - if($preCat !== $row['category']) { |
|
| 273 | + if ($preCat !== $row['category']) { |
|
| 274 | 274 | $tvList .= $insideUl ? '</ul>' : ''; |
| 275 | - $tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
| 275 | + $tvList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>'; |
|
| 276 | 276 | $insideUl = 1; |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
| 280 | - $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
| 279 | + $desc = !empty($row['tvdescription']) ? ' <small>('.$row['tvdescription'].')</small>' : ''; |
|
| 280 | + $locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : ""; |
|
| 281 | 281 | $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
| 282 | 282 | $tvList .= '</li>'; |
| 283 | 283 | |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | <?php |
| 295 | 295 | // invoke OnTempFormRender event |
| 296 | 296 | $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); |
| 297 | - if(is_array($evtOut)) { |
|
| 297 | + if (is_array($evtOut)) { |
|
| 298 | 298 | echo implode("", $evtOut); |
| 299 | 299 | } |
| 300 | 300 | ?> |
@@ -177,9 +177,9 @@ |
||
| 177 | 177 | <td colspan="2"><div class="split"></div></td> |
| 178 | 178 | </tr> |
| 179 | 179 | <?php |
| 180 | - // Check for GD before allowing captcha to be enabled |
|
| 181 | - $gdAvailable = extension_loaded('gd');
|
|
| 182 | - ?> |
|
| 180 | + // Check for GD before allowing captcha to be enabled |
|
| 181 | + $gdAvailable = extension_loaded('gd');
|
|
| 182 | + ?> |
|
| 183 | 183 | <?php |
| 184 | 184 | $gdAvailable = extension_loaded('gd');
|
| 185 | 185 | if(!$gdAvailable) $use_captcha = 0; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | $MODX_SITE_HOSTNAMES = MODX_SITE_HOSTNAMES; // Fix for PHP 5.4 |
| 3 | - if(empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) $valid_hostnames = $_SERVER['HTTP_HOST']; |
|
| 3 | + if (empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) $valid_hostnames = $_SERVER['HTTP_HOST']; |
|
| 4 | 4 | ?> |
| 5 | 5 | <!-- Interface & editor settings --> |
| 6 | 6 | <div class="tab-page" id="tabPageSecurity"> |
@@ -11,10 +11,10 @@ discard block |
||
| 11 | 11 | <tr> |
| 12 | 12 | <th><?php echo $_lang['allow_eval_title']; ?><br><small>[(allow_eval)]</small></th> |
| 13 | 13 | <td> |
| 14 | -<?php echo wrap_label($_lang['allow_eval_with_scan'] , form_radio('allow_eval','with_scan'));?><br />
|
|
| 15 | -<?php echo wrap_label($_lang['allow_eval_with_scan_at_post'] , form_radio('allow_eval','with_scan_at_post'));?><br />
|
|
| 16 | -<?php echo wrap_label($_lang['allow_eval_everytime_eval'] , form_radio('allow_eval','everytime_eval'));?><br />
|
|
| 17 | -<?php echo wrap_label($_lang['allow_eval_dont_eval'] , form_radio('allow_eval','dont_eval'));?>
|
|
| 14 | +<?php echo wrap_label($_lang['allow_eval_with_scan'], form_radio('allow_eval', 'with_scan')); ?><br />
|
|
| 15 | +<?php echo wrap_label($_lang['allow_eval_with_scan_at_post'], form_radio('allow_eval', 'with_scan_at_post')); ?><br />
|
|
| 16 | +<?php echo wrap_label($_lang['allow_eval_everytime_eval'], form_radio('allow_eval', 'everytime_eval')); ?><br />
|
|
| 17 | +<?php echo wrap_label($_lang['allow_eval_dont_eval'], form_radio('allow_eval', 'dont_eval')); ?>
|
|
| 18 | 18 | <div class="comment"> |
| 19 | 19 | <?php echo $_lang['allow_eval_msg'] ?> |
| 20 | 20 | </div> |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | <tr> |
| 40 | 40 | <th><?php echo $_lang['check_files_onlogin_title'] ?><br><small>[(check_files_onlogin)]</small></th> |
| 41 | 41 | <td> |
| 42 | - <textarea name="check_files_onlogin"><?php echo $check_files_onlogin;?></textarea><br /> |
|
| 42 | + <textarea name="check_files_onlogin"><?php echo $check_files_onlogin; ?></textarea><br /> |
|
| 43 | 43 | |
| 44 | 44 | </td> |
| 45 | 45 | </tr> |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | <tr> |
| 50 | 50 | <td nowrap class="warning"><?php echo $_lang['validate_referer_title'] ?><br><small>[(validate_referer)]</small></td> |
| 51 | 51 | <td> |
| 52 | - <?php echo wrap_label($_lang['yes'],form_radio('validate_referer', 1));?><br />
|
|
| 53 | - <?php echo wrap_label($_lang['no'], form_radio('validate_referer', 0));?>
|
|
| 52 | + <?php echo wrap_label($_lang['yes'], form_radio('validate_referer', 1)); ?><br />
|
|
| 53 | + <?php echo wrap_label($_lang['no'], form_radio('validate_referer', 0)); ?>
|
|
| 54 | 54 | </td> |
| 55 | 55 | </tr> |
| 56 | 56 | <tr> |
@@ -85,25 +85,25 @@ discard block |
||
| 85 | 85 | <tr> |
| 86 | 86 | <th><?php echo $_lang['a17_error_reporting_title']; ?><br><small>[(error_reporting)]</small></th> |
| 87 | 87 | <td> |
| 88 | -<?php echo wrap_label($_lang['a17_error_reporting_opt0'], form_radio('error_reporting','0'));?><br />
|
|
| 89 | -<?php echo wrap_label($_lang['a17_error_reporting_opt1'], form_radio('error_reporting','1'));?><br />
|
|
| 90 | -<?php echo wrap_label($_lang['a17_error_reporting_opt2'], form_radio('error_reporting','2'));?><br />
|
|
| 91 | -<?php echo wrap_label($_lang['a17_error_reporting_opt99'],form_radio('error_reporting','99'));?>
|
|
| 88 | +<?php echo wrap_label($_lang['a17_error_reporting_opt0'], form_radio('error_reporting', '0')); ?><br />
|
|
| 89 | +<?php echo wrap_label($_lang['a17_error_reporting_opt1'], form_radio('error_reporting', '1')); ?><br />
|
|
| 90 | +<?php echo wrap_label($_lang['a17_error_reporting_opt2'], form_radio('error_reporting', '2')); ?><br />
|
|
| 91 | +<?php echo wrap_label($_lang['a17_error_reporting_opt99'], form_radio('error_reporting', '99')); ?>
|
|
| 92 | 92 | </td> |
| 93 | 93 | </tr> |
| 94 | 94 | <tr> |
| 95 | 95 | <td width="200"> </td> |
| 96 | - <td class="comment"> <?php echo $_lang['a17_error_reporting_msg'];?></td> |
|
| 96 | + <td class="comment"> <?php echo $_lang['a17_error_reporting_msg']; ?></td> |
|
| 97 | 97 | </tr> |
| 98 | 98 | <tr><td colspan="2"><div class="split"></div></td></tr> |
| 99 | 99 | <tr> |
| 100 | 100 | <th><?php echo $_lang['mutate_settings.dynamic.php6']; ?><br><small>[(send_errormail)]</small></th> |
| 101 | 101 | <td> |
| 102 | -<?php echo wrap_label($_lang['mutate_settings.dynamic.php7'],form_radio('send_errormail','0'));?><br />
|
|
| 103 | -<?php echo wrap_label('error',form_radio('send_errormail','3'));?><br />
|
|
| 104 | -<?php echo wrap_label('error + warning',form_radio('send_errormail','2'));?><br />
|
|
| 105 | -<?php echo wrap_label('error + warning + information',form_radio('send_errormail','1'));?><br />
|
|
| 106 | -<?php echo parseText($_lang['mutate_settings.dynamic.php8'],array('emailsender'=>$modx->config['emailsender']));?></td>
|
|
| 102 | +<?php echo wrap_label($_lang['mutate_settings.dynamic.php7'], form_radio('send_errormail', '0')); ?><br />
|
|
| 103 | +<?php echo wrap_label('error', form_radio('send_errormail', '3')); ?><br />
|
|
| 104 | +<?php echo wrap_label('error + warning', form_radio('send_errormail', '2')); ?><br />
|
|
| 105 | +<?php echo wrap_label('error + warning + information', form_radio('send_errormail', '1')); ?><br />
|
|
| 106 | +<?php echo parseText($_lang['mutate_settings.dynamic.php8'], array('emailsender'=>$modx->config['emailsender'])); ?></td>
|
|
| 107 | 107 | </tr> |
| 108 | 108 | <tr> |
| 109 | 109 | <td colspan="2"><div class="split"></div></td> |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | <tr> |
| 112 | 112 | <th><?php echo $_lang['enable_bindings_title'] ?><br><small>[(enable_bindings)]</small></th> |
| 113 | 113 | <td> |
| 114 | -<?php echo wrap_label($_lang['yes'],form_radio('enable_bindings','1'));?><br />
|
|
| 115 | -<?php echo wrap_label($_lang['no'], form_radio('enable_bindings','0'));?>
|
|
| 114 | +<?php echo wrap_label($_lang['yes'], form_radio('enable_bindings', '1')); ?><br />
|
|
| 115 | +<?php echo wrap_label($_lang['no'], form_radio('enable_bindings', '0')); ?>
|
|
| 116 | 116 | |
| 117 | 117 | </td> |
| 118 | 118 | </tr> |
@@ -153,20 +153,20 @@ discard block |
||
| 153 | 153 | <th><?php echo $_lang['pwd_hash_algo_title'] ?><br><small>[(pwd_hash_algo)]</small></th> |
| 154 | 154 | <td> |
| 155 | 155 | <?php |
| 156 | -if(empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1; |
|
| 157 | -$phm['e']['BLOWFISH_Y'] = $modx->manager->checkHashAlgorithm('BLOWFISH_Y') ? 0:1;
|
|
| 158 | -$phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0:1;
|
|
| 159 | -$phm['e']['SHA512'] = $modx->manager->checkHashAlgorithm('SHA512') ? 0:1;
|
|
| 160 | -$phm['e']['SHA256'] = $modx->manager->checkHashAlgorithm('SHA256') ? 0:1;
|
|
| 161 | -$phm['e']['MD5'] = $modx->manager->checkHashAlgorithm('MD5') ? 0:1;
|
|
| 162 | -$phm['e']['UNCRYPT'] = $modx->manager->checkHashAlgorithm('UNCRYPT') ? 0:1;
|
|
| 156 | +if (empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1; |
|
| 157 | +$phm['e']['BLOWFISH_Y'] = $modx->manager->checkHashAlgorithm('BLOWFISH_Y') ? 0 : 1;
|
|
| 158 | +$phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0 : 1;
|
|
| 159 | +$phm['e']['SHA512'] = $modx->manager->checkHashAlgorithm('SHA512') ? 0 : 1;
|
|
| 160 | +$phm['e']['SHA256'] = $modx->manager->checkHashAlgorithm('SHA256') ? 0 : 1;
|
|
| 161 | +$phm['e']['MD5'] = $modx->manager->checkHashAlgorithm('MD5') ? 0 : 1;
|
|
| 162 | +$phm['e']['UNCRYPT'] = $modx->manager->checkHashAlgorithm('UNCRYPT') ? 0 : 1;
|
|
| 163 | 163 | ?> |
| 164 | -<?php echo wrap_label('CRYPT_BLOWFISH_Y (salt & stretch)',form_radio('pwd_hash_algo','BLOWFISH_Y', '', $phm['e']['BLOWFISH_Y']));?><br />
|
|
| 165 | -<?php echo wrap_label('CRYPT_BLOWFISH_A (salt & stretch)',form_radio('pwd_hash_algo','BLOWFISH_A', '', $phm['e']['BLOWFISH_A']));?><br />
|
|
| 166 | -<?php echo wrap_label('CRYPT_SHA512 (salt & stretch)' ,form_radio('pwd_hash_algo','SHA512' , '', $phm['e']['SHA512']));?><br />
|
|
| 167 | -<?php echo wrap_label('CRYPT_SHA256 (salt & stretch)' ,form_radio('pwd_hash_algo','SHA256' , '', $phm['e']['SHA256']));?><br />
|
|
| 168 | -<?php echo wrap_label('CRYPT_MD5 (salt & stretch)' ,form_radio('pwd_hash_algo','MD5' , '', $phm['e']['MD5']));?><br />
|
|
| 169 | -<?php echo wrap_label('UNCRYPT(32 chars salt + SHA-1 hash)' ,form_radio('pwd_hash_algo','UNCRYPT' , '', $phm['e']['UNCRYPT']));?>
|
|
| 164 | +<?php echo wrap_label('CRYPT_BLOWFISH_Y (salt & stretch)', form_radio('pwd_hash_algo', 'BLOWFISH_Y', '', $phm['e']['BLOWFISH_Y'])); ?><br />
|
|
| 165 | +<?php echo wrap_label('CRYPT_BLOWFISH_A (salt & stretch)', form_radio('pwd_hash_algo', 'BLOWFISH_A', '', $phm['e']['BLOWFISH_A'])); ?><br />
|
|
| 166 | +<?php echo wrap_label('CRYPT_SHA512 (salt & stretch)', form_radio('pwd_hash_algo', 'SHA512', '', $phm['e']['SHA512'])); ?><br />
|
|
| 167 | +<?php echo wrap_label('CRYPT_SHA256 (salt & stretch)', form_radio('pwd_hash_algo', 'SHA256', '', $phm['e']['SHA256'])); ?><br />
|
|
| 168 | +<?php echo wrap_label('CRYPT_MD5 (salt & stretch)', form_radio('pwd_hash_algo', 'MD5', '', $phm['e']['MD5'])); ?><br />
|
|
| 169 | +<?php echo wrap_label('UNCRYPT(32 chars salt + SHA-1 hash)', form_radio('pwd_hash_algo', 'UNCRYPT', '', $phm['e']['UNCRYPT'])); ?>
|
|
| 170 | 170 | </td> |
| 171 | 171 | </tr> |
| 172 | 172 | <tr> |
@@ -182,13 +182,13 @@ discard block |
||
| 182 | 182 | ?> |
| 183 | 183 | <?php |
| 184 | 184 | $gdAvailable = extension_loaded('gd');
|
| 185 | -if(!$gdAvailable) $use_captcha = 0; |
|
| 185 | +if (!$gdAvailable) $use_captcha = 0; |
|
| 186 | 186 | ?> |
| 187 | 187 | <tr> |
| 188 | 188 | <td nowrap class="warning"><?php echo $_lang['captcha_title'] ?><br><small>[(use_captcha)]</small></td> |
| 189 | - <td> <label><input type="radio" id="captchaOn" name="use_captcha" value="1" <?php echo ($use_captcha==1) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : ''; ?> /> |
|
| 189 | + <td> <label><input type="radio" id="captchaOn" name="use_captcha" value="1" <?php echo ($use_captcha == 1) ? 'checked="checked"' : ""; echo (!$gdAvailable) ? ' readonly="readonly"' : ''; ?> /> |
|
| 190 | 190 | <?php echo $_lang['yes']?></label><br /> |
| 191 | - <label><input type="radio" id="captchaOff" name="use_captcha" value="0" <?php echo ($use_captcha==0) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : '';?> /> |
|
| 191 | + <label><input type="radio" id="captchaOff" name="use_captcha" value="0" <?php echo ($use_captcha == 0) ? 'checked="checked"' : ""; echo (!$gdAvailable) ? ' readonly="readonly"' : ''; ?> /> |
|
| 192 | 192 | <?php echo $_lang['no']?></label> </td> |
| 193 | 193 | </tr> |
| 194 | 194 | <tr> |
@@ -198,23 +198,23 @@ discard block |
||
| 198 | 198 | <tr> |
| 199 | 199 | <td colspan="2"><div class="split"></div></td> |
| 200 | 200 | </tr> |
| 201 | - <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>> |
|
| 201 | + <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>> |
|
| 202 | 202 | <td nowrap class="warning"><?php echo $_lang['captcha_words_title'] ?><br><small>[(captcha_words)]</small> |
| 203 | 203 | <br /> |
| 204 | 204 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
| 205 | 205 | <select name="reload_captcha_words" id="reload_captcha_words_select" onchange="confirmLangChange(this, 'captcha_words_default', 'captcha_words_input');"> |
| 206 | -<?php echo get_lang_options('captcha_words_default');?>
|
|
| 206 | +<?php echo get_lang_options('captcha_words_default'); ?>
|
|
| 207 | 207 | </select> |
| 208 | 208 | </td> |
| 209 | 209 | <td><input type="text" id="captcha_words_input" name="captcha_words" style="width:250px" value="<?php echo $captcha_words; ?>" /> |
| 210 | - <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang['captcha_words_default']);?>" /> |
|
| 210 | + <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang['captcha_words_default']); ?>" /> |
|
| 211 | 211 | </td> |
| 212 | 212 | </tr> |
| 213 | - <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>> |
|
| 213 | + <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>> |
|
| 214 | 214 | <td width="200"> </td> |
| 215 | 215 | <td class="comment"><?php echo $_lang['captcha_words_message'] ?></td> |
| 216 | 216 | </tr> |
| 217 | - <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>> |
|
| 217 | + <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>> |
|
| 218 | 218 | <td colspan="2"><div class="split"></div></td> |
| 219 | 219 | </tr> |
| 220 | 220 | </table> |
@@ -1,7 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | $MODX_SITE_HOSTNAMES = MODX_SITE_HOSTNAMES; // Fix for PHP 5.4 |
| 3 | - if(empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) $valid_hostnames = $_SERVER['HTTP_HOST']; |
|
| 4 | -?> |
|
| 3 | + if(empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) { |
|
| 4 | + $valid_hostnames = $_SERVER['HTTP_HOST']; |
|
| 5 | + } |
|
| 6 | + ?> |
|
| 5 | 7 | <!-- Interface & editor settings --> |
| 6 | 8 | <div class="tab-page" id="tabPageSecurity"> |
| 7 | 9 | <h2 class="tab"><?php echo $_lang['settings_security'] ?></h2> |
@@ -153,7 +155,9 @@ discard block |
||
| 153 | 155 | <th><?php echo $_lang['pwd_hash_algo_title'] ?><br><small>[(pwd_hash_algo)]</small></th> |
| 154 | 156 | <td> |
| 155 | 157 | <?php |
| 156 | -if(empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1; |
|
| 158 | +if(empty($pwd_hash_algo)) { |
|
| 159 | + $phm['sel']['UNCRYPT'] = 1; |
|
| 160 | +} |
|
| 157 | 161 | $phm['e']['BLOWFISH_Y'] = $modx->manager->checkHashAlgorithm('BLOWFISH_Y') ? 0:1;
|
| 158 | 162 | $phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0:1;
|
| 159 | 163 | $phm['e']['SHA512'] = $modx->manager->checkHashAlgorithm('SHA512') ? 0:1;
|
@@ -182,7 +186,9 @@ discard block |
||
| 182 | 186 | ?> |
| 183 | 187 | <?php |
| 184 | 188 | $gdAvailable = extension_loaded('gd');
|
| 185 | -if(!$gdAvailable) $use_captcha = 0; |
|
| 189 | +if(!$gdAvailable) { |
|
| 190 | + $use_captcha = 0; |
|
| 191 | +} |
|
| 186 | 192 | ?> |
| 187 | 193 | <tr> |
| 188 | 194 | <td nowrap class="warning"><?php echo $_lang['captcha_title'] ?><br><small>[(use_captcha)]</small></td> |
@@ -6,8 +6,8 @@ discard block |
||
| 6 | 6 | <tr> |
| 7 | 7 | <td nowrap class="warning"><?php echo $_lang['udperms_title'] ?><br><small>[(use_udperms)]</small></td> |
| 8 | 8 | <td> |
| 9 | - <?php echo wrap_label($_lang['yes'],form_radio('use_udperms', 1, 'id="udPermsOn"'));?><br />
|
|
| 10 | - <?php echo wrap_label($_lang['no'], form_radio('use_udperms', 0, 'id="udPermsOff"'));?>
|
|
| 9 | + <?php echo wrap_label($_lang['yes'], form_radio('use_udperms', 1, 'id="udPermsOn"')); ?><br />
|
|
| 10 | + <?php echo wrap_label($_lang['no'], form_radio('use_udperms', 0, 'id="udPermsOff"')); ?>
|
|
| 11 | 11 | </td> |
| 12 | 12 | </tr> |
| 13 | 13 | <tr> |
@@ -17,16 +17,16 @@ discard block |
||
| 17 | 17 | <tr> |
| 18 | 18 | <td colspan="2"><div class="split"></div></td> |
| 19 | 19 | </tr> |
| 20 | - <tr class="udPerms" <?php echo showHide($use_udperms==1);?>> |
|
| 20 | + <tr class="udPerms" <?php echo showHide($use_udperms == 1); ?>> |
|
| 21 | 21 | <td nowrap class="warning"><?php echo $_lang['udperms_allowroot_title'] ?><br><small>[(udperms_allowroot)]</small></td> |
| 22 | 22 | <td> |
| 23 | - <label><input type="radio" name="udperms_allowroot" value="1" <?php echo $udperms_allowroot=='1' ? 'checked="checked"' : "" ; ?> /> |
|
| 23 | + <label><input type="radio" name="udperms_allowroot" value="1" <?php echo $udperms_allowroot == '1' ? 'checked="checked"' : ""; ?> /> |
|
| 24 | 24 | <?php echo $_lang['yes']?></label><br /> |
| 25 | - <label><input type="radio" name="udperms_allowroot" value="0" <?php echo $udperms_allowroot=='0' ? 'checked="checked"' : "" ; ?> /> |
|
| 25 | + <label><input type="radio" name="udperms_allowroot" value="0" <?php echo $udperms_allowroot == '0' ? 'checked="checked"' : ""; ?> /> |
|
| 26 | 26 | <?php echo $_lang['no']?></label> |
| 27 | 27 | </td> |
| 28 | 28 | </tr> |
| 29 | - <tr class="udPerms" <?php echo showHide($use_udperms==1);?>> |
|
| 29 | + <tr class="udPerms" <?php echo showHide($use_udperms == 1); ?>> |
|
| 30 | 30 | <td width="200"> </td> |
| 31 | 31 | <td class="comment"><?php echo $_lang['udperms_allowroot_message'] ?></td> |
| 32 | 32 | </tr> |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | <tr> |
| 40 | 40 | <td nowrap class="warning"><?php echo $_lang['email_method_title'] ?><br><small>[(email_method)]</small></td> |
| 41 | 41 | <td> |
| 42 | - <?php echo wrap_label($_lang['email_method_mail'],form_radio('email_method','mail','id="useMail"'));?><br />
|
|
| 43 | - <?php echo wrap_label($_lang['email_method_smtp'],form_radio('email_method','smtp','id="useSmtp"'));?>
|
|
| 44 | - <div class="smtpRow" <?php echo showHide($email_method=='smtp');?>> |
|
| 45 | - <?php include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/snippet_smtp.inc.php'); ?> |
|
| 42 | + <?php echo wrap_label($_lang['email_method_mail'], form_radio('email_method', 'mail', 'id="useMail"')); ?><br />
|
|
| 43 | + <?php echo wrap_label($_lang['email_method_smtp'], form_radio('email_method', 'smtp', 'id="useSmtp"')); ?>
|
|
| 44 | + <div class="smtpRow" <?php echo showHide($email_method == 'smtp'); ?>> |
|
| 45 | + <?php include_once(MODX_MANAGER_PATH.'actions/mutate_settings/snippet_smtp.inc.php'); ?> |
|
| 46 | 46 | </div> |
| 47 | 47 | </td> |
| 48 | 48 | </tr> |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | <br /> |
| 55 | 55 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
| 56 | 56 | <select name="reload_emailsubject" id="reload_emailsubject_select" onchange="confirmLangChange(this, 'emailsubject_default', 'emailsubject_field');"> |
| 57 | -<?php echo get_lang_options('emailsubject_default');?>
|
|
| 57 | +<?php echo get_lang_options('emailsubject_default'); ?>
|
|
| 58 | 58 | </select> |
| 59 | 59 | </td> |
| 60 | 60 | <td ><input id="emailsubject_field" name="emailsubject" onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" value="<?php echo $emailsubject; ?>" /> |
| 61 | - <input type="hidden" name="emailsubject_default" id="emailsubject_default_hidden" value="<?php echo addslashes($_lang['emailsubject_default']);?>" /> |
|
| 61 | + <input type="hidden" name="emailsubject_default" id="emailsubject_default_hidden" value="<?php echo addslashes($_lang['emailsubject_default']); ?>" /> |
|
| 62 | 62 | </td> |
| 63 | 63 | </tr> |
| 64 | 64 | <tr> |
@@ -73,11 +73,11 @@ discard block |
||
| 73 | 73 | <br /> |
| 74 | 74 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
| 75 | 75 | <select name="reload_signupemail_message" id="reload_signupemail_message_select" onchange="confirmLangChange(this, 'system_email_signup', 'signupemail_message_textarea');"> |
| 76 | -<?php echo get_lang_options('system_email_signup');?>
|
|
| 76 | +<?php echo get_lang_options('system_email_signup'); ?>
|
|
| 77 | 77 | </select> |
| 78 | 78 | </td> |
| 79 | 79 | <td> <textarea id="signupemail_message_textarea" name="signupemail_message" style="width:100%; height: 120px;"><?php echo $signupemail_message; ?></textarea> |
| 80 | - <input type="hidden" name="system_email_signup_default" id="system_email_signup_hidden" value="<?php echo addslashes($_lang['system_email_signup']);?>" /> |
|
| 80 | + <input type="hidden" name="system_email_signup_default" id="system_email_signup_hidden" value="<?php echo addslashes($_lang['system_email_signup']); ?>" /> |
|
| 81 | 81 | </td> |
| 82 | 82 | </tr> |
| 83 | 83 | <tr> |
@@ -92,11 +92,11 @@ discard block |
||
| 92 | 92 | <br /> |
| 93 | 93 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
| 94 | 94 | <select name="reload_websignupemail_message" id="reload_websignupemail_message_select" onchange="confirmLangChange(this, 'system_email_websignup', 'websignupemail_message_textarea');"> |
| 95 | -<?php echo get_lang_options('system_email_websignup');?>
|
|
| 95 | +<?php echo get_lang_options('system_email_websignup'); ?>
|
|
| 96 | 96 | </select> |
| 97 | 97 | </td> |
| 98 | 98 | <td> <textarea id="websignupemail_message_textarea" name="websignupemail_message" style="width:100%; height: 120px;"><?php echo $websignupemail_message; ?></textarea> |
| 99 | - <input type="hidden" name="system_email_websignup_default" id="system_email_websignup_hidden" value="<?php echo addslashes($_lang['system_email_websignup']);?>" /> |
|
| 99 | + <input type="hidden" name="system_email_websignup_default" id="system_email_websignup_hidden" value="<?php echo addslashes($_lang['system_email_websignup']); ?>" /> |
|
| 100 | 100 | </td> |
| 101 | 101 | </tr> |
| 102 | 102 | <tr> |
@@ -111,11 +111,11 @@ discard block |
||
| 111 | 111 | <br /> |
| 112 | 112 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
| 113 | 113 | <select name="reload_system_email_webreminder_message" id="reload_system_email_webreminder_select" onchange="confirmLangChange(this, 'system_email_webreminder', 'system_email_webreminder_textarea');"> |
| 114 | -<?php echo get_lang_options('system_email_webreminder');?>
|
|
| 114 | +<?php echo get_lang_options('system_email_webreminder'); ?>
|
|
| 115 | 115 | </select> |
| 116 | 116 | </td> |
| 117 | 117 | <td> <textarea id="system_email_webreminder_textarea" name="webpwdreminder_message" style="width:100%; height: 120px;"><?php echo $webpwdreminder_message; ?></textarea> |
| 118 | - <input type="hidden" name="system_email_webreminder_default" id="system_email_webreminder_hidden" value="<?php echo addslashes($_lang['system_email_webreminder']);?>" /> |
|
| 118 | + <input type="hidden" name="system_email_webreminder_default" id="system_email_webreminder_hidden" value="<?php echo addslashes($_lang['system_email_webreminder']); ?>" /> |
|
| 119 | 119 | </td> |
| 120 | 120 | </tr> |
| 121 | 121 | <tr> |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | <?php |
| 128 | 128 | // invoke OnUserSettingsRender event |
| 129 | 129 | $evtOut = $modx->invokeEvent('OnUserSettingsRender');
|
| 130 | - if(is_array($evtOut)) echo implode("",$evtOut);
|
|
| 130 | + if (is_array($evtOut)) echo implode("", $evtOut);
|
|
| 131 | 131 | ?> |
| 132 | 132 | </td> |
| 133 | 133 | </tr> |
@@ -127,7 +127,9 @@ |
||
| 127 | 127 | <?php |
| 128 | 128 | // invoke OnUserSettingsRender event |
| 129 | 129 | $evtOut = $modx->invokeEvent('OnUserSettingsRender');
|
| 130 | - if(is_array($evtOut)) echo implode("",$evtOut);
|
|
| 130 | + if(is_array($evtOut)) { |
|
| 131 | + echo implode("",$evtOut); |
|
| 132 | + } |
|
| 131 | 133 | ?> |
| 132 | 134 | </td> |
| 133 | 135 | </tr> |