Модуль:Поиск шаблона страницы: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 2: | Строка 2: | ||
function p.main(frame) | function p.main(frame) | ||
local | local modName = frame.args[1] | ||
if not modName then | |||
return "Параметр не задан" | |||
if | |||
return " | |||
end | end | ||
local title = mw.title.getCurrentTitle() | local title = mw.title.getCurrentTitle() | ||
if not title then | |||
if not | return "Не удалось получить заголовок страницы" | ||
return " | |||
end | end | ||
local | local content = title:getContent() or "" | ||
if string.find(content, "{{#invoke:" .. modName) then | |||
return "Да" | |||
else | |||
return "Нет" | return "Нет" | ||
end | end | ||
end | end | ||
return p | return p | ||