Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
retypos-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eterfund
retypos-server
Commits
6836a8bd
Commit
6836a8bd
authored
Mar 30, 2018
by
George Popoff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил новое view вместо старого, старый пока переименовал. Добавил объявление…
Добавил новое view вместо старого, старый пока переименовал. Добавил объявление неявных полей в контроллере
parent
8952cfc7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
100 deletions
+25
-100
Typos.php
cp/application/controllers/users/Typos.php
+20
-0
typos.php
cp/application/views/users/typos.php
+5
-100
No files found.
cp/application/controllers/users/Typos.php
View file @
6836a8bd
...
@@ -5,6 +5,26 @@ if ( ! defined('BASEPATH')) exit('No direct script access allowed');
...
@@ -5,6 +5,26 @@ if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*Работа с опечатками - пользователь*/
/*Работа с опечатками - пользователь*/
class
Typos
extends
CI_Controller
{
class
Typos
extends
CI_Controller
{
/* @var $session CI_Session */
public
$session
;
/* @var $config CI_Config */
public
$config
;
/* @var $input CI_Input */
protected
$input
;
/* @var $typo Typo */
public
$typo
;
/* user id */
private
$login_id
;
private
$header_name
;
private
$view_name
;
private
$menu_name
;
private
$footer_name
;
function
__construct
()
{
function
__construct
()
{
parent
::
__construct
();
parent
::
__construct
();
...
...
cp/application/views/users/typos.php
View file @
6836a8bd
<div
class=
"body"
>
<!-- -->
<link
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
href=
"
<?=
$base_url
?>
javascript/jquery_plugins/jqGrid/4.4.0/css/ui.jqgrid.css"
/>
<div
class=
"body"
>
<h1>
Here we are!
</h1>
<script
type=
"text/javascript"
src=
"
<?=
$base_url
?>
javascript/jquery_plugins/jqGrid/4.4.0/js/i18n/grid.locale-ru.js"
></script>
<script
type=
"text/javascript"
src=
"
<?=
$base_url
?>
javascript/jquery_plugins/jqGrid/4.4.0/js/jquery.jqGrid.min.js"
></script>
<script
type=
"text/javascript"
src=
"
<?=
$base_url
?>
javascript/jquery_plugins/jqGrid/4.4.0/src/grid.subgrid.js"
></script>
<script
type=
"text/javascript"
src=
"
<?=
$base_url
?>
javascript/typos.js"
></script>
<!-- -->
<table
id=
"table_sites"
></table>
<div
id=
"additional_panel"
></div>
<script
type=
"text/javascript"
>
jQuery
(
"#table_sites"
).
jqGrid
({
//Привязка плагина к таблице
url
:
'
<?=
$base_url
?>
users/typos/get_list_sites'
,
//Получить список сайтов пользователя
editurl
:
'
<?=
$base_url
?>
users/typos/panel_sites'
,
datatype
:
"json"
,
//Формат скрипта-обработчика
colNames
:
[
'Номер'
,
'Сайт'
,
'Подписан'
],
colModel
:
[
{
name
:
"id"
,
index
:
's.id'
,
width
:
10
,
searchtype
:
"integer"
,
align
:
'center'
},
{
name
:
"site"
,
index
:
's.site'
,
align
:
'center'
,
width
:
20
,
searchtype
:
"string"
},
{
name
:
"status"
,
index
:
'r.status'
,
editable
:
true
,
align
:
'center'
,
width
:
20
,
edittype
:
"checkbox"
,
editoptions
:
{
value
:
"1:0"
},
searchtype
:
"integer"
,
formatter
:
'checkbox'
}
],
//Подтаблица с сообщениями об опечатках
subGrid
:
true
,
subGridRowExpanded
:
function
(
subgrid_id
,
row_id
)
{
//Дополнительные переменные
var
subgrid_table_id
,
pager_id
;
subgrid_table_id
=
subgrid_id
+
"_t"
;
pager_id
=
"p_"
+
subgrid_table_id
;
$
(
"#"
+
subgrid_id
).
html
(
"<table id='"
+
subgrid_table_id
+
"' class='scroll'></table><div id='"
+
pager_id
+
"' class='scroll'></div>"
);
jQuery
(
"#"
+
subgrid_table_id
).
jqGrid
({
url
:
'
<?=
$base_url
?>
users/typos/get_list_messages?id='
+
row_id
,
editurl
:
'
<?=
$base_url
?>
users/typos/panel_messages?id_site='
+
row_id
+
'&id='
+
row_id
,
datatype
:
"json"
,
colNames
:
[
'Номер'
,
'Принято?'
,
'Ссылка'
,
'Текст'
,
'Исправление'
,
'Контекст'
,
'Дата добавления'
],
colModel
:
[
{
name
:
"id"
,
index
:
"m.id"
,
width
:
80
,
searchtype
:
"integer"
,
align
:
'center'
},
{
name
:
"status"
,
index
:
"m.status"
,
width
:
80
,
editable
:
true
,
edittype
:
"checkbox"
,
editoptions
:
{
value
:
"1:0"
},
searchtype
:
"integer"
,
align
:
'center'
,
formatter
:
'checkbox'
},
{
name
:
"link"
,
index
:
"m.link"
,
width
:
80
,
sortable
:
false
,
searchtype
:
"string"
,
align
:
'center'
,
editable
:
true
},
{
name
:
"error_text"
,
index
:
"m.error_text"
,
width
:
80
,
sortable
:
false
,
searchtype
:
"string"
,
align
:
'center'
,
editable
:
true
},
{
name
:
"comment"
,
index
:
"m.comment"
,
width
:
80
,
sortable
:
false
,
searchtype
:
"string"
,
align
:
'center'
,
editable
:
true
},
{
name
:
"context"
,
index
:
"m.context"
,
width
:
80
,
searchtype
:
"text"
,
sortable
:
false
,
editable
:
false
,
align
:
'center'
},
{
name
:
"date"
,
index
:
"m.date"
,
width
:
120
,
searchtype
:
"date"
,
align
:
'center'
},
],
rowNum
:
20
,
pager
:
pager_id
,
sortname
:
'm.date'
,
sortorder
:
'desc'
,
height
:
'100%'
,
width
:
1000
,
});
jQuery
(
"#"
+
subgrid_table_id
).
jqGrid
(
'navGrid'
,
"#"
+
pager_id
,
{
edit
:
true
,
add
:
true
,
del
:
true
},
{
//Скрываем ненужные поля при редактировании
afterShowForm
:
function
()
{
$
(
'#tr_link'
).
css
(
'display'
,
'none'
);
$
(
'#tr_error_text'
).
css
(
'display'
,
'none'
);
$
(
'#tr_comment'
).
css
(
'display'
,
'none'
);
},
},
{
//При добавлении показываем поля (т.к. редактирование - скрывает их навсегда)
afterShowForm
:
function
()
{
$
(
'#tr_link'
).
css
(
'display'
,
'table-row'
);
$
(
'#tr_error_text'
).
css
(
'display'
,
'table-row'
);
$
(
'#tr_comment'
).
css
(
'display'
,
'table-row'
);
}
}
)
},
caption
:
"Сайты"
,
rowNum
:
10
,
rowList
:
[
10
,
20
,
30
],
width
:
1200
,
height
:
'100%'
,
pager
:
'#additional_panel'
,
//Привязка к таблице тулбара
sortname
:
's.id'
,
viewrecords
:
true
,
sortorder
:
"asc"
});
jQuery
(
"#table_sites"
).
jqGrid
(
'navGrid'
,
'#additional_panel'
,
//Управление тулбаром таблицы
{
edit
:
true
,
add
:
false
,
del
:
false
}
//Отключаем от тулбара редактирование, добавление и удаление записей. На тулбаре останутся только две кнопки: "Поиск" и "Обновить"
);
</script>
<div
id=
"context-block"
title=
"Контекст ошибки"
class=
"hidden"
>
<p
id=
"context-block-text"
></p>
</div>
</div>
</div>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment